使用RASA API(rasa.core.processor-遇到异常)的正确方法是什么?

风滚草

我安装了rasa-demo代码示例。为了打开rasa API,我这样做了:

user@User:~/rasa-demo ‹master*›$ rasa run
No chat connector configured, falling back to the REST input channel. To connect your bot to another channel, read the docs here: https://rasa.com/docs/rasa/user-guide/messaging-and-voice-channels
2020-06-19 13:20:02 INFO     root  - Starting Rasa server on http://localhost:5005
2020-06-19 13:20:08 INFO     absl  - Using /var/folders/h5/9rj1zn8x4s59bk_mg_ktzv740000gn/T/tfhub_modules to cache modules.
2020-06-19 13:20:08 INFO     absl  - Downloading TF-Hub Module 'http://models.poly-ai.com/convert/v1/model.tar.gz'.
2020-06-19 13:20:26 INFO     absl  - Downloading http://models.poly-ai.com/convert/v1/model.tar.gz: 22.35MB
2020-06-19 13:20:43 INFO     absl  - Downloading http://models.poly-ai.com/convert/v1/model.tar.gz: 42.35MB
2020-06-19 13:21:02 INFO     absl  - Downloading http://models.poly-ai.com/convert/v1/model.tar.gz: 82.35MB
2020-06-19 13:21:21 INFO     absl  - Downloading http://models.poly-ai.com/convert/v1/model.tar.gz: 118.59MB
2020-06-19 13:21:40 INFO     absl  - Downloading http://models.poly-ai.com/convert/v1/model.tar.gz: 148.59MB
2020-06-19 13:21:41 INFO     absl  - Downloaded http://models.poly-ai.com/convert/v1/model.tar.gz, Total size: 152.02MB
2020-06-19 13:21:41 INFO     absl  - Downloaded TF-Hub Module 'http://models.poly-ai.com/convert/v1/model.tar.gz'.
2020-06-19 13:22:14 INFO     root  - Rasa server is up and running.

如何查询聊天机器人的API?我希望能够发出请求并通过请求进行对话,而不是使用shell。到目前为止,当我尝试对rasa服务器进行调整时:

在:

user@User:~ $ curl -XPOST localhost:5005/webhooks/rest/webhook -d '{"message":"hi"}'

出:

[]%

在rasa运行服务器上,我得到以下响应:

2020-06-19 13:23:17 ERROR    rasa.core.actions.action  - Failed to run custom action 'action_greet_user'. Couldn't connect to the server at 'http://localhost:5055/webhook'. Is the server running? Error: Cannot connect to host localhost:5055 ssl:default [Connection refused]
2020-06-19 13:23:17 ERROR    rasa.core.processor  - Encountered an exception while running action 'action_greet_user'. Bot will continue, but the actions events are lost. Please check the logs of your action server for more information.
2020-06-19 13:24:04 ERROR    rasa.core.actions.action  - Failed to run custom action 'action_greet_user'. Couldn't connect to the server at 'http://localhost:5055/webhook'. Is the server running? Error: Cannot connect to host localhost:5055 ssl:default [Connection refused]
2020-06-19 13:24:04 ERROR    rasa.core.processor  - Encountered an exception while running action 'action_greet_user'. Bot will continue, but the actions events are lost. Please check the logs of your action server for more information.

它不起作用。请求Rasa服务器作为API的正确方法是什么?阅读文档后,我不清楚如何正确使用API​​。

我也尝试过这个:

在:

import requests

response = requests.get('http://localhost:5005/webhooks/rest/webhook') 
print(response) 
print(response.headers) 
print(response.content)

出:

<Response [405]>
{'Connection': 'keep-alive', 'Keep-Alive': '5', 'Allow': 'POST', 'Access-Control-Allow-Credentials': 'true', 'Content-Length': '60', 'Content-Type': 'text/plain; charset=utf-8'}
b'Error: Method GET not allowed for URL /webhooks/rest/webhook'
风滚草

我最终弄清楚了这是您要求终点的方式:

localhost:5005/model/parse -s -d '{ "text": "hi" }'

文档应更清晰。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

Windows API-使用WriteFile编写std :: string的正确方法是什么?

来自分类Dev

查找用户是否使用MVC WEB API登录的正确方法是什么?

来自分类Dev

使用maven-processor-plugin生成JPA元模型文件-重新生成的便捷方法是什么?

来自分类Dev

嵌套异常的正确方法是什么?-使用Delphi

来自分类Dev

POST请求更改为RASA中的OPTIONS

来自分类Dev

RASA-rasa运行操作-本地主机问题

来自分类Dev

如何使用docker将rasa服务器暴露于松弛状态?

来自分类Dev

如何在Rasa中的nlu.md中使用类似示例进行意图分类

来自分类Dev

对于服务机器人,我应该使用ChatScript还是Rasa?

来自分类Dev

Kafka Processor API中标头的用途是什么?

来自分类Dev

Rasa网络聊天集成问题

来自分类Dev

使用pytest断言表达式引发异常的正确方法是什么?

来自分类Dev

“ rasa run actions和rasa shell”冻结终端

来自分类Dev

使用默认命令设置rasa-x管理员密码时出现错误

来自分类Dev

FormAction如何在rasa core中工作?

来自分类Dev

Rasa安装要求不兼容

来自分类Dev

Dropbox Core API:不建议使用的方法

来自分类Dev

使用Facebook Graph API更新照片上“已发布”字段的正确方法是什么?

来自分类Dev

使用带有 python API 而不是 HTTP 服务器的 Rasa NLU 模型

来自分类Dev

从多个模型解析 Rasa NLU

来自分类Dev

Rasa Core - 理解故事

来自分类Dev

AttributeError: 'NoneType' 对象没有使用 RASA 的属性 'index'

来自分类Dev

需要帮助使用 docker 设置 Rasa NLU 服务器

来自分类Dev

在生成 Excel 或 PDF 文件作为响应的 REST API 中处理异常的正确方法是什么?

来自分类Dev

如何使用RASA检测actions.py中的聊天平台?

来自分类Dev

Rasa Core - 无法访问操作模板名称,因为该名称不是该域的注册操作

来自分类Dev

如何在使用 Spacy 作为管道的同时提高 Rasa NLU 的准确性?

来自分类Dev

rasa.core.processor - 运行动作时遇到异常

来自分类Dev

使用asp .net core web api配置react js应用程序的最佳方法是什么

Related 相关文章

  1. 1

    Windows API-使用WriteFile编写std :: string的正确方法是什么?

  2. 2

    查找用户是否使用MVC WEB API登录的正确方法是什么?

  3. 3

    使用maven-processor-plugin生成JPA元模型文件-重新生成的便捷方法是什么?

  4. 4

    嵌套异常的正确方法是什么?-使用Delphi

  5. 5

    POST请求更改为RASA中的OPTIONS

  6. 6

    RASA-rasa运行操作-本地主机问题

  7. 7

    如何使用docker将rasa服务器暴露于松弛状态?

  8. 8

    如何在Rasa中的nlu.md中使用类似示例进行意图分类

  9. 9

    对于服务机器人,我应该使用ChatScript还是Rasa?

  10. 10

    Kafka Processor API中标头的用途是什么?

  11. 11

    Rasa网络聊天集成问题

  12. 12

    使用pytest断言表达式引发异常的正确方法是什么?

  13. 13

    “ rasa run actions和rasa shell”冻结终端

  14. 14

    使用默认命令设置rasa-x管理员密码时出现错误

  15. 15

    FormAction如何在rasa core中工作?

  16. 16

    Rasa安装要求不兼容

  17. 17

    Dropbox Core API:不建议使用的方法

  18. 18

    使用Facebook Graph API更新照片上“已发布”字段的正确方法是什么?

  19. 19

    使用带有 python API 而不是 HTTP 服务器的 Rasa NLU 模型

  20. 20

    从多个模型解析 Rasa NLU

  21. 21

    Rasa Core - 理解故事

  22. 22

    AttributeError: 'NoneType' 对象没有使用 RASA 的属性 'index'

  23. 23

    需要帮助使用 docker 设置 Rasa NLU 服务器

  24. 24

    在生成 Excel 或 PDF 文件作为响应的 REST API 中处理异常的正确方法是什么?

  25. 25

    如何使用RASA检测actions.py中的聊天平台?

  26. 26

    Rasa Core - 无法访问操作模板名称,因为该名称不是该域的注册操作

  27. 27

    如何在使用 Spacy 作为管道的同时提高 Rasa NLU 的准确性?

  28. 28

    rasa.core.processor - 运行动作时遇到异常

  29. 29

    使用asp .net core web api配置react js应用程序的最佳方法是什么

热门标签

归档