Begin Dialog with QnA Maker Bot Framework recognizer (Node JS)

拈花ヽ惹草 提交于 2019-12-12 02:08:14

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!