我有一个天蓝色的功能应用程序,我用作我的谷歌助理行动的webhook。我试图按照正确的响应文档,但在测试我的webhook时,我不断在模拟器中出现以下错误。我的回复消息中是否有任何错误?实现对话Webhook作为Azure功能应用程序
无法从HTTP_RESPONSE解析SDKResponse:
HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Content-Length: 451
Content-Type: application/json; charset=utf-8
Content-Encoding: gzip
Expires: -1
Vary: Accept-Encoding
Server: Microsoft-IIS/8.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Sun, 28 May 2017 19:00:13 GMT
{"conversationToken":"cee44ab4-97dd-4e18-99c7-2b8613eb7584","expectUserResponse":true,"expectedInputs":[{"inputPrompt":{"richInitialPrompt":{"items":[{"simpleResponse":{"textToSpeech":"So, you want to become a great swordsman? First, you must learn the proper technique of insult sword fighting. The current difficulty level is Easy. Say 'Tutorial' for some quick instructions. Say 'Start Game' to start the game. Say 'Options' for more options. "}}]}}}]}
这里是格式化的可读性JSON:
{
"conversationToken": "cee44ab4-97dd-4e18-99c7-2b8613eb7584",
"expectUserResponse": true,
"expectedInputs": [
{
"inputPrompt": {
"richInitialPrompt": {
"items": [
{
"simpleResponse": {
"textToSpeech": "So, you want to become a great swordsman? ... "
}
}
]
}
}
}
]
}
用我的最新测试中,我尝试发送履行页面上给出确切的例子响应指令仍然失败:https://developers.google.com/actions/components/fulfillment
{
"conversationToken": "{\"state\":null,\"data\":{}}",
"expectUserResponse": true,
"expectedInputs": [
{
"inputPrompt": {
"richInitialPrompt": {
"items": [
{
"simpleResponse": {
"textToSpeech": "Howdy! I can tell you fun facts about almost any number, like 42. What do you have in mind?",
"displayText": "Howdy! I can tell you fun facts about almost any number. What do you have in mind?"
}
}
],
"suggestions": []
}
},
"possibleIntents": [ { "intent": "actions.intent.TEXT" } ]
}
]
}
需要明确的是 - 您使用API.AI网络挂接,或者一个动作包?无论在哪种情况下,这个JSON正文都是你正在返回的内容吗? – Prisoner
不使用API.AI,只是简单的操作包。我没有交换响应文本,所以Content-Length不正确,但json结构正是我返回的(格式化/缩进以提高可读性) –
我试过忽略conversationToken,我尝试添加空建议阵列向richInitialPrompt致敬,均无济于事。 –