In the project I’m working on, I have replaced rasa-nlu with a custom Interpreter subclass which returns a json in rasa nlu format.
Now I want the chatbot to run the custom action form, when the intent is detected.
I ran the action endpoint local server and it registered my form action.
My FormAction returns a custom string message and I have also used a dispatcher to utter the same custom message.
When I run it, the nlu works fine and the agent is initialized without issues but there is no response and also NO debug / error messages.
I ran the examples and in the formbot example the rasa process starts, form action is activated and is run but in my code there is no error, no warning and no output.
Please tell me how to debug Agent and why I’m not getting any logging messages.
Update:
I created a mock json that is to be sent to the action server with required entities and slots filled and POSTed it using Postman and the action correctly called the API and returned a response.
So clearly the issue is occurring within the Agent.
Also, agent.is_ready() returns -> True
Update2:
I was running the python chatbot as a service using nginx. So I was unable to debug without changing all the file paths etc.
So I copied the project, removed all but essentials and the interpreter and rasa agent logic and debugged it. It ran correctly, sent a request to action server and received correct response.
However, when I run the same code through the service, I get no response from the agent and the action server has nothing indicating the form action was called/executed like it did when debugging.
I was running the chatbot as a nginx service and so debugging the code is not possible.
What I did was to copy only the relevant files to a separate project, debug them in the IDE, and find out the issue.
The biggest issue was that the FormAction slot utterances were not being uttered.
I realised that I hadn’t written them into the domain file.
As soon as I added the utter_ask_SLOT utterances to the domain file, and trained it, the bot was correctly giving me the appropriate response.
I still cannot debug the nginx service however, I can write a bunch of app.logger.debug() statements to debug the flask app. I cannot debug the agent as that is running as a service.
@Juste, I have downloaded and installed rasa from the github source. I use VS Code as IDE.
Created a test bot using rasa init. When I run this bot using rasa shell --debug, I want to hit the debug break point in rase core code. So just wondering how this can be set.
I’m using rasa_core_sdk version 0.13.0 but this should apply to other versions before 1.x.x.
Open the package files (rasa_core_sdk), open endpoint.py, and find the following code:
You must be typing the command line script to run rasa action server.
Instead of starting action server using that command, replace/comment the code shown above with:
Make in VS Code a launch.json file, where you configure the settings for your debugger. Specify under the point “program” the file you wrote in 1. ( and its path).
I tried following this. While debugging I got the below error
Exception has occurred: ModuleNotFoundError
No module named ‘rasa’
File “C:\Projects\Bot\my_rasa_run.py”, line 23, in
from rasa.main import main
line 23 has this:
from rasa.main import main
I have given my environment name in conda activate line
os.system(“conda activate py37”)
and when I check the activated version with below command it still shows base env. So the env on which I have installed Rasa and all is not getting loaded.
os.system(“conda info --envs”)
I am on Windows. Any ideas on why the environment is not getting loaded?