private async Task <DialogTurnResult> ActStepAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken) { var luisResult = await _luisRecognizer.RecognizeAsync <WhoIsWhoLuisGenModel>(stepContext.Context, cancellationToken); switch (luisResult.TopIntent().intent) { case WhoIsWhoLuisGenModel.Intent.application: return(await stepContext.BeginDialogAsync(nameof(ApplicationDialog), null, cancellationToken)); case WhoIsWhoLuisGenModel.Intent.team_member: return(await stepContext.BeginDialogAsync(nameof(TeamMemberDialog), null, cancellationToken)); case WhoIsWhoLuisGenModel.Intent.BankHoliday: return(await stepContext.BeginDialogAsync(nameof(BankHolidayDialog), null, cancellationToken)); case WhoIsWhoLuisGenModel.Intent.None: default: var didntUnderstandMessageText = $"Sorry, I didn't get that. Please try asking in a different way (intent was {luisResult.TopIntent().intent})"; var didntUnderstandMessage = MessageFactory.Text(didntUnderstandMessageText, didntUnderstandMessageText, InputHints.IgnoringInput); await stepContext.Context.SendActivityAsync(didntUnderstandMessage, cancellationToken); break; } return(await stepContext.NextAsync(null, cancellationToken)); }
private async Task <DialogTurnResult> ActStepAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken) { var luisResult = await _luisRecognizer.RecognizeAsync <WhoIsWhoLuisGenModel>(stepContext.Context, cancellationToken); switch (luisResult.TopIntent().intent) { case WhoIsWhoLuisGenModel.Intent.Central: var centralMessageText = $"That person works in the Central Team"; var centralMessage = MessageFactory.Text(centralMessageText, centralMessageText, InputHints.IgnoringInput); await stepContext.Context.SendActivityAsync(centralMessage, cancellationToken); break; case WhoIsWhoLuisGenModel.Intent.Commercial: var commercialMessageText = $"That person works in the Commercial Team"; var commercialMessage = MessageFactory.Text(commercialMessageText, commercialMessageText, InputHints.IgnoringInput); await stepContext.Context.SendActivityAsync(commercialMessage, cancellationToken); break; case WhoIsWhoLuisGenModel.Intent.Preconstruction_Operations: var preConMessageText = $"That person works in the Pre-Con & Ops team"; var preConMessage = MessageFactory.Text(preConMessageText, preConMessageText, InputHints.IgnoringInput); await stepContext.Context.SendActivityAsync(preConMessage, cancellationToken); break; case WhoIsWhoLuisGenModel.Intent.None: default: var didntUnderstandMessageText = $"Sorry, I didn't get that. Please try asking in a different way (intent was {luisResult.TopIntent().intent})"; var didntUnderstandMessage = MessageFactory.Text(didntUnderstandMessageText, didntUnderstandMessageText, InputHints.IgnoringInput); await stepContext.Context.SendActivityAsync(didntUnderstandMessage, cancellationToken); break; } return(await stepContext.NextAsync(null, cancellationToken)); }