I use some waterfall steps before I want to use QnA for getting an answer.
WaterfallStep[] steps = new WaterfallStep[]
{
MenuStepAsync,
QnAAsync,
};
Then when I want to call the QnA service, It needs a Turncontext object but in the waterfallstep dialog, I dont have access of the TurnContext.
private static async Task<DialogTurnResult> QnAAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken)
{
var response = _services.QnAServices[QnAMakerKey].GetAnswersAsync(turnContext);
return await stepContext.PromptAsync("name", new PromptOptions { Prompt = MessageFactory.Text("Please enter your name.") }, cancellationToken);
}
await
I am using C#. I did this in nodejs, but C# is a bit tricky. The following gives an error that stepContext cannot be converted to the Iturncontext. I understand this but not sure how can make it available to "GetAnswersAsync":
_services.QnAServices[QnAMakerKey].GetAnswersAsync(turnContext);
Thanks in the advace for your help.