Watson Assistant(Conversation)服务在通过API创建时与在浏览器中创建的行为不同

时间:2018-03-22 13:00:39

标签: watson-conversation

当我们在WebInterface中创建工作区时,与通过API创建相同的对话时,我们会看到不同的行为。

dialognode的JSON导出是相同的:

  

{“type”:“standard”,
      “title”:“SmallTalk:weerbericht”,         “输出”:{
  “text”:{                 “价值”:[],                 “selection_policy”:“顺序”}},
  “parent”:“smalltalk_container”,

     

“context”:{“user_weer”:“@ weerbericht”,             “user_location”:“@ plannamen”},
  “元数据”:{             “_customization”:{                 “mcr”:false}},
      “next_step”:{“behavior”:“jump_to”,“selector”:“condition”,“dialog_node”:“node_33_1519129633532”         },
  “条件”:“#ST_weersbericht”,
      “description”:null,         “dialog_node”:“node_9_1517408489377”,
        “previous_sibling”:“node_3_1518680265483”},

但是行为是不同的,这可以在我们查看UI时解释 它们是有区别的 这是通过浏览器创建的dialogNode的UI enter image description here

这是通过API创建的同一dialogNode的UI enter image description here

我们发现的一个区别是Multiple Reponse开关: enter image description here 应该是OFF(右边的图像)和JSON(mcr:false)。 但即使我们手动打开它,上下文变量也不会显示。

我应该在API中寻找什么来解决这个问题?

1 个答案:

答案 0 :(得分:1)

多个条件响应的对话模型是父节点需要是标准对话节点或框架。现在,当向此节点添加多个条件响应(从而使MCR节点在该父节点之外)时,您需要在此节点下添加一个带有"type":"response_condition"的对话节点。

这是一种如何通过api创建多个条件响应的方法。

为您提供创建MCR节点的示例: enter image description here

需要推送API的对话框节点的JSON如下所示:

{
    "type": "standard",
    "title": "mcr node",
    "output": {

    },
    "parent": null,
    "context": null,
    "metadata": {
        "_customization": {
            "mcr": true
        }
    },
    "next_step": null,
    "conditions": "#book_flight",
    "digress_in": "does_not_return",
    "description": null,
    "dialog_node": "node_8_1525086089064",
    "digress_out": "allow_all",
    "previous_sibling": null
},
{
    "type": "response_condition",
    "title": null,
    "output": {
        "text": {
            "values": ["I see city entity!"]
        }
    },
    "parent": "node_8_1525086089064",
    "context": null,
    "metadata": {

    },
    "next_step": null,
    "conditions": "@city",
    "description": null,
    "dialog_node": "node_9_1525086100114",
    "previous_sibling": null
},
{
    "type": "response_condition",
    "title": null,
    "output": {
        "text": {
            "values": ["I don't see anything."]
        }
    },
    "parent": "node_8_1525086089064",
    "context": null,
    "metadata": {

    },
    "next_step": null,
    "conditions": "anything_else",
    "description": null,
    "dialog_node": "node_10_1525086122332",
    "previous_sibling": "node_9_1525086100114"
}