问题
Bot Framework Sample - NLP Dispatch Hi, I am using NLP dispatch, where I am having multiple Luis and QnA models running simultaneously. I have mapped top-scoring intents for Luis and have created a dialog class also which I want to implement in those intents mapped blocks. How can I initialize my dialog in the intent if block?
I have tried using Dotnet core 2.1 version and dispatch's latest version
code for dialog -
private async Task<DialogTurnResult> LeaveDateRangeStepAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken)
{
var leaveApply = (LeaveApplication)stepContext.Options;
if (leaveApply.TravelDate == null){
return await stepContext.PromptAsync(nameof(TextPrompt), new PromptOptions { Prompt = MessageFactory.Text("Please Provide me with your Leaves Tenure") }, cancellationToken);
}
else{
return await stepContext.NextAsync(leaveApply.TravelDate, cancellationToken);
}
}
intent block
if (topIntent == "LeavesDateTenure"){
// here I want my dialog to work
}
回答1:
You could try something like this in your if statement
await dc.BeginDialogAsync(nameof(YourDialogClass));
note - I am assuming your code is inside a RouterDialog and dc is the DialogContext instance
Also, have a look at the Bot Enterprise Template.
来源:https://stackoverflow.com/questions/57175155/how-to-initialize-bot-framework-dialog-in-a-luis-intent-block