[英]How to disable the chat after certain conversation in Bot Framework v4
[英]How to capture all the conversation happend in the Chat - using Bot framework
我正在尝试Bot框架示例(Sandwich示例),我想检查是否有一种方法可以在聊天结束时捕获完整的对话。
例:
我试图捕获“ OnCompletionAsyncDelegate
”事件双方的完整对话。 是否有捕获所有对话的替代方法?
谢谢。
如果使用LUIS,一种解决方案是创建自己的Dialog类,以扩展LuisDialog,重写MessageReceived来转录传入消息的Text,并让其他Dialog代替LuisDialog扩展此新类。
如果您不使用LUIS,那么您的新类就可以在您自己的IDialog的MessageReceived实现中实现此逻辑。
转录逻辑将需要将此文本记录在某个地方,也许是表存储或dynamo db。
有帮助吗?
我有一个教程展示了如何捕获与数据库的对话: 使用Microsoft Bot Framework实现SQL Server数据库
捕获对话的关键代码段是:
// *************************
// Log to Database
// *************************
// Instantiate the BotData dbContext
Models.BotDataEntities DB = new Models.BotDataEntities();
// Create a new UserLog object
Models.UserLog NewUserLog = new Models.UserLog();
// Set the properties on the UserLog object
NewUserLog.Channel = activity.ChannelId;
NewUserLog.UserID = activity.From.Id;
NewUserLog.UserName = activity.From.Name;
NewUserLog.created = DateTime.UtcNow;
NewUserLog.Message = activity.Text.Truncate(500);
// Add the UserLog object to UserLogs
DB.UserLogs.Add(NewUserLog);
// Save the changes to the database
DB.SaveChanges();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.