Microsoft Bot Builder(聊天机器人)错误 [英] Microsoft Bot Builder (chat bot) error

查看:129
本文介绍了Microsoft Bot Builder(聊天机器人)错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

不建议使用Bot State API.请参阅

The Bot State API is deprecated. Please refer to

推荐答案

在以前的botbuilder版本中,Microsoft为bot提供了状态api.状态api可以像您期望的那样管理机器人的状态.诸如用户数据,对话数据,对话数据之类的东西.

In the previous versions of botbuilder microsoft provided a state api for bots. The state api managed the state of the bot as you might expect; things like the user data, the conversation data, the dialog data etc.

此后,他们已弃用此API,并提供了一种方法,您可以实现自己的存储适配器,或者实际上是我们可用的软件包来实现.

They have since deprecated this API and provided a way which you can implement your own storage adapters, or indeed us available packages to do so.

botbuilder模块提供了一个内存存储空间,显然可以在运行bot时很好,但是如果bot崩溃则将丢失,如果打算在多台计算机之间平衡bot,则不适合.

The botbuilder module provides an in memory storage which obviously is fine while the bot is running but will be lost if the bot crashes and isn't suitable if you intend to load balance the bot across multiple machines.

我倾向于将内存存储用于本地开发,并在生产中使用其他适配器将其切换出去.

I tend to use the in memory storage for local development and in production switch it out with a different adapter.

const bot = new builder.UniversalBot(connector, [..waterfall steps..])
   .set('storage', new builder.MemoryBotStorage())

但是,还有其他可用的存储适配器

However, there are other storage adapters available

Microsoft软件包 botbuilder-azure 提供表存储,CosmosDB存储和SQL存储

The Microsoft package botbuilder-azure offers table storage, CosmosDB storage and SQL storage.

我倾向于将以下软件包 botbuilder-storage 与DynamoDB适配器一起使用.它还提供Redis和MongoDB适配器.

I tend to use the following package botbuilder-storage with the DynamoDB adapter. It also offers Redis and MongoDB adapters.

状态管理在这里也记录得很好

State management is also documented pretty well here

https://docs.microsoft .com/zh-CN/bot-framework/nodejs/bot-builder-nodejs-state

这篇关于Microsoft Bot Builder(聊天机器人)错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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