3

I've resorted to returning a default response in order to try to get this to work. This is hosted on AWS Lambda with an API Gateway. Last night I had some different code working, but now I can't seem to get anything to work through Google Assistant.

Here's the example V2 response I am using:

  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"
                }
              ]
            }
          }
        }
      }
    }
  });

Here's the log output from Google Assistant to 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\"}"
        }
      ]
    }
  }
}

I'm not sure where to go from here...Everything seems to be working correctly, I just can't figure out where the parser error is with Google Assistant. What gives?

Thanks.

Here's proof that the Lambda works using my request

0x1F602
  • 865
  • 5
  • 22
  • 1
    Unfortunately I'm not familiar with AWS technology. I am assuming that what you are showing in the first section is the JSON response that you think you are returning? Is there a way to trace/log/debug to validate that it is being called? Can you also elaborate on the callpath? Is this a webhooks being invoked by Dialog Flow? If yes, what if we test directly from Dialog Flow with no Actions on Google involved? – Kolban May 11 '19 at 20:00
  • 1
    That's the JSON response I'm returning. I copied it with a cURL command and am running it against the live API endpoint, so it returns properly. I also tested it directly in Dialog Flow, which works. It's when I try to use it in the Google Assistant simulator and on my Google Nest Hub that it fails mysteriously. – 0x1F602 May 11 '19 at 20:08
  • I've had a similar issue, except the other way round - Google Assistant was fine but using Dialogflow directly had the same error. It would appear there has been an update behind the scenes and Google Assistant is using a different version of Dialogflow. My issue was fixed when I explicitly specified the content type "application/json" and UTF8 encoding in my HTTP response, though I'm not sure if you're doing that somewhere already. – mintsponge May 13 '19 at 15:44

0 Answers0