0

我实现了一个 webhook 以符合 Google Conversation Protocol上的操作。但是,当我通过Web Simulator模拟交互时,出现以下错误:

{
    "response": “action name isn’t responding right now. Try again soon.\n",
    "audioResponse": "...",
    "debugInfo": {
        "sharedDebugInfo": [
            {
                "name": "ExecutionResponse",
                "debugInfo": "Failed to parse SDKResponse from http_response: 'HTTP/1.1 200 OK\r\nContent-Type: application/json\r\nTransfer-Encoding: chunked\r\nConnection: keep-alive\r\nDate: Sun, 11 Dec 2016 22:54:50 GMT\r\nServer: Server-Software/1.0\r\nGoogle-Assistant-API-Version: v1\r\nVary: Accept-Encoding\r\nContent-Encoding: gzip\r\nX-Cache: Miss from CDN\r\nVia: 1.1 cdn.example.net (CDN)\r\n\r\n{\"conversation_token\":null,\"expect_user_response\":false,\"expected_inputs\":[],\"final_response\":{\"speech_response\":{\"ssml\":null,\"text_to_speech\":\"Hello!\"}}}'"
            }
        ]
    }
}

字段内的块debugInfo是:

Failed to parse SDKResponse from http_response: 'HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive
Date: Sun, 11 Dec 2016 22:54:50 GMT
Server: Server-Software/1.0
Google-Assistant-API-Version: v1
Vary: Accept-Encoding
Content-Encoding: gzip
X-Cache: Miss from CDN
Via: 1.1 cdn.example.net (CDN)

{\"conversation_token\":null,\"expect_user_response\":false,\"expected_inputs\":[],\"final_response\":{\"speech_response\":{\"ssml\":null,\"text_to_speech\":\"Hello!\"}}}'
4

1 回答 1

0

Fields that have null values or empty arrays should be excluded. For example, since expect_user_response is false, the expected_inputs field should not be present in the output. Use the following instead:

{
  "expect_user_response": false,
  "final_response": {
    "speech_response": {
      "text_to_speech": "Hello!"
    }
  }
}
于 2016-12-12T01:33:19.793 回答