I\'m new to Alexa skill creation. I tried to create a skill for my term project in college and am trying to finish it. I\'ve finally got the Lambda and interaction model commu
You have a couple of things to be corrected.
LaunchRequest
and not LaunchIntent
. When you invoke a skill, this is the handler which will be called. context.succeed(handlers());
, you can remove it from all the intent handlers. true
, Alexa will end the current session and your skill will be closed. No subsequent user speech will reach your backend code unless you invoke it again.The good thing is that, you don't have to set this parameter manually and the SDK will take care of it as follows:
"shouldEndSession":"false"
in response.Ex:
'AbcIntent': function () {
var speech="Your speech here";
var reprompt="Your re-prompt here";
this.emit(':ask', speech,reprompt);
}
AMAZON.StopIntent
.listen()
, speak()
will be treated as :tell, it just tell the response and set "shouldEndSession":"true"
in response which will end the session. But if there is a listen()
, the SDK will set "shouldEndSession":"false"
in response and will keep the session alive.Make your changes like this:
"LaunchRequest": function () {
this.response
.speak("Hello, Welcome to Family Table. where would you like to make a reservation today?")
.listen("where would you like to make a reservation today?");
this.emit(':responseReady');
}
Or use :ask
"FoodIntent": function () {
const speech = "What kind of food would you like today?";
const reprompt = "What kind of food would you like today?";
this.emit(':ask',speech,reprompt);
}