This service implements a rasa assistant to manage the dialog between the user and the voicebot. Our assistant uses custom actions which require connection to the GDO GraphQL. So, please, if you'd like to use it, make sure that ove server is launched by entering npm start
in your console in the proper directory. Else, you won't be able to use custom actions.
Moreover, you'll also have to update demo and tag entities each day, before training your model. Do python update_demos_tags.py
with ove server running.
Please, follow this documentation to install rasa on a virtual environment.
You will not have to init a rasa-project, you can use the proposed project and adapt it as you wish. However, before any other actions, if you change the training data or the hyperparameters, polycies and so on, you'll have to retrain your model doing rasa train -d config/domain.yml -c config/config.yml
in your virtual environment.
Just do rasa test
in your virtual environment
Execute rasa shell
if you don't use any custom actions and rasa shell --endpoints config/endpoints.yml
else, always in your virtual environment.
Execute rasa run actions --actions actions
in your virtual environment.
In the tests folder, execute python -m unittest test_utils_graphql.py
and python -m unittest test_utils.py
in your virtual environment.
In dialog_manager_service, there's a Makefile which will help you to execute the different rasa commands on docker. Plese, see, the Rasa documentation on Docker to have more information about how the different commands work.
Rasa provides several docker images. First, do make docker rasa
to build rasa and rasa-sdk images on your docker.
To train your assistant, use make train
To test your assistant, use make test
To communicate with your assistant on shell server, execute make shell
. Please, take into account that if you want to use custom actions you'll have the following steps to consider:
- For the first time, create a network with
make network
. - Then, run actions with
make actions
. - Go to endpoints.yml, comment the localhost action endpoint and uncomment this :
url: "http://action-server:5055/webhook"
. - In the Makefile, uncomment
docker run -it -v $(shell pwd)):/app -p 5005:5005 --net rasa-net rasa/rasa:1.10.9-full shell --endpoints config/endpoints.yml
in shell part and comment the old command. - Now, you can
make shell
.
Once you finished, you can make stop actions
to stop actions server running on docker. It happens that the server is still running and leads to errors when restarting the action-server. In this case, you can make remove action-server
.
Do make server
to simply run rasa server. Please if you use custom actions for the first time, please follow the 2nd and 3rd steps of Shell.
If you want to use docker-compose, execute docker-compose up
in the gdo_voicebot folder.
In the docs folder, you'll find python documentation about the Dialog manager service.
To generate your own documentation, please use pdoc --html -o docs/ <file_1.py> <file_2.py>
replacing <file_n.py>
by the files containing documented code. If you want to use python scripts that are already implemented and to modify or update them just with new documentation, do pdoc --html --force -o docs/ actions/actions.py utilities/utils_graphql.py utilities/utils_actions.py utilities/actions_tools.py utilities/utils.py
.