From 085a0324b3a9681e0be11e1df3a001b42ce20386 Mon Sep 17 00:00:00 2001 From: GotPPay Date: Mon, 22 Jan 2018 20:12:16 +0100 Subject: [PATCH] . --- backend/helpers/amazon.js | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/backend/helpers/amazon.js b/backend/helpers/amazon.js index 2839f40..fa414ac 100644 --- a/backend/helpers/amazon.js +++ b/backend/helpers/amazon.js @@ -64,12 +64,25 @@ var generateInteractionModel = function (skill) { let result = {}; let allIntents = []; + allIntents.push({ + "name": "AMAZON.CancelIntent", + "samples": [] + }, + { + "name": "AMAZON.HelpIntent", + "samples": [] + }, + { + "name": "AMAZON.StopIntent", + "samples": [] + },); + skill.intents.map (intent => { - allIntents.push ({name: intent.intentName, samples: intent.questions}); + allIntents.push ({name: intent.intentName, samples: intent.questions, slots:[]}); }); //Special intent for sending message (Dialog) - +/* allIntents.push ({ name: 'SendMessageIntent', samples: [ @@ -95,7 +108,7 @@ var generateInteractionModel = function (skill) { }, ], }); - +*/ let customSlotTypes = [ { name: 'EmailSlot', @@ -230,16 +243,14 @@ var generateInteractionModel = function (skill) { intents: dialogIntents, }; - result.interactionModel = {}; - - result.interactionModel.languageModel = { + result.languageModel = { invocationName: skill.invocationName, - types: customSlotTypes, + //types: customSlotTypes, intents: allIntents, }; - result.prompts = dialogPrompts; - result.dialog = dialog; + //result.prompts = dialogPrompts; + //result.dialog = dialog; console.log(JSON.stringify(result)); return JSON.stringify (result);