问题
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);
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".
With LUIS I don't have this issue only with the QnAMakerDialog
.
Does anyone know how to solve it?
回答1:
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?");
}
]);
I think it's falling through because session.send
followed by session.endDialog
is not waiting for the user and it falls through.
来源:https://stackoverflow.com/questions/42629688/begin-dialog-with-qna-maker-bot-framework-recognizer-node-js