gpt4 book ai didi

javascript - 如何访问 Microsoft Bot Framework 上的用户数据?

转载 作者:行者123 更新时间:2023-12-01 03:35:23 25 4
gpt4 key购买 nike

如果我是正确的,userDataprivateConversationData 等存储在某个远程数据库中。我如何访问该数据库(例如在测试过程中清除它)?

最佳答案

对于基本实现,“所有用户状态数据库”不可访问,您只能按用户执行操作(例如/deleteprofile)。

documentation添加了名为如何对通过 State API 存储的机器人数据进行版本控制的章节?:

The State Service allows you to persist progress through the dialogsin a conversation, so that a user can return to a conversation with abot days later without losing their position. But if you change yourbot's code, the bot data property bags stored through the State APIare not automatically cleared. You will have to decide whether the botdata should be cleared based on whether your newer code is compatiblewith older versions of your data. You can accomplish this in a fewways:

  • During development of your bot, if you want to manually reset the conversation's dialog stack and state, you can use the /deleteprofilecommand (with the leading space so it's not interpreted by thechannel) to clear out the state.
  • During production usage of your bot, you can version your bot data so that if you bump the version, the associated data is cleared. Thiscan be accomplished in Node using the exiting middleware or in C#using an IPostToBot implementation.

If the dialog stack cannot be deserialized correctly (due toserialization format changes or because the code has changed toomuch), the conversation state will be reset.

另请参阅 topic在 BotBuilder Github 上了解有关存储的信息。还有这个question也为了国家安全

解决方法

借助 Microsoft 提供的 BotBuilder-Azure 扩展,您可以为机器人使用自己的 Azure 存储。

可在 github 上获取 here它:

enable bot developers to integrate bots with specific Azurecomponents.

  • Azure Table Storage: Allows bot developers to store bot state in their own Azure Storage accounts.

  • DocumentDB: Allows bot developers to store bot state in DocumentDB

因此,一旦设置完毕,您就可以使用 JavaScript 获取数据,因为它是您自己的 Azure 存储。

关于javascript - 如何访问 Microsoft Bot Framework 上的用户数据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44308870/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com