Actions on Google responds with “Sorry, I didn't get any response.”

吃可爱长大的小学妹 提交于 2019-12-04 13:27:31

That error on appears if your web hook doesn't provide a response to the assistant. The cloud function has been triggered or has timed out and not returned the JSON back to assistant to parse. Check to see what the output of the cloud function is and check it against the API.AI web hook format here https://developers.google.com/actions/reference/v1/apiai-webhook

It should look something like this:

{
  "speech": "...",  // ASCII characters only
  "displayText": "...",
  "data": {
  "google": {
      "expect_user_response": true,
      "is_ssml": true,
      "permissions_request": {
         "opt_context": "...",
         "permissions": [
            "NAME",
            "DEVICE_COARSE_LOCATION",
            "DEVICE_PRECISE_LOCATION"
          ]
      }
    }
    },
   "contextOut": [...],
}

I think this is something on the Google's end. My application have been running on production for more than a week. Based on the logs everything was fine till 6 hours ago but since that the users don't get any answer back. If I request on the API.AI the response is okay so it's not the firebase/fullfillment causing the issue.

Checked other applications some had the same problem some had no problem at all. Not sure what we can do here.

Errors like this are usually caused by a syntax error or other problem in your Firebase Function after you've updated it. There are a few good approaches to diagnosing problems like this:

  1. Check the Firebase function log. If there is an error, it will almost certainly show up here.

    From the command line you can use firebase functions:log to see the most recent logging messages. You can also use the console to view the logs by going to console.firebase.com, selecting the project, selecting Functions, and then the Logs tab.

  2. If there isn't an error, it becomes more of a logic problem. Adding your own logs via console.log(), console.info(), or console.error()

  3. Many times the logs will indicate the function is timing out after 60 seconds when you think you're returning things by then. Make sure you are completing any callbacks and calling assistant.ask() or assistant.tell() (or one of their cousins) to make sure they're being called.

After posting a question on the Google+ actions group. I got a response back from Google.

Actions Bug There is currently a bug in the Actions Platform that might result in unexpected error messages when running your apps.

We are currently testing a fix and hope to have that rolled out soon.

As of 10 minutes ago it is working again. The code was correct all along.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!