我们已经用LUIS创建了一个Bot,它可以很好地用于本地和prod模拟器。但是,当我们使用DirectLine从Xamarin.forms移动应用程序与Bot连接时。使用这行代码(BotConversation = await Client.Conversations.StartConversationAsync().ConfigureAwait(false);)创建会话需要大约4到5秒。
当我们试图通过创建Message类型活动发送消息时,大约需要2-3秒。
Activity userMessage = new Activity()
{
From = new ChannelAccount(userId, userName),
Text = message,
Type = ActivityTypes.Message,
Properties = new JObject(new JProperty("TenantCode", tenantCode),
new JProperty("SiteCode", "1"))
};
await Client.Conversations.PostActivityAsync(BotConversation.ConversationId, userMessage).ConfigureAwait(false);有人能帮助或解释这里发生了什么吗?
发布于 2018-12-19 20:23:11
响应延迟较高的一些原因是: 1)Internet连接,2)您选择在Azure中托管您的bot的区域
我不认为您的代码会导致延迟。我认为最好的解决方案是改变您在Azure部署机器人的区域。
https://stackoverflow.com/questions/53855384
复制相似问题