如何解决我无法在 azure bot 默认答案中以超链接的形式编写文本,该 bot 正在 MS 团队中工作,但它仅显示文本
机器人由 QnA maker 创建并与 Microsoft 团队集成。知识库有许多问题和答案对,但默认答案仅在此处在 azure 门户中编辑时接受文本:myBot.scm.azurewebsites.net/dev/wwwroot/Dialog/QnAMakerBaseDialog.cs。它需要做的是在 QnA KB 中找不到答案时以超链接的形式显示默认答案,而不是纯文本,但我找不到任何可以执行此操作的选项。
这是我试图修改以显示的主线。
public const string DefaultNoAnswer = "Sorry,I couldn't find an answer,please write your query in the ***form*** *(https://www.forms.office.com)* to be added in bot QnA Maker knowledge base";
namespace Microsoft.BotBuilderSamples.Dialog
{
/// <summary>
/// QnAMaker action builder class
/// </summary>
public class QnAMakerBaseDialog : QnAMakerDialog
{
// Dialog Options parameters
public const string DefaultNoAnswer = "Sorry,please write your query in the ***form*** *(https://www.forms.office.com)* to be added in bot QnA Maker knowledge base";
public const string DefaultCardTitle = "Did you mean:";
public const string DefaultCardNoMatchText = "None of the above.";
public const string DefaultCardNoMatchResponse = "Thanks for the feedback.";
private readonly MyBot;
/// <summary>
/// Initializes a new instance of the <see cref="QnAMakerBaseDialog"/> class.
/// Dialog helper to generate dialogs.
/// </summary>
/// <param name="services">Bot Services.</param>
public QnAMakerBaseDialog(IBotServices services): base()
{
this._services = services;
}
protected async override Task<IQnAMakerClient> GetQnAMakerClientAsync(DialogContext dc)
{
return this._services?.QnAMakerService;
}
protected override Task<QnAMakerOptions> GetQnAMakerOptionsAsync(DialogContext dc)
{
return Task.FromResult(new QnAMakerOptions
{
ScoreThreshold = DefaultThreshold,Top = DefaultTopN,QnAId = 0,RankerType = "Default",IsTest = false
});
}
解决方法
修改包含 HTML 链接的 QnA 知识库记录,将其更改为以下格式:
"Show your <b><font color=blue><a href=""https://www.microsoft.com"">Link here</a></font></b>."
您可以添加其他 HTML 标签来自定义文本。
在markdown格式中,链接的粗体网址:
[**text**](https://www.my.com)
示例代码:`
How do I create a bot with [**QnA Maker**](https://www.qnamaker.ai)? format for bold URL`
显示:如何使用 QnA Maker 创建机器人?粗体网址格式
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。