I'm currently building a chatbot with Azure's Bot service. I use a NLU-Bot, mixed with a waterfall flow, because dependent on the intent I want to get some specific information.
Therefore I match the intent1
and want to
var intents = new builder.IntentDialog({ recognizers: [recognizer] })
.matches('intent1', (session, args, results) =>{
session.beginDialog("getRequiredInformations");
session.send("I received your information");
})
bot.dialog('getRequiredInformations', [
(session) =>{
var levels = ['Beginner', 'Intermediate', 'Expert'];
builder.Prompts.choice(session, "What's your level ?", levels, { listStyle: builder.ListStyle.button, maxRetries: 0 });
},
(session, results) => {
session.conversationData.level = results.response.entity;
}
]);
What I want to do is to wait until we received the answer from the getRequiredInformations
dialog and then continue with the original dialog containing the recognized intent. With the code above the session.send("I received your information");
is sent before the user entered an answer.
I also tried with bot.beginDialogAction('getRequiredInformations', 'getRequiredInformations');
but I think it's not possible to call this inside the dialog.
How am I able to achieve this?