【发布时间】:2018-02-01 22:41:01
【问题描述】:
我正在尝试通过检测语言并选择正确的 LUIS 键和字符串集来创建多语言机器人。我的问题是,我的 LuisDialog 会自行序列化,并且不再调用 MakeRoot 方法。
我的代码(大致):
public async Task<HttpResponseMessage> Post([FromBody]Activity activity)
{
if (activity.Type == ActivityTypes.Message)
{
var languageData = DetectLanguage(activity); // here I have the keys, strings etc.
await Conversation.SendAsync(activity, () => new Dialogs.RootDialog(languageData));
}
else
{
HandleSystemMessage(activity);
}
var response = Request.CreateResponse(HttpStatusCode.OK);
return response;
}
我已经尝试使用中间对话框,它选择语言和 context.Forward LuisDialog 的所有内容,但我正在努力管理它。如果这是一个好的策略,我可以分享更多代码。我也在考虑得分。
【问题讨论】:
-
请添加您的 RootDialog 实现。通过动态设置 AppId / Secret,可以“非常轻松”地在 LUIS 应用之间切换
-
我的 Root(Luis)Dialog 在几个基类中有数百行,你能告诉我你想到的是 RootDialog 的哪一部分吗?我在 LuisDialog 的
base构造函数中设置键
标签: c# botframework azure-language-understanding