使用QnA Maker Bot Framework识别器(Node JS)的“开始"对话框

编程入门 行业动态 更新时间:2024-10-26 08:23:38
本文介绍了使用QnA Maker Bot Framework识别器(Node JS)的“开始"对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想知道是否可以使用QnA Maker识别器在与机器人进行聊天的开始时传递欢迎消息",而模型不会将其识别为要发送给模型的消息.我正在使用最新的Node.js API.

I was wondering if one can pass a "Welcome Message" on the beginning of a chat with a bot using QnA Maker recognizer without the model recognizing it as message to send to the model. I'm using the latest Node.js API.

var intents = new builder_cognitiveservices.QnAMakerDialog({ recognizers: [recognizer], defaultMessage: 'Sorry. I didnt understand', qnaThreshold: 0.3} ); bot.dialog('/', [ function(session){ session.beginDialog('welcome'); }, function(session){ session.beginDialog('dialog'); } ]); bot.dialog('welcome', [ function (session) { // Send a greeting and show help. session.send("Hi! How can I help you?"); session.endDialog(); } ]); bot.dialog('dialog', intents);

就像这样,我的机器人正在发送session.send("Hi! How can I help you?"); QnA模型并回答对不起.我不明白".

Like this, my bot is sending the session.send("Hi! How can I help you?"); to the QnA Model and replying "Sorry. I didnt understand".

使用 LUIS ,我仅使用QnAMakerDialog时就没有此问题.

With LUIS I don't have this issue only with the QnAMakerDialog.

有人知道如何解决吗?

推荐答案

我认为这段代码可以为您提供所需的行为.

I think this code gives you the behavior you're looking for.

bot.dialog('welcome', [ function (session) { // Send a greeting and show help. builder.Prompts.text(session, "Hi! How can I help you?"); } ]);

我认为这是失败的原因,因为session.send后跟session.endDialog并不是在等待用户,而是失败了.

I think it's falling through because session.send followed by session.endDialog is not waiting for the user and it falls through.

更多推荐

使用QnA Maker Bot Framework识别器(Node JS)的“开始"对话框

本文发布于:2023-11-17 06:27:21,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1609153.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:对话框   Bot   Maker   QnA   Framework

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!