我收到“ API 版本 2:无法解析 JSON 响应字符串并出现“INVALID_ARGUMENT”错误:\“:找不到字段。\”。' 简单语音 webhook 响应的错误。
- - - - - - 错误 - - - - - - -
"debugInfo": {
"agentToAssistantDebug": {
"agentToAssistantJson": {
"message": "Unexpected apiai response format: Empty speech response",
"apiResponse": {
"id": "31f9c31d-3861-4262-8518-bd1f1e895f86",
"timestamp": "2017-07-29T22:09:23.971Z",
"lang": "en",
"result": {},
"status": {
"code": 200,
"errorType": "success"
},
"sessionId": "1501366152335"
}
}
},
"sharedDebugInfo": [
{
"name": "ResponseValidation",
"subDebugEntry": [
{
"name": "UnparseableJsonResponse",
"debugInfo": "API Version 2: Failed to parse JSON response string with 'INVALID_ARGUMENT' error: \": Cannot find field.\"."
}
]
}
]
},
"visualResponse": {}
}
我尝试按照https://api.ai/docs/reference/agent/query#response文档发送以下 json 响应。
- - - - - - 回复 - - - - - - -
{
"result": {
"source": "agent",
"resolvedQuery": "city",
"action": "tell.facts",
"actionIncomplete": false,
"parameters": {
"facts-category": "city"
},
"contexts": [],
"metadata": {
"intentId": "873b1895-cdfc-42a4-b61b-5a1703c72a4d",
"webhookUsed": "true",
"webhookForSlotFillingUsed": "false",
"webhookResponseTime": 417,
"intentName": "tell-facts"
},
"fulfillment": {
"speech": "Amsterdam",
"messages": [
{
"type": 0,
"speech": "Amsterdam"
}
]
},
"score": 1
}
}
我错过了什么?