【问题标题】:Dialogflow V2 Context and Action using API JSON使用 API JSON 的 Dialogflow V2 上下文和操作
【发布时间】:2019-10-22 22:44:08
【问题描述】:

我正在尝试使用 Google DialogFlow 开发机器人,但在尝试访问 Intent 中的特定 Action 时遇到问题。

我需要接收IntentAction中配置的变量(名称、颜色):

但是,当我对 DialogFlow 进行查询时:

{
    "queryInput": {
        "text": {
            "text": "I need something",
            "languageCode": "en-US"
        }
    },
    "queryParameters" : {
        "contexts" : [ "I put all contexts created here" ]
    }

}

机器人跳过创建的action 并继续到Default-Intent

很遗憾,Dialogflow 文档中没有足够的信息,您知道我是否也必须通过 JSON 发送该特定操作的名称吗?我能做什么?

【问题讨论】:

    标签: node.js json dialogflow-es


    【解决方案1】:

    我找到了我的问题的答案。要访问context 并使用action parameters,结构是

     "queryParams" : {
     "contexts" : [{
           "name": "Name of the context",
           "lifespanCount": 2,
           "parameters": { "The parameters you are using in that Intent"}
     }]
     }
    

    所以,不要使用queryParameters,而是使用queryParams

    【讨论】:

      猜你喜欢
      • 2018-12-16
      • 2020-02-21
      • 1970-01-01
      • 1970-01-01
      • 2019-01-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多