Experiment with Yes and No intent
This commit is contained in:
@@ -66,16 +66,17 @@ var generateInteractionModel = function (skill) {
|
|||||||
|
|
||||||
//Special Amazon intent
|
//Special Amazon intent
|
||||||
|
|
||||||
allIntents.push (
|
allIntents.push ({
|
||||||
{
|
name: 'YesIntent',
|
||||||
name: 'AMAZON.YesIntent',
|
samples: ['Yes', 'Yes please', 'Sure'],
|
||||||
samples: [],
|
slots: [],
|
||||||
},
|
});
|
||||||
{
|
|
||||||
name: 'AMAZON.NoIntent',
|
allIntents.push ({
|
||||||
samples: [],
|
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});
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ module.exports = {
|
|||||||
this.attributes['WaitingQuestions'] = false;
|
this.attributes['WaitingQuestions'] = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
handlers['AMAZON.YesIntent'] = function () {
|
handlers['YesIntent'] = function () {
|
||||||
console.log("yes intent");
|
console.log("yes intent");
|
||||||
if (this.attributes['WaitingQuestions']) {
|
if (this.attributes['WaitingQuestions']) {
|
||||||
this.response
|
this.response
|
||||||
@@ -60,7 +60,7 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
handlers['AMAZON.NoIntent'] = function () {
|
handlers['NoIntent'] = function () {
|
||||||
console.log("No intent");
|
console.log("No intent");
|
||||||
if (this.attributes['WaitingQuestions']) {
|
if (this.attributes['WaitingQuestions']) {
|
||||||
this.attributes['WaitingQuestions'] = false;
|
this.attributes['WaitingQuestions'] = false;
|
||||||
@@ -71,7 +71,7 @@ module.exports = {
|
|||||||
handlers = {
|
handlers = {
|
||||||
LaunchRequest: function () {
|
LaunchRequest: function () {
|
||||||
this.response
|
this.response
|
||||||
.speak (activeSkill.invocationAnswer + '<break time="1s"/> Would you like to hear possible questions ?')
|
.speak (activeSkill.invocationAnswer + '<break time="650ms"/> Would you like to hear possible questions ?')
|
||||||
.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.attributes['WantToHearQuestions'] = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user