Rasa nlu服务器问题,错误500和解析

时间:2019-08-16 08:39:27

标签: rasa-nlu rasa

我通过在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}

原因是什么?我应该怎么做才能获得normal(200)输出?

2 个答案:

答案 0 :(得分:0)

请尝试一下,看看是否可行。

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

答案 1 :(得分:0)

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!"}]