As far as docs are incomplete, I follow those guides that we have:
Create a custom action as code with name and run methods filled properly.
Define it in a domain
Add it as an action to a story step
Comment out in endpoints.yml: action_endpoint: url: "http://localhost:5055/webhook"
Im using PyCharm as IDE, so in separate terminals I pass rasa run actions
and rasa shell
(after training ofcourse).
After shell is loaded I get a prompt for interaction.
When I get into story that uses custom action I always ran into this error:
Traceback (most recent call last):
File “c:\programdata\anaconda3\lib\site-packages\rasa\core\processor.py”, line 773, in _run_action
output_channel, nlg, temporary_tracker, self.domain
File “c:\programdata\anaconda3\lib\site-packages\rasa\core\actions\action.py”, line 673, in run
f"Failed to execute custom action ‘{self.name()}’ "
rasa.shared.exceptions.RasaException: Failed to execute custom action ‘action_balance_choice’ because no endpoint is configured to run this custom action. Please take a look at the docs and set an endpoint configuration via the --endpoints flag. Custom Actions
When I look at the docs - there are no clues on how to handle that - just a cyclic linking between pages, where one should expect some new issues.
Another question is - do I need (and how) to run any cli command to get any non-model changes to ran into actual state on execution? Like for example changes made to endpoints.yml - how and when those changes become actual to the running program?
2021-08-21 15:39:06 INFO rasa_sdk.endpoint - Starting action endpoint server…
2021-08-21 15:39:06 INFO rasa_sdk.executor - Registered function for ‘action_balance_choice’.
2021-08-21 15:39:06 INFO rasa_sdk.endpoint - Action endpoint is up and running on http://0.0.0.0:5055
@notrickyd Heya! Did you created the condo environment of python and installed rasa and rasa-sdk then or you working directly install the rasa in project working directory in PyCharm?
As, from the above error, you not created the environment.
@notrickyd Try delete the older trained models and re-train the model and try run.
Hi!
Well yes, i didnt set up separate conda-env. But I used the default env with Conda set up. I also dont remember to install rasa-sdk directly - just rasa install only.
Therefore, it seems there is a mess with default playground project that is downloaded from the rasa.com. After uncommenting the initial lines of action_endpoint seems that url section must strictly be 4 spaces from left, otherwise it is handled as separate option.
When I did that - rasa actions server started to reply with a 500 Internal Server Error.
Then I run rasa run actions -vv in debug mode and found from console that there is an error in actions.py on a certain line. When I fix it - everything got fine.
Summary: no reinstall or retrain is needed. Just fixing minor bugs on the web-site of rasa.com.
Also a help might come from this docs: Rasa Action Server Documentation and using Postman to POST http://localhost:5055/webhook
with a certain payload one can check if the server answers.
Also GET http://localhost:5055/actions
will show one’s custom actions submitted to server