Rasa custom actions not connected

帅比萌擦擦* 提交于 2020-01-16 04:18:08

问题


So, I just started with Rasa this week, but I’m quite happy with the results so far, as in that it responds well et cetera. However, I now have custom actions in an actions.py file, but when I’m in the rasa shell it seems to miss that file entirely and asks for another input. (see the image below) It doesn't even give an error. What am I doing wrong?

I tried to run "rasa run actions" in another terminal, with an action_endpoint in the endpoints.yml file.

In the endpoints file:

`action_endpoint:
  url: "http://localhost:5055/webhook"`

This is the part I'm running in the separate terminal:

`(actions) C:\.potato>python -m rasa_sdk --actions actions
2019-07-11 10:29:16 INFO     rasa_sdk.endpoint  - Starting action endpoint server...
2019-07-11 10:29:17 INFO     rasa_sdk.executor  - Registered function for 'action_validate_cuisine'.
2019-07-11 10:29:17 INFO     rasa_sdk.executor  - Registered function for 'action_search_restaurants'.
2019-07-11 10:29:17 INFO     rasa_sdk.endpoint  - Action endpoint is up and running. on ('0.0.0.0', 5055)`

This is the output in the other terminal:

`(cozmobot) C:\.potato>rasa shell
2019-07-11 10:49:36 INFO     root  - Starting Rasa Core server on http://localhost:5005
Bot loaded. Type a message and press enter (use '/stop' to exit):
Your input ->  Hi!
Hey! What's up?
Your input ->  I'm hungry
What kind of restaurant would you like?
Your input ->  I would like italian
Your input ->  <HERE AN ANSWER SHOULD BE GIVEN BY THE BOT VIA ACTIONS.PY>
Your input ->  /stop
2019-07-11 10:50:19 INFO     root  - Killing Sanic server now.`

The third input should be answered by the bot with a correct restaurant. But for some reason it does not go there, without giving an error, and just asks for another input of the user.


回答1:


You need to add the --endpoints flag to the command, i.e. run

rasa shell --endpoints endpoints.yml



来源:https://stackoverflow.com/questions/56985323/rasa-custom-actions-not-connected

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!