我已尝试返回默认响应,以尝试使其正常工作。它通过API网关托管在AWS Lambda上。昨晚我有一些不同的代码可以工作,但是现在我似乎无法通过Google Assistant获得任何帮助。
这是我使用的示例V2响应:
callback(null, {
"payload": {
"google": {
"expectUserResponse": true,
"richResponse": {
"items": [
{
"simpleResponse": {
"textToSpeech": "Choose a item"
}
}
]
},
"systemIntent": {
"intent": "actions.intent.OPTION",
"data": {
"@type": "type.googleapis.com/google.actions.v2.OptionValueSpec",
"listSelect": {
"title": "Hello",
"items": [
{
"optionInfo": {
"key": "first title key"
},
"description": "first description",
"image": {
"url": "https://developers.google.com/actions/images/badges/XPM_BADGING_GoogleAssistant_VER.png",
"accessibilityText": "first alt"
},
"title": "first title"
},
{
"optionInfo": {
"key": "second"
},
"description": "second description",
"image": {
"url": "https://lh3.googleusercontent.com/Nu3a6F80WfixUqf_ec_vgXy_c0-0r4VLJRXjVFF_X_CIilEu8B9fT35qyTEj_PEsKw",
"accessibilityText": "second alt"
},
"title": "second title"
}
]
}
}
}
}
}
});
以下是从Google助手到DialogFlow的日志输出:
Received response from agent with body: HTTP/1.1 200 OK Server: nginx/1.13.6 Date: Sat, 11 May 2019 18:44:24 GMT Content-Type: application/json;charset=UTF-8 Content-Length: 772 X-Cloud-Trace-Context: e62f0526a5238882dd1c1a3b3a70e3b5/11459115340038791606;o=0 Google-Actions-API-Version: 2 Assistant-Interaction-Error-Code: -1 Assistant-Interaction-Error-Message: Failed to parse Dialogflow response into AppResponse because of empty speech response X-SHARD: default Via: 1.1 google Alt-Svc: clear
{
"responseMetadata": {
"status": {
"code": 10,
"message": "Failed to parse Dialogflow response into AppResponse because of empty speech response",
"details": [
{
"@type": "type.googleapis.com/google.protobuf.Value",
"value": "{\"id\":\"99120b53-f0a7-415f-b44e-73c7525fcd43\",\"timestamp\":\"2019-05-11T18:44:24.422Z\",\"lang\":\"en-us\",\"result\":{},\"alternateResult\":{},\"status\":{\"code\":206,\"errorType\":\"partial_content\",\"errorDetails\":\"Webhook call failed. Error: Failed to parse webhook JSON response: Cannot find field: errorMessage in message google.cloud.dialogflow.v2.WebhookResponse.\"},\"sessionId\":\"ABwppHHok5GTHl8A6XWq9q-Yp1chkoZ4vT688i4HTxVgVQDcY1zHH2JUqVeCMPc_6bbA7WFf1e-nw0ZQxQ\"}"
}
]
}
}
}
我不确定从这里去哪里...一切似乎都正常运行,我只是无法弄清楚Google Assistant的解析器错误在哪里。有什么作用?
谢谢。