gpt4 book ai didi

azure - 如何在问答 Azure 机器人中设置默认答案

转载 作者:行者123 更新时间:2023-12-03 00:48:46 25 4
gpt4 key购买 nike

我想更改 Q&A Maker Azure Framework Bot 中的默认答案,但我找不到响应此值的字段。我正在阅读文档(但看起来它使用的是较旧的界面),并且我正在尝试找到该字段但有结果。

这是我当前的配置屏幕:

azure configuration screenshot

最佳答案

我假设您指的是这些文档:QnaMaker - Change Default Answer

它们有点令人困惑,但关键部分是:

You can override this default response in the bot or application code calling the endpoint.

文档中包含此图像的位置:

App Service > Configuration > DefaultAnswer

它们的实际含义是,在 QnAMaker 测试控制台中,您可以从应用程序设置中编辑默认答案。请务必保存、训练并发布您的应用,否则设置可能不会显示。

还有一种方法可以让您在机器人中使用此设置作为默认答案:

在 Node/JS 中,您的机器人根本不会收到 DefaultAnswer。如果不匹配,它不会收到任何内容,因此您必须使用以下内容对其进行硬编码:

const qnaResults = await this.qnaMaker.getAnswers(context);

// If an answer was received from QnA Maker, send the answer back to the user.
if (qnaResults[0]) {
await context.sendActivity(qnaResults[0].answer);

// If no answers were returned from QnA Maker, show this reply.
// Note: .getAnswers() does NOT return the default answer from the App Service's Application Settings
} else {
const defaultAnswer = 'No QnA Maker answers were found. This example uses a QnA Maker Knowledge Base that focuses on smart light bulbs. To see QnA Maker in action, ask the bot questions like "Why won\'t it turn on?" or "I need help."'
await context.sendActivity(defaultAnswer);
}

关于azure - 如何在问答 Azure 机器人中设置默认答案,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55636025/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com