This component is distributed as a Docker image
There are several ways to use the API:
- Building and running from sources
- Running as a PyPi package (currently WIP)
- Building and running as a local Docker container
- Pulling and running released Docker image (recommended)
- Accessing a remotely started Docker container (currently not available)
- Install Docker Desktop on your system (official instructions)
- Pull the image:
docker pull demid5111/ldss-core-api:0.3
- Run the image:
docker run -p 1234:5000 --name core_api -it demid5111/ldss-core-api:0.3
- Proceed to section Working with Decision Maker as a service with
127.0.0.1:1234
as a service URL
You need to make a request to the URL where it is running, for example for local use case you need to send
POST request to http://localhost:1234/api/v1/make-decision
and as a payload send a dictionary:
{
"task_description": <HERE GOES JSON with description>
}
Example of such a JSON file is present in ./core_api/core_api/async_tasks/decision_maker/scripts/bin/description_multilevel.json.
Example Python code that demonstrates how to make a request is present in
./core_api/demo/demo_request.py, example Javascript code is present in
./core_api/core_api/templates/index.html)
(functionpostNewMakeDecisionTask
).