Bot Framework V4 Nodejs聊天历史记录 [英] Bot framework V4 Nodejs chat history logging

查看:78
本文介绍了Bot Framework V4 Nodejs聊天历史记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了审核/历史记录,我必须在CosmosDB中记录用户与机器人的对话.在使用.Net的V3中,我正在使用表记录器模块,如下面的代码.

I have to log the user-bot conversation in CosmosDB for audit/history purpose. In V3 using .Net, I was using table logger module, like the below code.

builder.RegisterModule(new TableLoggerModule(account,chatHistoryTableName));

现在,我们正在将Bot升级/重写为NodeJS中的V4.请指导NodeJS中是否有适用于V4的类似方法来保存整个对话?

Now we are upgrading/rewriting the bot to V4 in NodeJS. Please guide if there is a similar approach available for V4 in NodeJS to save the entire conversation?

推荐答案

此示例尚未合并: https://github.com/Microsoft/BotBuilder-Samples/pull/1266

它使用AzureBlobTranscriptStore和TranscriptLoggerMiddleware

It uses AzureBlobTranscriptStore and TranscriptLoggerMiddleware

const { AzureBlobTranscriptStore  } = require('botbuilder-azure');
const { TranscriptLoggerMiddleware } = require('botbuilder-core');

// Get blob service configuration as defined in .bot file
const blobStorageConfig = botConfig.findServiceByNameOrId(BLOB_CONFIGURATION);
// The transcript store has methods for saving and retrieving bot conversation transcripts.
let transcriptStore = new AzureBlobTranscriptStore({storageAccountOrConnectionString: blobStorageConfig.connectionString,
                                                    containerName: blobStorageConfig.container
                                                    });
// Create the middleware layer responsible for logging incoming and outgoing activities
// into the transcript store.
var transcriptMiddleware = new TranscriptLoggerMiddleware(transcriptStore);
adapter.use(transcriptMiddleware);

这篇关于Bot Framework V4 Nodejs聊天历史记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆