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 關注
- 169 瀏覽
添加回答
舉報