docker compose up
python -m uvicorn main:app --reload --port 8019
API documentation (swagger) is available at localhost:8019/guidance/docs.
- You define guidance strategies and actions as yaml files (in this example, located under
./backend/app/strategy_configs) - You include the guidance engine application into your FastAPI app (see
./backend/app/main.py) - In said file, you configure the path to your strategy yamls
- You define your state vector, also as a yaml file (see
./backend/app/state_vector/vector.yaml)
- Think about which elements you want to have as part of your analysis state vector (The vector is simply a python dictionary at the moment)
- Configure an appropriate state vector in the yaml file. You can add arbitrarily named callbacks -- we'll see below how you use them.
- Replace the example strategies in the
./backend/strategy_configsfolder with your own - All strategies are evaluated every two seconds, or when you update the state vector.
- Generated suggestions are sent via a websocket to which you should subscribe in your frontend (see
./frontend/src/app/services/channel.service.tsfor an example) - Suggestions look like this on the socket:
{
type: 'guidance',
interaction: 'make'
suggestion: {
id: str,
strategy: str,
title: str,
description: str,
degree: str
event: {
value: Any,
action_id: str
}
}
}
- In all your visualization components, filter for the suggestions you need (e.g., by strategy and action_id)
- Currently, you will only receive interaction-type make from the server :)
- When users accept/reject guidance, call the respective REST endpoints.
- When your application state changes, you can either update the state vector as key-value pairs, or call any of the callback functions you defined in your yaml to perform more complex operations.