本节中“CreateNote”代表什么?

问题描述 投票:0回答:2

请参阅此链接https://docs.microsoft.com/en-us/bot-framework/nodejs/bot-builder-nodejs-recognize-intent-luis

我拿了这段代码:

// CreateNote dialog
bot.dialog('CreateNote', [
    function (session, args, next) {
        // Resolve and store any Note.Title entity passed from LUIS.
        var intent = args.intent;
        var title = builder.EntityRecognizer.findEntity(intent.entities, 'Note.Title');

        var note = session.dialogData.note = {
          title: title ? title.entity : null,
        };

我不明白的是'CreateNote're在本节中的内容是什么?

并参考这一行:

var title = builder.EntityRecognizer.findEntity(intent.entities, 'Note.Title');

假设我的意图名称是calendar.add,我的实体名称calendar.location将使intent.entities calendar.add.calendar.location产生任何混淆。

node.js luis
2个回答
0
投票

这是对话框的内部标识符,可以在必要时引用。

关于第二部分,我认为它不会造成混淆,但是如果你两周后再回到这个代码,那么你会抓住你的想法为什么这样命名,所以它更像是物流类在我看来,这件事。


0
投票

取自官方https://docs.microsoft.com/en-us/bot-framework/nodejs/bot-builder-nodejs-dialog-manage-conversation-flow。 'CreateNote'是对话框的标识符,可以像这样使用:

var inMemoryStorage = new builder.MemoryBotStorage();
var bot = new builder.UniversalBot(connector, 
function (session) {
    session.send("Welcome");
    session.beginDialog('perroDialog'); //Use beginDialog with the 
    //dialog identifier for starting perroDialog

}
).set('storage', inMemoryStorage); // Register in-memory storage 

//--------------------------DIALOGS WATERFALL------------------------
bot.dialog('perroDialog',
function (session) {
    session.send('You started perroDialog');
    session.endDialog(); //Back to / dialog (UniversalBot callback)
});
© www.soinside.com 2019 - 2024. All rights reserved.