LUIS / QNA保持触发与选择提示中的选项相关的意图。
我的问题是LUIS / QNA有一种方法可以忽略来自选择提示的用户输入吗?或者选择快速回答不是用户输入,所以LUIS / QNA会单独留下选择?
例如,在此选择提示中。这将无法达到SecondStepAsync,因为LUIS / QNA将检测用户的选择作为类似于选择标签的意图并执行其他操作。
private static async Task<DialogTurnResult> FirstStepAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken = default(CancellationToken))
{
choices.Add(new Choice { Value = "Choose Red"});
choices.Add(new Choice { Value = "Choose Green"}});
return await stepContext.PromptAsync(
ChoicePromptId,
new PromptOptions
{
Prompt = MessageFactory.Text($"Welcome to FAQ! Choose the number of the question or type your own question."),
Choices = choices,
});
}
private static async Task<DialogTurnResult> SecondStepAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken = default(CancellationToken))
{
var choiceResult = (stepContext.Result as FoundChoice).Value.ToLower();
switch (choiceResult)
{
case "choose red":
await stepContext.Context.SendActivityAsync(MessageFactory.Text($"..."));
break;
case "choose green":
await stepContext.Context.SendActivityAsync(MessageFactory.Text($"..."));
break;
default:
break;
}
return await stepContext.NextAsync();
}
LUIS是一种独立服务,它只接受输入,即话语,并以输出即意图恢复。
现在,如果您希望LUIS忽略选择提示语言,那么您将在OnTurnAsync方法本身中构建它。
你可以看看here in this tutorial。根据用户提供的响应,您将使用适当的服务。这就是你的onTurnAsync伪代码应该是这样的
OnTurnAsync()
Record the utterance Check what was the active dialog. <Documentation [here][2]> IF (!choice Dialog) call LUIS else /* your code here. */