为什么来自 Azure 机器人框架的第一条消息总是很慢

Why very first message from Azure bot framework is always slow

来自 Azure 机器人框架的第一条消息总是很慢。

有什么办法可以优化吗?

是否可以识别机器人的连接性?(针对每个用户) 这样我就可以从 HTML 部分处理它。

The very first message from Azure bot framework is always slow. Is there any way to optimise it?

正如我在评论中提到的,您可以在 Azure 门户中导航到您的机器人服务,然后在应用程序设置边栏选项卡上开启 始终开启

您也可以参考这个bot服务的FAQ:“My bot is slow to respond to the first message it receives. How can I make it faster?”

Is possible to identify the connectivity of the bot?(for each user) So that I can handle it from the HTML part.

如果您使用 botchat.js 在您的网站中嵌入网络聊天,为了传递 user identity,您可以在启动 BotChat 时指定 user: { id: user_id, name: user_name }

此外,如果您使用提供的 <iframe> 代码,您可以通过查询字符串 userid 传递用户身份。

<iframe src='https://webchat.botframework.com/embed/{BotId_HERE}?s={YOUR_SECRET_HERE}&userid={Your_userid_HERE}' width="300px" height="450px"></iframe>