question

MikeV avatar image
MikeV asked

Do NextIntent and RepeatIntent need Lambda Function Updates?

Looking more at the Lambda function...

And... how to get those intents to actually work?

Shouldn't the Lambda function also be updated to use them?

I cannot find information on what to do.

It seems that there should be a pause... Alexa creates speechOutput, reading the random fact, asks "would you like another or to repeat this one" and acts on Next or Repeat or Stop utterances.

BUT HOW?!?!!

What do I insert, and where between the curley brackets do I insert it?

Pasting here straight from my Lambda function:

}, 'GetFact': function () {

// Get a random space flight fact from the space facts list

var factIndex = Math.floor(Math.random() * FACTS.length);

var randomFact = FACTS[factIndex];

// Create speech output

var speechOutput = "Here's your fun fact about space flight: " + randomFact;

this.emit(':tellWithCard', speechOutput, SKILL_NAME, randomFact)

},

Shouldn't there be three SOMETHINGs...

// Create speech output

var speechOutput = "Here's your fun fact about space flight: " + randomFact <SOMETHING_1> RIGHT HERE TO MAKE ALEXA ASK "want another" or "repeat";

this.emit(':tellWithCard', speechOutput, SKILL_NAME, randomFact)

And then should there be <SOMETHING_2>...

{

in another curley bracket section with

AMAZON.NextIntent

}

And should there also be <SOMETHING_3>...

{

in another curley bracket section with

AMAZON.RepeattIntent

}

If so, what's that look like?

},

'AMAZON.NextIntent': function () {

var speechOutput = "Would you like another Space Flight Fun Fact?";

since the logic for "Next" intent is actually the exact same as "GetFact"

how to "call GetFact" or "GOTO GetFact"?????????" or "just please read the next fact already, Alexa?"

or

do I repeat the GetFact logic right here in the NextIntent curley bracket section?!?!?!?;

},

?

And what to do to get Alexa to repeat the last Fun Fact when I say "Repeat," and not play the last song played? Is some slot management needed?

Where's the information on how to add the current Fun Fact to some slot such that the slot can be referenced by RepeatIntent?

Thanks,

Mike

alexa skills kitlambdaintentsresponse
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jamie Grossman avatar image
Jamie Grossman answered

The short answer is yes. You need to handle the logic on the backend of your skill. These built in-intents are only getting the language that may be applicable to them, but it's up to you to trigger the 'next' intent, to repeat the last utterance mentioned, etc. You can do the first by just including 'AMAZON.NextIntent' in your code and providing logic, and you can do the second by saving your previous output utterances with session attributes.

1 comment
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jamie, Thank you!

Is there sample code for AMAZON.NextIntent anywhere?

I have included NextIntent, and the utterances, as noted above, but just don't know how to get Alexa to pause after stating any given fact from the fact skills list, and to then get the next fact (should she call/invoke the GetFact or should some Next<something> be a copy/paste of the GetFact logic?)

Do you have any clue how to contact the good soul who created the "Chuck Norris Jokes Unofficial" skill (https://www.amazon.com/gp/product/B01N6L7GPJ), to see if he/she/they are willing to share how they did just this in their awesomely humorous skill?

And, I expounded on this in the other Question's thread... might you have additional insights into the questions I pose in:

https://forums.developer.amazon.com/questions/71571/how-to-make-next-fact-and-how-does-it-work.html

?

And, might you have any insights on this "challenge" I discovered in BuilderBETA:

https://forums.developer.amazon.com/questions/73791/interaction-model-beta-builder-dropped-next-and-re.html

?

0 Likes 0 ·
Jamie Grossman avatar image
Jamie Grossman answered
  1. There isn't sample code. It's up to you to know what your skill's response should be when they say 'next'. If Alexa is saying the first fact, you would say 'Alexa, next' to interrupt her, and she will say whatever you have specified
  2. I would leave a review as we do not share personal details
  3. I just responded to that
  4. Also responded

Thanks,

Jamie

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.