英文:
Dialogflow CX webhook timeout response
问题
有没有办法在连接到我的 Webhook 失败时添加一个超时响应,就像在 Botcopy 中它无限期地保持着 3 个点一样,我想知道是否有一种方法可以在超时时添加一个响应,类似于:"连接已断开,请稍后再试"。
谢谢。
英文:
I am integrating dialogflow CX with Botcopy using a webhook, my question is if there is a way to add an timeout response, like when the connection to my webhook is down, in Botcopy it stays with the 3 dots indefinitely, and I wanted to check if there is a way to add a response on timeout something like: "The connection is down, please try again later".
Thanks.
答案1
得分: 1
以下是翻译好的部分:
解决方案是使用内置事件处理程序。查看文档!https://cloud.google.com/dialogflow/cx/docs/concept/handler#event-built-in。
基本上,在你的Webhook连接的地方,你必须添加一个事件处理程序,比如Webhook错误,每当你的Webhook找不到时就会触发,你可以在文档中找到更多相关的Webhook事件,如果你需要特定的事件,比如超时、拒绝、禁止等。

英文:
The solution was using the in-built event handlers. Check the docs! https://cloud.google.com/dialogflow/cx/docs/concept/handler#event-built-in.
Basically where you have your webhook connected, you have to add an event handler like webhook error, that will fire every time your webhook is not found, you can find more related webhook events in the documetation, if you need specific ones like time out, rejected, forbidden, etc.

通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。


评论