腾讯智能对话平台TBP 返回的数据结构

https://cloud.tencent.com/document/product/1060/37438#.E7.A4.BA.E4.BE.8B1-.E6.9C.BA.E5.99.A8.E4.BA.BA.E5.AF.B9.E8.AF.9D.E6.9C.8D.E5.8A.A1.E6.8E.A5.E5.8F.A3

首先在这个链接里的示例输出似乎并不对,

{
  "Response": {
    "DialogStatus": "START",
    "BotName": "botname",
    "IntentName": "intentName",
    "SlotInfoList": null,
    "InputText": "hi",
    "ResponseMessage": {
      "GroupList": [
        {
          "ContentType": "text/plain",
          "Url": "www.baidu.com",
          "Content": "hello"
        },
        {
          "ContentType": "audio/wav",
          "Url": "www.baidu.com",
          "Content": "xccv"
        }
      ]
    },
    "ResultType": "1",
    "SessionAttributes": "xxx"
  }
}

因为我收到的TBP的API返回的数据形式是:

{'DialogStatus': '', 'BotName': '', 
'IntentName': '', 
'SlotInfoList': [],
 'InputText': '额和', 
'ResponseMessage': 
{'GroupList': [{'ContentType': 'text/plain',
 'Url': '', 
'Content': '我不明白你要说什么。'}]},
 'SessionAttributes': '',
 'ResultType': '3',
 'RequestId':
 'xxxxxxxxxx'}

不知道为什么,似乎是腾讯忘了更新文档??

另外在这个链接可以找到  Group  ResponseMessage SlotInfo 的数据结构文档:

https://cloud.tencent.com/document/product/1060/37439

原文地址:https://www.cnblogs.com/mrlonely2018/p/13087164.html