dialogflow中的自定义有效负载没有响应

时间:2018-10-02 08:37:09

标签: chatbot dialogflow

我在Dialog流响应中为文本响应做了一个简单的自定义有效载荷

{
  "messages": [
    {
      "speech": "Text response",
      "type": 0
    }
  ]
} 

但是它给了我Not available

这是我的Raw Api回复

{
  "id": "d5143e9a-e578-474f-bca4-fe993dd62649",
  "timestamp": "2018-10-02T08:30:54.035Z",
  "lang": "en",
  "result": {
    "source": "agent",
    "resolvedQuery": "what do you know about Data science",
    "action": "",
    "actionIncomplete": false,
    "parameters": {},
    "contexts": [],
    "metadata": {
      "intentId": "a1c71c95-3126-4076-81f7-ddf7a4da1bad",
      "webhookUsed": "false",
      "webhookForSlotFillingUsed": "false",
      "isFallbackIntent": "false",
      "intentName": "data1"
    },
    "fulfillment": {
      "speech": "",
      "messages": [
        {
          "type": 4,
          "payload": {
            "messages": [
              {
                "speech": "Text response",
                "type": 0
              }
            ]
          }
        }
      ]
    },
    "score": 1
  },
  "status": {
    "code": 200,
    "errorType": "success"
  },
  "sessionId": "df6b3e49-d49b-4311-cb9f-2946febfcc8b"
}

这里是截图 enter image description here 我无法理解此问题。。。 ...................................................

1 个答案:

答案 0 :(得分:0)

您在square brackets之后丢失fulfillment。尝试使用以粗体标记的方括号。也不确定单独执行是否可以编写满额消息

"fulfillment": [{
      "speech": "",
      "messages": [
        {
          "type": 4,
          "payload": {
            "messages": [
              {
                "speech": "Text response",
                "type": 0
              }
            ]
          }
        }
      ]
    },
    "score": 1
  },
  "status": {
    "code": 200,
    "errorType": "success"
  },
  "sessionId": "df6b3e49-d49b-4311-cb9f-2946febfcc8b"
}]