当QnAmaker没有任何响应来显示提示对话框时,如何更改默认答案。

例如:

使用者1:您好
Bot:你好!
使用者1:您出售汽车吗?
Bot:找不到合适的匹配!

该漫游器应该提出可用服务列表,而不是找不到合适的匹配项。

另外,只要找不到匹配项,该漫游器就应再次提出可用服务列表。

如何实现呢?

最佳答案

QnAMakerAttribute具有defaultMessage参数,允许您自定义“不匹配”响应文本:https://github.com/Microsoft/BotBuilder-CognitiveServices/blob/7866f5a1bc970bdd0be341b9ba24c74067edf57c/CSharp/Library/QnAMaker/QnAMaker/QnAMakerService/QnAMakerAttribute.cs

public class BasicQnAMakerDialog : QnAMakerDialog
{
  public BasicQnAMakerDialog() : base(
         new QnAMakerService(
                new QnAMakerAttribute(
                      Utils.GetAppSetting("QnASubscriptionKey"),
                      Utils.GetAppSetting("QnAKnowledgebaseId"),
                      "**List of services: one, two three**",
                      0.30,
                      8))) {}
}


还有一个等待合并的请求请求,将允许覆盖发送默认消息:https://github.com/Microsoft/BotBuilder-CognitiveServices/pull/87在此之前,看来唯一的选择是在自己的代码库中复制QnAMakerDialog:QnAMakerDialog source

关于c# - QnAmaker没有任何响应时,QnAmaker更改默认答案,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/50253608/

10-11 04:09
查看更多