如何使用我们自己的qnamakerservice来使用appinsights来跟踪日志,而不是在'qna-with-appinsights‘示例中使用下面的示例代码?
// Call QnAMaker.generateAnswer to retrieve possible Question and Answer pairings for the user's message.
const results = await super.generateAnswer(turnContext.activity.text, top, scoreThreshold);发布于 2019-01-09 02:58:27
您正在询问如何使用您已经构建的不同的QnA Maker知识库,而不是在运行msbot clone命令时由bot.recipe创建的知识库?
您只需更改index.js LN 53中的qnaEndpointSettings即可。
const qnaEndpointSettings = {
knowledgeBaseId: qnaConfig.kbId,
endpointKey: qnaConfig.endpointKey,
host: qnaConfig.hostname
};这些值是从您的.bot文件填充的,因此请确保您在其中添加了自定义QnAMaker凭据。
这可以通过以下两种方式完成:
.bot文件中。因此,在您正在使用的特定示例中,您将编辑"type: "qna"对象:{“类型”:"qna",“名称”:"qna-with-insights-QnAMaker","id":"34","kbId":"","subscriptionKey":"","endpointKey":"","hostname":"“}
或
msbot connect qna ...命令,这将确保您有一个格式正确的qna对象。Documentation here.https://stackoverflow.com/questions/53799106
复制相似问题