首页 > 解决方案 > 中断后返回瀑布对话框

问题描述

在使用 Luis 检测到中断后,我在尝试返回瀑布对话框时遇到问题。例如,我的瀑布中有 5 个步骤,在第 3 步中 Luis 检测到中断并正确回答,但瀑布返回第 4 步并且不再询问第 3 步。

async interrupt(innerDc) {
    if (innerDc.context.activity.text) {
        const luisResult = await this.luisRecognizer.executeLuisQuery(innerDc.context);
        switch (LuisRecognizer.topIntent(luisResult)) {

        case 'TiempoDesembolso':
            const getWeatherMessageText = 'El tiempo de desembolso actual es de 12 meses';
            await innerDc.context.sendActivity(getWeatherMessageText, getWeatherMessageText, InputHints.IgnoringInput);
            return await this.onContinueDialog(innerDc);
        }
    }

我怎样才能再次要求第 3 步,然后继续瀑布流?

标签: node.jsbotframeworkinterrupt

解决方案


您应该能够return await innerDc.repromptDialog();在您的案例语句中使用来重新提示活动对话框的最后一步。我使用了旧版本,它在我的主 dispatchBot.js 文件中包含中断代码,而不是单独的 cancelAndHelpDialog 文件,但我认为方法是相同的。


推荐阅读