Wait some seconds before agent's reply

余生颓废 提交于 2019-12-02 08:25:07

It's not possible to an Action start a conversation, the fulfillment code (your function) must return within 10 seconds, or the Google Assistant will close the Action with a time-out warning.

And your setTimeout is not working because this code is running in the cloud, and to actually send it back to the Assistant, you must send the response, and you are only adding items to it, but not returning the object.

This page from DialogFlow documentation explains how the back-end fulfillment works on DialogFlow / Google Assistant.

You can use SSML in your response and set when to respond.

e.g.

<speak>
  <seq>
     <media begin="0s">
        <speak>Timer started! 20 seconds from now</speak>
     </media>
     <media begin="10.0s">
        <speak>10 seconds left!</speak>
     </media>
  </seq>
</speak>

Also, check for more information.

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