Microsoft Bot框架中的多个瀑布对话 [英] Multiple waterfall conversation in Microsoft Bot framework

查看:109
本文介绍了Microsoft Bot框架中的多个瀑布对话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Microsoft Bot框架中可能有多个瀑布对话吗?

Is it possible to have multiple waterfall conversation in Microsoft Bot framework?

我有一个 Rootdialog (源自ComponentDialog(WaterfallDialog)),它可以接受用户的初始输入.我想使用此对话框来启动到外部服务的登录过程.成功登录后,我想根据用户的初始输入启动特定的瀑布对话.

I am having a Rootdialog (derived from ComponentDialog (WaterfallDialog)), which accepts users's initial input. I want to use this dialogue to initiate a login process to an external service. Once this login is successful, I would like to initiate a specific waterfall dialogue based on users initial input.

例如,用户说

Flow1 ->启动Root对话(用于登录过程)->启动"Flow1(瀑布)"对话框

Flow1 --> Start Root dialogue (For login process) --> Start Flow1 (Waterfall) dialog

Flow2 ->启动Root对话(用于登录过程)->启动"Flow2(瀑布)"对话框

Flow2 --> Start Root dialogue (For login process) --> Start Flow2 (Waterfall) dialog

我尝试执行此操作,但是当我从根"对话框调用 BeginDialogAsync 时,它挂起了

I tried doing this but the moment I call BeginDialogAsync from Root dialogue, it hangs

return await stepContext.BeginDialogAsync("flow1", null, cancellationToken);

请让我知道我在这里想念的东西,在此先感谢

Please let me know what am I missing here, Thanks in Advance

推荐答案

是的,很可能在bot框架中进行多个瀑布对话. 瀑布对话框,其中瀑布接受将按顺序执行的功能栈.对话的每个步骤都实现为异步函数,该异步函数采用瀑布式步骤上下文(step)参数.每个瀑布步骤都可以询问用户一个问题,并且用户的响应将传递到瀑布中的下一个步骤.您还具有组件对话框,可让您重复使用对话框集.

Yes, it is very much possible to have multiple waterfall conversations in bot framework. There is a concept of waterfall dialogs in bot framework v4, where a waterfall accepts a stack of functions that will be executed in sequence. Each step of the conversation is implemented as an asynchronous function that takes a waterfall step context (step) parameter. Each waterfall step can ask a question of the user and the user's response will be passed to the next step in the waterfall. You also have component dialogs which allows you to reuse dialog sets.

请参阅多-转向提示示例,该示例使用瀑布对话框,一些提示和组件对话框来创建简单的交互,该交互询问用户一系列问题以及

Refer to the multi-turn prompt sample, which uses a waterfall dialog, a few prompts, and a component dialog to create a simple interaction that asks the user a series of questions and the bot-authentication sample.

希望这会有所帮助!

这篇关于Microsoft Bot框架中的多个瀑布对话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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