1 回答
TA贡献1810条经验 获得超4个赞
我测试了您提供的代码,并用我的LUIS应用程序modelID&subscriptionKey替换了该代码,如果该代码达到了perfil意图,则该代码将按预期工作。
如果LuisDialog无法根据收到的消息解析要执行的方法(意图),则会收到异常:
给定的键在词典中不存在。
为了解决这个问题,我[LuisIntent("")]在None方法之上添加了内容。
[LuisModel(modelID: "{your_modelID}", subscriptionKey: "{your_ subscriptionKey}")]
[Serializable]
public class Perfil : LuisDialog<object>
{
[LuisIntent("")]
[LuisIntent("None")]
public async Task None(IDialogContext context, LuisResult result)
{
await context.PostAsync("I'm sorry I don't have that information");
await context.PostAsync("Try again");
}
[LuisIntent("perfil")]
public async Task perfil(IDialogContext context, LuisResult result)
{
await context.PostAsync("My name is Alex");
}
}
测试结果:
达成perfil目标:
异常错误:
- 1 回答
- 0 关注
- 146 浏览
添加回答
举报