【问题标题】:Watson Conversation_Nodes that has no response没有响应的 Watson Conversation_Nodes
【发布时间】:2017-06-06 16:16:10
【问题描述】:

所以我像下面这样写了这段 JSON 代码

{
  "context": {
    "action": {
      "dates": "$dates",
      "command": [
        "check-dates"
      ]
    },
    "output": {
      "text": {
        "values": [
          "$dates, Do you want to pick this as a designated date?"
        ]
      }
    }
  },
  "output": {}
} 

问题是这不像我预期的那样算作响应,我试图删除最后一个“输出”的东西,但是每当我出于某种原因再次单击节点时它就会弹出。任何建议都非常受欢迎:D 谢谢

【问题讨论】:

    标签: json ibm-watson chatbot watson-conversation


    【解决方案1】:

    您的 JSON 有一些不正确的语法。您尚未关闭上下文中的所有 JSON 值

    有答案:

    {
      "context": {
        "action": {
          "dates": "$dates",
          "command": [
            "check-dates"
          ]
        }
      },
      "output": {
        "text": {
          "values": [
            "Your answer here."
          ],
          "selection_policy": "sequential"
        }
      }
    }
    

    如果您不希望用户得到一个响应,请将 [] 留空,例如:

    {
      "context": {
        "action": {
          "dates": "$dates",
          "command": [
            "check-dates"
          ]
        }
      },
      "output": {
        "text": {
          "values": [
            ""
          ],
          "selection_policy": "sequential"
        }
      }
    }
    

    我建议您确保您的 JSON 语法是否正确 here

    【讨论】:

    • 感谢您的链接!显然,Watson Conversation JSON 编辑器存在一些问题
    • 我不知道为什么,但是它只是通过放置最后一个输出来自我纠正,但是当我再次复制这些值时,它工作正常。
    • { "context": { "action": { "dates": "$dates", "command": [ "check-dates" ] }, "output": { "text": { "values": [ "$dates, 你的日期?" ] } } }, "output": { "text": { "values": [ "$dates, 你的日期?" ] } } }
    • 这是因为您的 JSON 现在是正确的,有时 IBM 会为您正确,或者显示您的 json 错误。我在你的问题中测试了你的 json 并且有一个不正确的语法。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-08-27
    • 2015-11-28
    • 1970-01-01
    • 2017-07-05
    相关资源
    最近更新 更多