Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Handling multiple dialogs in Microsoft bot framework

Tags:

botframework

I am creating a bot using Microsoft bot framework , the bot will be receiving orders for a restaurant , I want to know how can I handle multiple dialogs , like for example the customer makes the first order , then i want the bot to ask do you want something else? then the customer says yes/no , incase of yes to repeat the same dailog again with keeping the state of the first one , what I am seeing in the documentation now is only one conversation and one dialog.

Thanks a lot

like image 869
Mazen Abu Taweelih Avatar asked May 11 '16 17:05

Mazen Abu Taweelih


People also ask

Which method is used call another dialog in Microsoft bot framework?

Obtain the CultureInfo in DialogContext. Helper function to simplify formatting the options for calling a prompt dialog. This helper will take an options argument and then call BeginDialogAsync(String, Object, CancellationToken).

How many dialogs should you include in the chatbot?

A bot can have from one to several hundred dialogs, and it can get challenging to manage the dialog system and the conversation with users. In the Add a dialog section, we covered how to create a child dialog and wire it up to the dialog system using Begin a new dialog action.

What can render multiple rich cards at once in Microsoft bot framework?

To display multiple rich cards in list format, set the Activity object's attachmentLayout property to "list". To display multiple rich cards in carousel format, set the Activity object's attachmentLayout property to "carousel".

What is stepContext in bot framework?

stepContext. Options is your way of receiving that object over the called Dialog. For example, in the first document, the main Dialog is calling each child Dialogs and sending them the userInfo. Guest object: return await stepContext.


1 Answers

To manage multiple dialogs you need to use the Dialog Chains. You can either manage the stack of dialogs explicitly (using Call/Done) or implicitly using the Chain fluent methods. Here is sample of how to use it.

If the set of things that the user can select are already predefined I would then recommend using FormFlow. The Pizza & Sandwich samples are good examples of how to handle orders with a predefined set of options.

like image 92
Ezequiel Jadib Avatar answered Sep 28 '22 05:09

Ezequiel Jadib