I'd like to use a chain interface as my root dialog to switch the conversation by the user message, for example I can call a HelpDialog if the user write 'help' and let the other inputs managed by the LuisDialog.
My problem is that the LuisDialog wait for a message from the user so, in a chain enviroment, the user must write twice the input before the Luis return one of his intent.
This is my example code:
public static readonly IDialog<string> dialog = Chain
.PostToChain()
.Switch(
new Case<IMessageActivity, IDialog<string>>(msg =>
{
var regex = new Regex("^help$", RegexOptions.IgnoreCase);
return regex.IsMatch(msg.Text);
},
(ctx, msg) =>
{
return new HelpDialog();
}),
new DefaultCase<IMessageActivity, IDialog<string>>(
(ctx, msg) => {
return new MyLuisDialog();
})
)
.Unwrap().PostToUser();
Is it possible to use LuisDialog with Chain or how can I use multiple Dialogs together?
Thanks Marco