Azure Bot:如何检查或提取响应中存在的LUIS“实体”以提示用户输入?

时间:2018-01-19 06:27:08

标签: node.js azure chatbot luis

        .matches('Note.Create', [(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,
            };

            // Prompt for title
            if (!note.title) {
                builder.Prompts.text(session, 'What would you like to call your note?');
            } else {
                next();
            }
        },
 (session, results) => {
        var note = session.dialogData.note;
        if (results.response) {
            note.text = results.response;
        }
    .
    .
    .
        }])

在上面的代码中,当用户询问What would you like to call your note?时。用户的回复可以是My Note Titlei would like call my note **My note Title**Let us call it **My Note Title**

所以问题是如何从对My Note Title的响应中提取/获取Prompts

目前将整个回复存储在note.text = results.response;

0 个答案:

没有答案