如何使用LUIS

时间:2017-07-07 13:50:27

标签: node.js botframework adaptive-cards

当我们使用MS BotFramework在我们的机器人中使用LUIS识别器时,我们如何处理Action.submit?

var recognizer = new builder.LuisRecognizer(config.LUIS_MODEL_URL);
bot.recognizer(recognizer);

bot.dialog('toolAccess', [
    function (session,args,next) {

           const msg = new builder.Message(session)
                      .addAttachment({
            //adaptive card body here with Action.submit buttons...
           });
           session.send(msg);
    }
]).triggerAction({ matches : 'toolAccess'});
//toolAccess is an intent in my LUIS app.

我对自适应卡的操作是:

"actions": [
                {
                    "type": "Action.Submit",
                    "data": {
                            "type": "okProfileSelection"
                    },
                    "title": "OK"
                },
                {
                    "type": "Action.Submit",
                    "data": {
                            "type": "cancelProfileSelection"
                    },
                    "title": "Cancel"
                }
            ]

所以问题是如何处理这些OK和Cancel按钮?我应该添加另一个对话框?如果是这样,triggerAction应该是什么?

1 个答案:

答案 0 :(得分:0)

设置机器人时,请使用以下默认处理程序:

<img ng-src="{{product.images[0].full}}"/>

有关完整的工作示例,请查看:BotBuilder-Samples/Node/cards-AdaptiveCards