[英]How to configure multiple QnA models inside projects appsettings.json?
I have a bot which runs on Luis & QnA model using Dispatch tool. 我有一个使用Dispatch工具在Luis&QnA模型上运行的机器人。 Now the problem here is i have made another QnA model which i want to configure in my bot project ie i want to update the Knowledge base id in the appsettings.json of my c# project.
现在的问题是,我已经制作了另一个QnA模型,该模型要在我的bot项目中配置,即我想更新c#项目的appsettings.json中的知识库ID。 How can i do that?
我怎样才能做到这一点? as without that my second QnA is not getting picked.
没有这个,我的第二个QnA就不会被选中。
{
"Logging": {
"LogLevel": {
"Default": "Warning"
}
},
"MicrosoftAppId": "xxxxxxxxxxxxx",
"MicrosoftAppPassword": "xxxxxxxxxxxxxxxx",
"QnAKnowledgebaseId": "xxxxxxxxxxxx",
"QnAAuthKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"QnAEndpointHostName": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"QnAKnowledgebaseId": "xxxxxxxxxxxx",
"QnAAuthKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"QnAEndpointHostName": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"LuisAppId": "xxxxxxxxxxxxxxxxxxxx",
"LuisAPIKey": "xxxxxxxxxxxxxxxxxxxxx",
"LuisAPIHostName": "xxxxxx",
`enter code here`"AllowedHosts": "*"
}
Why can't you just set it in app settings as MODELNAME_QnAKnowledgebaseId, etc and then call it using either a simple switch case or dispatch in your bot? 您为什么不能仅在应用程序设置中将其设置为MODELNAME_QnAKnowledgebaseId等,然后使用简单的开关盒或在您的机器人中调度它来调用它?
},
"MicrosoftAppId": "xxxxxxxxxxxxx",
"MicrosoftAppPassword": "xxxxxxxxxxxxxxxx",
"MODEL1_QnAKnowledgebaseId": "xxxxxxxxxxxx",
"MODEL1_QnAAuthKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"MODEL1_QnAEndpointHostName": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"MODEL2_QnAKnowledgebaseId": "xxxxxxxxxxxx",
"MODEL2_QnAAuthKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"MODEL2_QnAEndpointHostName": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"LuisAppId": "xxxxxxxxxxxxxxxxxxxx",
"LuisAPIKey": "xxxxxxxxxxxxxxxxxxxxx",
"LuisAPIHostName": "xxxxxx",
"AllowedHosts": "*"
}
Then in your BotServices: 然后在您的BotServices中:
public BotServices(IConfiguration configuration)
{
// Read the setting for cognitive services (LUIS, QnA) from the appsettings.json
MODEL1_QnA = new QnAMaker(new QnAMakerEndpoint
{
KnowledgeBaseId = configuration["MODEL1_QnAKnowledgebaseId"],
EndpointKey = configuration["MODEL1_QnAEndpointKey"],
Host = configuration["MODEL1_QnAEndpointHostName"]
});
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.