我试图连接 DialogFlow 和 Actions on Google ,所以我创建了一些意图,连接了服务,添加了显式和隐式调用等,但是当我在模拟器中尝试机器人https://console.actions.google.com/project/[projectId]/simulator/它总是给我错误:
“无法将Dialogflow响应解析为AppResponse,异常抛出消息:空语音响应”
即使是艰难的inputType也是“KEYBOARD” .
到目前为止我尝试了什么:
-
我确实在Dialog Flow中设置了"Response from this tab will be sent to the Google Assistant integration"(您是否必须为每一个意图设置它?),但我没有看到任何额外的语音设置 .
-
我禁用了第二语言,首先我也用德语打算
-
我还关闭了Fullfillment Webhook(在API v1中实现,然后也在v2中实现),没有任何变化
-
我只发现这个用户有同样的问题https://productforums.google.com/forum/#!topic/dialogflow/xYjKlz31yW0;context-place=topicsearchin/dialogflow/Empty $ 20speech $ 20response但没有解析 .
-
在意图中检查履行复选框
-
当我在Dialog Flow右侧的"Try it now"或Web Demo中使用它时,机器人工作正常https://bot.dialogflow.com/994dda8b-4849-4a8a-ab24-c0cd03b5f420
不幸的是,文档没有说明这个错误 . 有任何想法吗?
这里是Actions集成错误的屏幕截图:
这是完整的调试输出:
{
"agentToAssistantDebug": {
"agentToAssistantJson": {
"message": "Failed to parse Dialogflow response into AppResponse, exception thrown with message: Empty speech response",
"apiResponse": {
"id": "c12e1389-e887-49d4-b399-a332188ca946",
"timestamp": "2018-01-27T03:55:30.931Z",
"lang": "en-us",
"result": {},
"status": {
"code": 200,
"errorType": "success"
},
"sessionId": "1517025330705"
}
}
},
"assistantToAgentDebug": {
"assistantToAgentJson": {
"user": {
"userId": "USER_ID",
"locale": "en-US",
"lastSeen": "2018-01-27T03:55:03Z"
},
"conversation": {
"conversationId": "1517025330705",
"type": "NEW"
},
"inputs": [
{
"intent": "actions.intent.MAIN",
"rawInputs": [
{
"inputType": "KEYBOARD",
"query": "Talk to Mica, the Hipster Cat Bot"
}
]
}
],
"surface": {
"capabilities": [
{
"name": "actions.capability.MEDIA_RESPONSE_AUDIO"
},
{
"name": "actions.capability.WEB_BROWSER"
},
{
"name": "actions.capability.AUDIO_OUTPUT"
},
{
"name": "actions.capability.SCREEN_OUTPUT"
}
]
},
"isInSandbox": true,
"availableSurfaces": [
{
"capabilities": [
{
"name": "actions.capability.AUDIO_OUTPUT"
},
{
"name": "actions.capability.SCREEN_OUTPUT"
}
]
}
]
},
"curlCommand": "curl -v 'https://api.api.ai/api/integrations/google?token=TOKEN' -H 'Content-Type: application/json;charset=UTF-8' -H 'Google-Actions-API-Version: 2' -H 'Authorization: AUTH_TOKEN' -A 'Mozilla/5.0 (compatible; Google-Cloud-Functions/2.1; +http://www.google.com/bot.html)' -X POST -d '{\"user\":{\"userId\":\"USER_ID\",\"locale\":\"en-US\",\"lastSeen\":\"2018-01-27T03:55:03Z\"},\"conversation\":{\"conversationId\":\"1517025330705\",\"type\":\"NEW\"},\"inputs\":[{\"intent\":\"actions.intent.MAIN\",\"rawInputs\":[{\"inputType\":\"KEYBOARD\",\"query\":\"Talk to Mica, the Hipster Cat Bot\"}]}],\"surface\":{\"capabilities\":[{\"name\":\"actions.capability.MEDIA_RESPONSE_AUDIO\"},{\"name\":\"actions.capability.WEB_BROWSER\"},{\"name\":\"actions.capability.AUDIO_OUTPUT\"},{\"name\":\"actions.capability.SCREEN_OUTPUT\"}]},\"isInSandbox\":true,\"availableSurfaces\":[{\"capabilities\":[{\"name\":\"actions.capability.AUDIO_OUTPUT\"},{\"name\":\"actions.capability.SCREEN_OUTPUT\"}]}]}'"
},
"sharedDebugInfo": [
{
"name": "ResponseValidation",
"subDebugEntry": [
{
"debugInfo": "API Version 2: Failed to parse JSON response string with 'INVALID_ARGUMENT' error: \": Cannot find field.\".",
"name": "UnparseableJsonResponse"
}
]
}
]
}
“debugInfo”听起来像是一个内部问题:
“API Version 2:无法使用'INVALID_ARGUMENT'错误解析JSON响应字符串:\”:找不到字段 . \“ . ”
这是欢迎意图的屏幕截图:
PS . 我花了很多时间才弄清楚是什么
“自定义意图缺少查询模式”
意味着 - 所以我只是在这里记录它:在Dialog Flow中 - 意图 - “用户说”当你想将它设置为查询参数时,你必须在文本输入字段中单击一个单词 - 这似乎是Actions on谷歌 .
2 回答
这发生在我身上 . 如果您刚刚在Dialogflow控制台中添加了Intent,并且您正在使用Webhook实现操作,请检查intent的实现设置并确保Webhook实现滑块已打开 . 显然,新的意图不会自动获得webhook履行:你必须零碎地选择每一个(或者至少,这是我的经验) .
Google支持上的操作帮助我解决了这个问题:
我需要将文本作为默认响应添加到用于显式调用的意图 .