免责声明:我不是 GDPR 专家,但我认为以下内容就足够了。
从机器人的角度来看,存储在 Teams 频道中的数据是相同的。您拥有通常(在大多数示例中)使用 Blob 存储设置的对话状态和用户状态数据。我对这些项目使用 conversationState 和 userState 命名法。
在我的用例中,我将帐号存储在 userState 中,将用户名/电子邮件存储在 conversationState 中。请注意,机器人存储的其他内容(尤其是在conversationState 我相信)围绕对话状态和其他机器人特定的内容通常相当无意义,但我不知道它们是否会被视为 GDPR 的一部分。无论如何,我们都会清除这些全部对象。
为此,我创建了一个对话框来管理用户配置文件,该配置文件显示存储的关键信息(我专门访问帐号、用户名和电子邮件),然后提示用户是否要删除信息.在 nodejs 中是这样的。
const { ConfirmPrompt, ComponentDialog, WaterfallDialog } = require('botbuilder-dialogs');
const { ActivityTypes } = require('botbuilder');
const WATERFALL_DIALOG = 'waterfallDialog';
const CONFIRM_PROMPT = 'confirmPrompt';
class manageProfileDialog extends ComponentDialog {
constructor(dialogId, userDialogStateAccessor, userState, appInsightsClient, dialogState, conversationState) {
super(dialogId);
this.dialogs.add(new ConfirmPrompt(CONFIRM_PROMPT));
this.dialogs.add(new WaterfallDialog(WATERFALL_DIALOG, [
this.showInfoAndPrompt.bind(this),
this.confirmDelete.bind(this)
]));
this.initialDialogId = WATERFALL_DIALOG;
// State accessors
this.userDialogStateAccessor = userDialogStateAccessor;
this.userState = userState;
this.dialogState = dialogState;
this.conversationState = conversationState;
this.appInsightsClient = appInsightsClient;
} // End constructor
async showInfoAndPrompt(step) {
this.appInsightsClient.trackEvent({name:'manageProfileDialog', properties:{instanceId:step._info.values.instanceId, channel: step.context.activity.channelId}});
this.appInsightsClient.trackMetric({name: 'showInfoAndPrompt', value: 1});
const userProfile = await this.userDialogStateAccessor.get(step.context, {});
const conversationData = await this.dialogState.get(step.context, {});
if (!userProfile.accountNumber & !conversationData.userEmail & !conversationData.userFullName & !conversationData.orderType) {
this.appInsightsClient.trackEvent({name:'manageProfileDialogEnd', properties:{instanceId:step._info.values.instanceId, channel: step.context.activity.channelId}});
this.appInsightsClient.trackMetric({name: 'confirmDelete', value: 1});
await step.context.sendActivity(`I don't have any of your information stored.`);
return await step.endDialog();
} else {
var storedData = '';
if (userProfile.accountNumber) {
storedData += ` \n**Account Number:** ${userProfile.accountNumber}`;
}
if (conversationData.userFullName) {
storedData += ` \n**Name:** ${conversationData.userFullName}`;
}
if (conversationData.userEmail) {
storedData += ` \n**Email:** ${conversationData.userEmail}`;
}
if (conversationData.orderType) {
storedData += ` \n**Default order type:** ${conversationData.orderType}`;
}
await step.context.sendActivity(`Here is the informaiton I have stored: \n ${storedData} \n\n I will forget everything except your account number after the end of this conversation.`);
await step.context.sendActivity({ type: ActivityTypes.Typing });
await new Promise(resolve => setTimeout(resolve, process.env.DIALOG_DELAY));
return await step.prompt(CONFIRM_PROMPT, `I can clear your information if you don't want me to store it or if you want to reneter it. Would you like me to clear your information now?`,['Yes','No']);
}
}
async confirmDelete(step) {
this.appInsightsClient.trackEvent({name:'manageProfileDialogEnd', properties:{instanceId:step._info.values.instanceId, channel: step.context.activity.channelId}});
if (step.result) {
const userProfile = await this.userDialogStateAccessor.delete(step.context, {});
const conversationData = await this.dialogState.delete(step.context, {});
await step.context.sendActivity(`OK, I have cleared your information.`);
return await step.endDialog();
} else {
await step.context.sendActivity(`OK, I won't clear your information. You can ask again at any time.`);
this.appInsightsClient.trackMetric({name: 'confirmDelete', value: 1});
return await step.endDialog();
}
}
}
module.exports.ManageProfileDialog = manageProfileDialog;
关于 GDPR,我不确定的一件事是,您是否在运行机器人的过程中将成绩单或活动数据存储在其他地方。例如,我将对话记录存储在 CosmosDB 中,其中可能包括姓名和电子邮件地址等内容(如果在对话过程中提供的话)。即使我想,我也没有清除这些信息的好方法。此外,我将 LUIS 跟踪和其他信息存储在 Application Insights 中,在许多情况下,这些信息包括可能附加了用户名或 ID 等内容的活动。我什至不确定是否可以从 Application Insights 中删除这些跟踪。我不知道这些是否属于 GDPR 的范围,因为它们是可操作的,但如果这是一个潜在的问题,请注意您在日志记录和/或脚本应用程序中存储的内容。