Api Watson:对话,内部错误 [英] Api Watson : Conversation, internal error

查看:69
本文介绍了Api Watson:对话,内部错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Watson的Conversation API的 updateWorkspace 函数,但是我总是遇到此错误:

I am trying to use the updateWorkspace function of the Conversation API of Watson but I always get this error :

{"error":"Internal Error"}

我的请求如下:

curl 
-H "Content-Type: application/json" -X POST 
-u "username":"password"
-d "{\"name\":\"Edubot\",\"dialog_nodes\":
[{\"dialog_node\":\"bonjour\",\"conditions\":\"#Bonjour\",\"output\":
{\"text\":{\"values\":[\"bonjour\"],\"selection_policy\":\"sequential\"}}},    
{\"\dialog_node\":\"Aurevoir\",\"conditions\":\"#Aurevoir\",\"output\":
{\"text\":{\"values\":[\"Au revoir\"],\"selection_policy\":\"sequential\"}}}]}" 
"https://gateway.watsonplatform.net/conversation/api/v1/workspaces/workspace_id?version=2016-09-20"

奇怪的是,如果仅放置一个对话框节点,效果很好,但是如果添加两个或更多对话框节点,则会出现内部错误.

The strange thing is that if I put only one dialog node it works great, but if I add two dialog nodes or more I get the internal error.

推荐答案

当对话框树中有多个节点时,需要在节点定义中指定"previous_sibling"属性,否则对话框树将保持未定义状态.例如,

When you have more than one nodes in your dialog tree, you need to specify "previous_sibling" attribute in your node definition, otherwise the dialog tree remains undefined. For example,

{
    "dialog_nodes": [
        {
            "conditions": "#Bonjour",
            "dialog_node": "bonjour",
            "output": {
                "text": {
                    "selection_policy": "sequential",
                    "values": [
                        "bonjour"
                    ]
                }
            }
        },
        {
            "conditions": "#Aurevoir",
            "dialog_node": "Aurevoir",
            "output": {
                "text": {
                    "selection_policy": "sequential",
                    "values": [
                        "Au revoir"
                    ]
                }
            },
            "previous_sibling": "bonjour"
        }
    ]
}

这篇关于Api Watson:对话,内部错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆