【问题标题】:Rasa nlu server problem with the error 500 and parsing带有错误 500 和解析的 Rasa nlu 服务器问题
【发布时间】:2019-08-16 08:39:27
【问题描述】:

我通过在 cmd 中输入以下命令启动了 nlu 服务器:

    rasa run --enable-api -m models/(name of my package).tar

然后在其他cmd窗口中输入:

    curl localhost:5005/model/parse -d ‘{“text”:“hello”}’

之后我得到一个错误:

    {“version”:“1.2.3”,“status”:“failure”,“message”:“An unexpected error 
    occurred. Error: Failed when parsing body as 
    json”,“reason”:“ParsingError”,“details”:{},“help”:null,“code”:500}

这是什么原因?我应该改变什么以获得正常(200)输出?

【问题讨论】:

标签: rasa-nlu rasa


【解决方案1】:

你可以试试这个,看看它是否有效。

rasa run -m models --enable-api --cors ‘*’ --debug

【讨论】:

  • 感谢您的回复,很遗憾,还是一样。
【解决方案2】:

CURL POST 请求(Mac 和 Ubuntu):

curl -H "Content-Type: application/json"  -X POST -d '{"sender":"y1mLd","message":"hi"}' http://localhost:5005/webhooks/rest/webhook

注意:对于 windows,您需要删除引号

curl -H "Content-Type: application/json"  -X POST -d {"sender":"y1mLd","message":"hi"} http://localhost:5005/webhooks/rest/webhook

输出

[{"recipient_id":"y1mLd","text":"Welcome, Please let me know how I could be a help today!"}]

【讨论】:

    猜你喜欢
    • 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
    相关资源
    最近更新 更多