到目前为止,我能够通过执行以下操作来避免硬编码我的LUIS appId和密钥:
var luisService = new LuisService(new LuisModelAttribute(ConfigurationManager.AppSettings["LuisAppId"], ConfigurationManager.AppSettings["LuisAppKey"]));
context.Call(new LuisDialog(luisService), ResumeAfterDialog);
然后将我的LUIS对话框声明为:
[Serializable]
public class LuisDialog : LuisDialog<object>
{
public LuisDialog(ILuisService ls) : base(ls)
{
}
....
}
}
但我还希望能够以编程方式设置LullModel属性中可用的SpellCheck = true,Log,Verbose和其他参数,有没有办法做到这一点?
谢谢
答案 0 :(得分:0)
我想通了,我只需要在创建LuisService之前在代码中设置LuisModelAttribute属性:
var luisSettings = new LuisModelAttribute(ConfigurationManager.AppSettings["LuisAppId"], ConfigurationManager.AppSettings["LuisAppKey"]);
luisSettings.Log = true;
luisSettings.SpellCheck = true;
luisSettings.Log = true;
var luisService = new LuisService(luisSettings);
context.Call(new LuisDialog(luisService), ResumeAfterDialog);