0

Im following the Number Genie article here: https://developers.google.com/actions/develop/apiai/tutorials/number-genie

Ive taken the files and put them in a github repository here: http://github.com/quique123/mygennie

I got this in the Heroku log:

body: {"originalRequest":{"source":"google","data":{"surface":{"capabilities":[{"name":"actions.capability.AUDIO_OUTPUT"}]},"inputs":[{"arguments":[{"raw_text":"36","text_value":"36","name":"text"}],"intent":"assistant.intent.action.TEXT","raw_inputs":[{"query":"36","input_type":2,"annotation_sets":[]}]}],"user":{"user_id":"sometring/mIqGRE=","permissions":[]},"device":{"locale":"en-US"},"is_in_sandbox":true,"conversation":{"conversation_token":"[]","conversation_id":"1493419815932","type":2}}},"id":"e5ca3d68-3efa-4285-923f-3e1ff7fz87cf","timestamp":"2017-04-28T22:33:51.422Z","lang":"en","result":{"source":"agent","resolvedQuery":"36","speech":"","action":"check_guess","actionIncomplete":false,"parameters":{"check_guess":"36"},"contexts":[{"name":"actions_capability_audio_output","parameters":{"check_guess.original":"36","check_guess":"36"},"lifespan":0}],"metadata":{"intentId":"c863e1e2-c950-45d8-9b96-b57e0b1de77e","webhookUsed":"true","webhookForSlotFillingUsed":"false","intentName":"provide_guess"},"fulfillment":{"speech":"","messages":[{"type":0,"speech":""}]},"score":1},"status":{"code":200,"errorType":"success"},"sessionId":"1493418215932"}

But the web simulator returned a sorry, that is not available right now when I tried to guess a number. Why does the json payload hace a code 200:success then?

Prisoner
  • 49,922
  • 7
  • 53
  • 105
marciokoko
  • 4,988
  • 8
  • 51
  • 91

1 Answers1

0

How quickly are you getting the message that it isn't available? The Google Assistant on your home will timeout requests after about 5 seconds. If your server doesn't reply within that time, Home assumes there is a problem with the connection and terminates the session. It is possible that your application took longer than that to run, so it generates the message about being unable to handle it at the moment and, some time later, your function finally returns results.

Prisoner
  • 49,922
  • 7
  • 53
  • 105
  • About 3 seconds into it. What Im wondering about is the json parsing. This app is on Heroku and I would need to parse out the user response but is this the correct json? I didnt say 36 so that must be the random number the app thought of? – marciokoko Apr 29 '17 at 12:08
  • It sounds like you're asking about something else now, so I'm pretty confused about what your actual question is. Regardless - posting screen shots of your API.AI Intents will help clarify some of your questions as well. From the JSON you posted, however, it is very very unclear, since the check_guess parameter isn't defined in your code anywhere, but it is not the random number generated. – Prisoner Apr 30 '17 at 20:51