Botframework There are no interruptions from other Intent dialogs until they are executed with the current Intent dialog dialect

I have intentions A and B using LUIS.ai. In intent A, I use builder.Prompts.textto ask a couple of questions to the user. However, sometimes depending on the answer, he switched to intention B. I assume that this happens with my intention B, although I think it should not. Is there any way to prevent this? If I go through the dialogue of intentions A, I do not want any breaks from other intentions until I finish. Here is an example of my code.

bot.dialog('A', [
    function (session, args, next) {
        ...
    }, 
    function (session, args, next) {
        ...
    },
    function (session, args) {
        ...
    }
]).triggerAction({
    matches: 'A'
});


bot.dialog('B', [
    function (session, args, next) {
        ...
    }, 
    function (session, args, next) {
        ...
    },
    function (session, args) {
        ...
    }
]).triggerAction({
    matches: 'B'
});
+4
source share
1 answer

triggerAction. , (http://www.pveller.com/smarter-conversations-part-2-open-dialogs), .

, IntentDialog. , , A B, :

const intents = new builder.IntentDialog({
    recognizers: [
        new builder.LuisRecognizer(process.env.LUIS_ENDPOINT)
    ]
});

intents.matches('A', 'A');
intents.matches('B', 'B');

bot.dialog('/', intents);
bot.dialog('A', []);
bot.dialog('B', []);
+6

Source: https://habr.com/ru/post/1674583/


All Articles