在我的一个知识库从QnaMaker升级到具有自定义问题回答启用的语言资源(FKA QnAMaker托管)之后,我的聊天机器人不再工作,并返回一个错误: DialogContextError:未能生成答案:对象对象。
我的.env有:
QnAKnowledgebaseId=<name of my knowledgebase>
QnAEndpointKey=<the Ocp-Apim-Subscription-Key from the prediction url
QnAEndpointHostName=https://<languageresourcename>.cognitiveservices.azure.com/ (I also tried to add language/ to the url)QnaMaker初始化:
const { QnAMaker } = require('botbuilder-ai');
try {
this.qnaMaker = new QnAMaker({
knowledgeBaseId: process.env.QnAKnowledgebaseId,
endpointKey: process.env.QnAEndpointKey,
host: process.env.QnAEndpointHostName
});
} catch (err) {
console.warn(`QnAMaker Exception: ${ err } Check your QnAMaker configuration in .env`);
}并由下列人士召集:
const qnaResults = await this.qnaMaker.getAnswers(step.context);依赖关系:
"dependencies": {
"adaptivecards-templating": "^1.4.0",
"applicationinsights": "^1.8.10",
"azure-storage": "^2.10.5",
"body-parser": "^1.19.0",
"botbuilder": "^4.15.0",
"botbuilder-ai": "^4.15.0",
"botbuilder-azure-blobs": "4.14.1-preview",
"botbuilder-dialogs": "^4.15.0",
"botbuilder-lg": "^4.15.0",
"botframework-config": "^4.11.2",
...
}使用密钥,我的旧QnAMaker KB中的knowledgebaseid和主机名工作得很好。难以将新的预测url转换为QnAMaker的对象。
更新类GenerateAnswerUtils (由QnaMaker调用)预期如下:
const url = `${endpoint.host}/knowledgebases/${endpoint.knowledgeBaseId}/generateanswer`;这将不适用于迁移到自定义问题的QnaMaker KB,该问题需要这样的url:
'https://<languageresourcename>.cognitiveservices.azure.com/language/:query-knowledgebases?projectName=<projectname>&api-version=2021-10-01&deploymentName=production'不确定这是否应该是一个bugreport或特性请求。无论如何,我都会提出一个问题。
发布于 2021-12-09 18:32:44
BotFramework SDK还不支持新的自定义问题特性。这是导致错误的原因。已经提交了一个功能请求。
https://stackoverflow.com/questions/70261208
复制相似问题