0

我在这里关注数字精灵文章: https ://developers.google.com/actions/develop/apiai/tutorials/number-genie

我已经把这些文件放在了这里的 github 存储库中:http: //github.com/quique123/mygennie

我在 Heroku 日志中得到了这个:

正文:{"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","结果":{"source":"agent","re​​solvedQuery":"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}] ,"元数据":{"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"}

但是网络模拟器返回了一个抱歉,当我试图猜测一个数字时,它现在不可用。那么为什么 json 有效负载会有一个代码 200:success 呢?

4

1 回答 1

0

您收到不可用消息的速度有多快?您家中的 Google 助理将在大约 5 秒后超时请求。如果您的服务器在这段时间内没有回复,Home 会认为连接存在问题并终止会话。您的应用程序运行时间可能比运行时间长,因此它会生成有关目前无法处理它的消息,并且一段时间后,您的函数最终会返回结果。

于 2017-04-29T02:00:50.870 回答