本文整理汇总了TypeScript中botbuilder.LuisDialog.onDefault方法的典型用法代码示例。如果您正苦于以下问题:TypeScript LuisDialog.onDefault方法的具体用法?TypeScript LuisDialog.onDefault怎么用?TypeScript LuisDialog.onDefault使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类botbuilder.LuisDialog
的用法示例。
在下文中一共展示了LuisDialog.onDefault方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: addDialogs
addDialogs() {
let dialog = new LuisDialog(this.luisUrl);
console.log('dialog is ', dialog);
this.bot.add('/', dialog);
dialog.on('FindItemLevel', [
this.processLanguage,
this.getCharacterName,
this.getRealm,
this.getIlvl
]);
dialog.onDefault(DialogAction.send("I could not understand your request."));
}
示例2: if
let model = process.env.LUIS_AI_MODEL
let luisDialog = new builder.LuisDialog(model);
module.exports = luisDialog;
/** Answer users help requests. We can use a DialogAction to send a static message. */
// luisDialog.on('None', function(session) {
// console.log('Intent Triggered: None')
// session.send(prompts.helpMessage);
// });
luisDialog.onDefault((session) => {
if (session.message.text.toLowerCase().indexOf('google') != -1) {
session.userData.routeProvider = 'google';
session.send("Ok, I'll use google.");
} else if (session.message.text.toLowerCase().indexOf('rejseplanen') != -1) {
session.userData.routeProvider = 'rejseplanen';
session.send("Ok, I'll use rejseplanen.")
} else {
session.send(prompts.helpMessage);
}
});
luisDialog.on('error', function(message) {
console.error(message);
});
/** Prompts a user for the title of the task and saves it. */
luisDialog.on('FindRoute', [
function (session, args, next) {
console.log('Intent Triggered: FindRoute');
示例3: function
}
/*,
function (session, results) {
if (results.response) {
session.beginDialog("/");
}
else {
delete session.userData.channelNames;
session.endDialog();
}
}*/
]);
//dialog.onDefault(builder.DialogAction.send("I'm sorry. I didn't understand."));
dialog.onDefault("/query-package");
dialog.on("intent-change-tv-package", [
function (session, args) {
//session.userData.selectedPackageName = "Custom TV Essentials";
//session.send("From:" + session.message.from.channelId);
var entity = builder.EntityRecognizer.findEntity(args.entities, 'tv-package-name');
if (null != entity) {
var tvPackageName = entity.entity;
if (null != tvPackageName) {
tvPackageName = tvPackageName.replace(/\s+/g, '');
if (session.userData.selectedPackageName != fiosTVPackages[tvPackageName]) {
session.userData.selectedPackageName = fiosTVPackages[tvPackageName];
//session.send("Your current selection: " + session.userData.selectedPackageName);
var packageInfo = "Your current selection: " + session.userData.selectedPackageName;