Yes and No intent dont work with dialog
This commit is contained in:
@@ -64,20 +64,6 @@ var generateInteractionModel = function (skill) {
|
|||||||
let result = {};
|
let result = {};
|
||||||
let allIntents = [];
|
let allIntents = [];
|
||||||
|
|
||||||
//Special Amazon intent
|
|
||||||
|
|
||||||
allIntents.push ({
|
|
||||||
name: 'YesIntent',
|
|
||||||
samples: ['Yes', 'Yes please', 'Sure'],
|
|
||||||
slots: [],
|
|
||||||
});
|
|
||||||
|
|
||||||
allIntents.push ({
|
|
||||||
name: 'NoIntent',
|
|
||||||
samples: ['No', 'No thank you'],
|
|
||||||
slots: [],
|
|
||||||
});
|
|
||||||
|
|
||||||
skill.intents.map (intent => {
|
skill.intents.map (intent => {
|
||||||
allIntents.push ({name: intent.intentName, samples: intent.questions});
|
allIntents.push ({name: intent.intentName, samples: intent.questions});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -42,40 +42,21 @@ module.exports = {
|
|||||||
'<break time="1s"/>';
|
'<break time="1s"/>';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
console.log(listOfPossibleQuestions);
|
|
||||||
|
|
||||||
//Defaul Amazon handlers (some of them)
|
//Defaul Amazon handlers (some of them)
|
||||||
|
|
||||||
handlers.NewSession = function () {
|
handlers.NewSession = function () {};
|
||||||
this.attributes['WaitingQuestions'] = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
handlers['YesIntent'] = function () {
|
|
||||||
console.log("yes intent");
|
|
||||||
if (this.attributes['WaitingQuestions']) {
|
|
||||||
this.response
|
|
||||||
.speak (listOfPossibleQuestions)
|
|
||||||
.listen(constants.voiceResponseStrings.GENERIC_CONTINUE);
|
|
||||||
this.emit(':responseReady');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
handlers['NoIntent'] = function () {
|
|
||||||
console.log("No intent");
|
|
||||||
if (this.attributes['WaitingQuestions']) {
|
|
||||||
this.attributes['WaitingQuestions'] = false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
//Handler for launch request
|
//Handler for launch request
|
||||||
handlers = {
|
handlers = {
|
||||||
LaunchRequest: function () {
|
LaunchRequest: function () {
|
||||||
this.response
|
this.response
|
||||||
.speak (activeSkill.invocationAnswer + '<break time="650ms"/> Would you like to hear possible questions ?')
|
.speak (
|
||||||
|
activeSkill.invocationAnswer +
|
||||||
|
'<break time="650ms"/>' +
|
||||||
|
listOfPossibleQuestions
|
||||||
|
)
|
||||||
.listen (constants.voiceResponseStrings.GENERIC_CONTINUE); //Phrase from listen doesn't work !!!
|
.listen (constants.voiceResponseStrings.GENERIC_CONTINUE); //Phrase from listen doesn't work !!!
|
||||||
|
|
||||||
this.attributes['WantToHearQuestions'] = true;
|
|
||||||
|
|
||||||
this.emit (':responseReady');
|
this.emit (':responseReady');
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user