【问题标题】:Rasa custom actions not connectedRasa 自定义操作未连接
【发布时间】:2019-07-11 08:56:43
【问题描述】:

所以,我这周刚开始使用 Rasa,但我对目前的结果非常满意,因为它反应良好等等。但是,我现在在 actions.py 文件中有自定义操作,但是当我在 rasa shell 中时,它似乎完全错过了该文件并要求另一个输入。 (见下图)它甚至没有给出错误。我做错了什么?

我尝试在另一个终端中运行“rasa run actions”,并且在 endpoints.yml 文件中有一个 action_endpoint。

在端点文件中:

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

这是我在单独终端中运行的部分:

`(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)`

这是另一个终端的输出:

`(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.`

机器人应该用正确的餐厅回答第三个输入。但由于某种原因,它不会去那里,没有给出错误,只是要求用户的另一个输入。

【问题讨论】:

    标签: action endpoint rasa-core rasa


    【解决方案1】:

    您需要在命令中添加--endpoints标志,即运行

    rasa shell --endpoints endpoints.yml

    【讨论】:

    • 就是这么简单 -_- 谢谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多