botframework - 机器人状态一团糟。对话框未按预期工作。[SDK V3]
问题描述
我正在使用 SDK V3 版本 3.15.3。在我的机器人中,我正在使用 Dialogs 模拟对话流。但不是点击 context.wait() 中提到的回调函数,而是在点击 Message.Controller 之后,控件将转到我的根对话框中的 StartAsync 函数,因此整个对话框流从头开始重新启动,而不是继续context.wait() 的回调中提到的函数。这种行为也是非常随机的,因为在少数情况下(特别是在本地调试时)机器人会按预期运行。
我已经尝试降级到 3.13 版,但即使这样也行不通
这些是我在 Application_Start() 中进行的注册
var store = new InMemoryDataStore();
Conversation.UpdateContainer(
builder =>
{
builder.Register(c => store)
.Keyed<IBotDataStore<BotData>>(AzureModule.Key_DataStore)
.AsSelf()
.SingleInstance();
builder.Register(c => new CachingBotDataStore(store,
CachingBotDataStoreConsistencyPolicy
.ETagBasedConsistency))
.As<IBotDataStore<BotData>>()
.AsSelf()
.InstancePerLifetimeScope();
builder.RegisterType<Dialogs.RootDialog>()
.AsSelf().InstancePerLifetimeScope();
});
GlobalConfiguration.Configure(WebApiConfig.Register);
预期:机器人:您是否要提出票 [状态 0] 用户:是 机器人:对应于票详细信息的状态 [状态 1]
实际结果:当用户键入 Yes 时,在 State 0 之后,StartAsync 被调用,在 Start Async 我是 doint context.wait(State 0) ,所以它再次进入状态 0
解决方案
推荐阅读
- msbuild - 构建解决方案时在命令行上为单个项目传递属性
- sql - Azure 数据工厂 - 数据流联接条件替换
- laravel - Laravel Spatie 站点地图包,也获取 Auth 页面
- expect - 成功匹配并发送后没有期望发送的响应
- azure-ad-b2c - 将 azure-ad-b2c 与 splunk 一起使用
- python - 在python中遵循数字规则的所有可能数字的组合
- linux - Bash 超时命令在脚本中不起作用
- django - 想要在 postgresql 上运行测试:psycopg2.OperationalError
- jupyter-notebook - 根据真/假复选框在 Jupyter 笔记本中绘图
- tomcat - Tomcat启动时获取多个端口