I have managed to create a KB and web app bot - which I believe is generated with git.
Before sending the default no result found message ("No QnAMaker answers found.") response, I would like to call a REST API.
protected override async Task OnMessageActivityAsync(ITurnContext<IMessageActivity> turnContext, CancellationToken cancellationToken)
{
// get answer to user's question
// if no answer found, call rest api
await Dialog.RunAsync(turnContext, ConversationState.CreateProperty<DialogState>(nameof(DialogState)), cancellationToken);
}
In RootDialog.cs, it invokes
private async Task<DialogTurnResult> InitialStepAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken)
{
return await stepContext.BeginDialogAsync(nameof(QnAMakerDialog), null, cancellationToken);
}
Once the stepContext.BeginDialogAsync is completed, it searches the QnA Maker for answer and send it to the user. Is there a way to get the answer and the score in this method?
I am not sure where should I implement it. Hope someone can guide me.
Thanks in advance.