我正在构建一个LuisDialog,并且LUIS集成运行良好。
在LUIS没有填补我需要的所有空白的情况下,消除歧义的最佳方法是什么?
现在,我使用PromptDialog回调 - 所以在Dialog方法中(用LuisIntent属性修饰),当我需要得到更多细节/消歧时我会:
PromptDialog.Choice<string>(context, EnsureTimeOfDayChosen, new[] { "Morning (AM)", "Afternoon (PM)", "Any" }, "What time of day would you like us to book the appointment? (AM/PM/Any)", "Please choose AM or PM. Alternatively, if you don't mind which, just say Any.");
代表的身体(EnsureTimeOfDayChosen):
string AmPmOrAny = await result;
context.PerUserInConversationData.SetValue<string>("TimeOfDay", AmPmOrAny);
BookAppointment(context);
这种方法的问题是代表的最后一行 - 感觉不对。我不能轻易地回到最初调用的地方,LuisIntent装饰方法和简历。
相反,我必须预先处理LUIS信息,并在收集更多信息后调用BookAppointment方法,并将其存储在PerUserInConversationData中。
我做错了吗?
任何帮助将不胜感激 - 亲切的问候, 太
答案 0 :(得分:1)
鉴于Dialog模型的当前实现,我想不出更好的实现逻辑的方法。目前,只要您等待用户的异步响应,您的代码将在您响应时提供的回调中恢复。您可以将其视为Begin/End model for async programing