improve code
This commit is contained in:
@@ -63,7 +63,6 @@ var refreshTokens = function () {
|
|||||||
var generateInteractionModel = function (skill) {
|
var generateInteractionModel = function (skill) {
|
||||||
let result = {};
|
let result = {};
|
||||||
let allIntents = [];
|
let allIntents = [];
|
||||||
let builtInIntents = [];
|
|
||||||
|
|
||||||
skill.intents.map (intent => {
|
skill.intents.map (intent => {
|
||||||
allIntents.push ({name: intent.intentName, samples: intent.questions});
|
allIntents.push ({name: intent.intentName, samples: intent.questions});
|
||||||
@@ -71,19 +70,17 @@ var generateInteractionModel = function (skill) {
|
|||||||
|
|
||||||
//Built-In like intents (Amazon built-in don't work, probably something related to existance of dialog intent
|
//Built-In like intents (Amazon built-in don't work, probably something related to existance of dialog intent
|
||||||
|
|
||||||
builtInIntents.push ({
|
allIntents.push ({
|
||||||
name: 'HelpIntent',
|
name: 'HelpIntent',
|
||||||
samples: ['Help', 'Can you help me', 'I need help'],
|
samples: ['Help', 'Can you help me', 'I need help'],
|
||||||
slots: [],
|
slots: [],
|
||||||
});
|
},
|
||||||
|
{
|
||||||
builtInIntents.push ({
|
|
||||||
name: 'CancelIntent',
|
name: 'CancelIntent',
|
||||||
samples: ['Cancel', 'Stop', 'Please stop'],
|
samples: ['Cancel', 'Stop', 'Please stop'],
|
||||||
slots: [],
|
slots: [],
|
||||||
});
|
},
|
||||||
|
{
|
||||||
builtInIntents.push ({
|
|
||||||
name: 'YesIntent',
|
name: 'YesIntent',
|
||||||
samples: [
|
samples: [
|
||||||
'Yes',
|
'Yes',
|
||||||
@@ -92,16 +89,13 @@ var generateInteractionModel = function (skill) {
|
|||||||
'Yes I would like that',
|
'Yes I would like that',
|
||||||
],
|
],
|
||||||
slots: [],
|
slots: [],
|
||||||
});
|
},
|
||||||
|
{
|
||||||
builtInIntents.push ({
|
|
||||||
name: 'NoIntent',
|
name: 'NoIntent',
|
||||||
samples: ['No', 'No thank you'],
|
samples: ['No', 'No thank you'],
|
||||||
slots: [],
|
slots: [],
|
||||||
});
|
});
|
||||||
|
|
||||||
allIntents.push(...builtInIntents);
|
|
||||||
|
|
||||||
//Special intent for sending message (Dialog)
|
//Special intent for sending message (Dialog)
|
||||||
|
|
||||||
allIntents.push ({
|
allIntents.push ({
|
||||||
|
|||||||
Reference in New Issue
Block a user