【问题标题】:How to keep a counter of default messages in Microsoft Bot Builder and alter Bot response?如何在 Microsoft Bot Builder 中保留默认消息计数器并更改 Bot 响应?
【发布时间】:2019-01-06 08:02:45
【问题描述】:

我正在尝试让 azure Web 应用程序机器人在 3 次尝试后无法在 QnA maker 知识库中找到答案后以不同的消息响应。

我想知道我会将柜台放在哪个班级并检查它?我也无法弄清楚答案存储在哪个变量中。 我正在使用 Microsoft Azure 的网络应用程序机器人中的问答机器人模板代码。

【问题讨论】:

  • trying to have the azure web app bot respond with a different message after it can't find an answer in the QnA maker knowledgeQnAMakerDialog的源代码中,目前似乎没有提供在对话框中找不到答案时自定义动态DefaultMessage的方法或函数。
  • 功能请求:Allow custom default return messages 在 github 问题中创建。

标签: c# botframework chatbot azure-bot-service qnamaker


【解决方案1】:

其实没什么难的..在 BasicQnAMakerDialog 中,你可以发现有一个构造函数覆盖,如下所示。您可以在类中创建一个属性(确保它是静态的),并在消息控制器中将预期值设置为该属性(“ else if (message.Type == ActivityTypes.ConversationUpdate)”方法。

public BasicQnAMakerDialog() : 
base(new QnAMakerService(new 
QnAMakerAttribute(ConfigurationManager.AppSettings["QnAAuthKey"], 
ConfigurationManager.AppSettings["QnAKnowledgebaseId"], 
**noneofabove**, 0.1, 4, 
ConfigurationManager.AppSettings["QnAEndpointHostName"])))
            {
            }

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-08-26
    • 1970-01-01
    • 1970-01-01
    • 2019-11-14
    • 2021-01-08
    • 1970-01-01
    相关资源
    最近更新 更多