private async Task <DialogTurnResult> ActStepAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken) { LuisResult luisResult = await _luisService.GetLuisResult(stepContext.Context, cancellationToken); if (luisResult.TopIntent == "None" || luisResult.TopIntentScore <= 0.50) { //await _qnaService.SendQnAResultAsync(turnContext, cancellationToken); await stepContext.Context.SendActivityAsync(MessageFactory.Text("Llamando a qnamaker"), cancellationToken); } else if (luisResult.TopIntent == "agendar_reunion") { return(await stepContext.BeginDialogAsync(nameof(MeetingReservationDialog))); } else { await _answersService.SendResponseAsync(luisResult.TopIntent, stepContext.Context, cancellationToken); } return(await stepContext.NextAsync(null, cancellationToken)); }
public async Task SendBotAnswer(Dialog dialog, ITurnContext <IMessageActivity> turnContext, CancellationToken cancellationToken) { LuisResult luisResult = await _luisService.GetLuisResult(turnContext, cancellationToken); var conversationStateAccessors = _conversationState.CreateProperty <LuisResult>(nameof(LuisResult)); var conversationData = await conversationStateAccessors.GetAsync(turnContext, () => luisResult); await _conversationState.SaveChangesAsync(turnContext, false, cancellationToken); if (luisResult.TopIntent == "None" || luisResult.TopIntentScore <= 0.50) { //await _qnaService.SendQnAResultAsync(turnContext, cancellationToken); await turnContext.SendActivityAsync(MessageFactory.Text("Llamando a qnamaker"), cancellationToken); } else if (luisResult.TopIntent == "agendar_reunion") { await _dialogService.ProcessDialog(dialog, _conversationState, turnContext, cancellationToken); } else { await _answersService.SendResponseAsync(luisResult.TopIntent, turnContext, cancellationToken); } }