gpt4 book ai didi

bots - 在一定时间后取消提示或对话框 - Bot Framework

转载 作者:行者123 更新时间:2023-12-03 17:38:41 32 4
gpt4 key购买 nike

如果在一段时间内没有用户输入,我有一个关于取消提示或对话框的问题。
我需要一种方法来以某种方式在提示中超时。

Example:
Bot prompts the user: "How old are you?".
The Bot now awaits a response from the user, but the user never response and the bot is still waiting.



在我的情况下,机器人应该只等待 20 秒,然后关闭对话框。
cancellation tokenHandleSystemMessageAsync Method 中的超时实现对这个目的有什么帮助,我将如何实现提示?
谢谢你的任何想法!

最佳答案

您可以在 context.UserData 中保存时间戳,然后在收到新消息时检查时间差是否大于 20 秒并适本地路由对话。

关于bots - 在一定时间后取消提示或对话框 - Bot Framework,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41825964/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com