question

MikeV avatar image
MikeV asked

How to make Next Fact, and how does it work?

Might you know how to use "Next?"

After I first posted, I saw the Interaction Model Builder BETA.

So I'll add the Next and Repeat... I still seek to understand how those actually work.

I'd like our fact skills to work like...

Me: "Alexa, Ask <skill name>"

Alexa: "<state a fact from the skill.> Would you like another?"

Me: "Yes, Next"

Alexa: "<state the next random fact from the skill.> Would you like another?"

Question 1:

Is there any template to follow to do this?

and also...

For the "next fact intent,"

wouldn't I want something like...

NextFactIntent Next

NextFactIntent Alexa Next

NextFactIntent Next Fact

NextFactIntent Alexa Next Fact

NextFactIntent Next Fun Fact

NextFactIntent Alexa Next Fun Fact

NextFactIntent Next Fact Please

NextFactIntent Alexa Next Fact Please

NextFactIntent Go

NextFactIntent Alexa Go

NextFactIntent Continue

NextFactIntent Alexa Continue

and then...

Question2:

how to link the actual get Alexa to state the next fact?

PossibleAnswer1: Re-invoke the GetFact

or

PossibleAnswer2: Create a new NextFact (wouldn't it just repeat the logic of GetFact?)

?

If PossibleAnswer2, is it something like this:

(copy NextFact"

}, 'NextFact': function () {

// Share the last 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 is your next space flight fun fact: " + randomFact;

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

Thanks,

Mike

intents
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.

As noted, as I posted this I also saw Skill Builder Beta, and its ability to press the '+' (plus) button and add AMAZON.NextIntent. I added that to my skill and it quickly passed certification... and it acts no differently.

I want our fact skills to act like the "Chuck Norris Jokes Unofficial" skill (https://www.amazon.com/gp/product/B01N6L7GPJ):

Alexa "states / reads a fact," then say "would you like another?"

User says "yes" or some other similar utterance, and Alexa states / reads the next fact.

How to get Alexa to ask "would you like another," and pause for the "next" utterance?

Thanks,

Mike

0 Likes 0 ·
Jamie Grossman avatar image
Jamie Grossman answered

Thanks for posting. I'd say as this issue is specific to your account, please file a contact us here where we will be able to assist further with the above information and the affected skill id.

Regards,

Jamie

4 comments
10 |5000

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

Apologies that life got busy and I only return now.

I am confused.

I click on "contact us here." and it takes me to a blank support page. What am I supposed to do when I get there?

Do I just paste the URL to this page and then ask then to read it?

Why?

What are you seeing about my account that suggests the need to do this?

Thanks,

Mike

0 Likes 0 ·

That doesn't sound right. There should be a form there. Try it from another browser.

This issue sounded like it was exclusive to your account, so it was suggested you try contacting the team directly here to may be able to help further. Alternatively, you can post a new thread with your issues clearly defined as this thread has gotten a little confusing. Thanks.

0 Likes 0 ·
MikeV avatar image MikeV Jamie Grossman ♦♦ ·

and that link goes to a blank screen and I don't know what to do once I get there.

The thread on

Answer by MikeV · Jul 19 at 02:10 AM

is pretty straightforward....

1) do Next and Repeat need some logic in the Lambda function?

2) if so, how to make Lambda function work with Next and Repeat?

since the editor is deleting the blank lines I'm inserting to help provide breaks between sections of my post, I welcome your recommendation on how to make these easier to read... thanks! : )

0 Likes 0 ·
Show more comments
Jamie Grossman avatar image
Jamie Grossman answered
  1. We do have a fact skill as an example you could use. When creating a new lambda function, search fact and it should come up. Those utterances look good too, though no need for the ones with 'Alexa' as the user will already be in your skill
  2. Use the same intent, and use an array of facts, or session attributes, or whatever to say the next fact you'd like to present to the user
2 comments
10 |5000

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

So...

I revisited Space Flight Fun Facts... and I saw it had RepeatIntent and NextIntent.

I went ahead and submitted for new certification...

AND then I went back in... I clicked "View."

And those two intents are missing...

Before submitting for Certification, the Interaction Model BETA Builder showed 5 + 1 intents.

And it now shows 3+1, just like it did when I submitted for original certification back in March.

Any thoughts???

Thanks,

Mike

0 Likes 0 ·

Jamie. Thanks! BUT

I am Incredibly confused.

I went into my Skill... created a new version... entered Interaction Model BuilderBETA... added NextIntent AND RepeatIntent using the + / Plus button...

for next intent... typed the utterances listed above in my original post...

ran the skills

and.

nothing.

User says: "Alexa, Ask Space Flight Fun Facts"

Alexa says: "<random space flight fun fact>"

the end... I speak the points above and nothing.

Well... ok, something... I say "Alexa, next" and she plays the next song from the playlist she was playing an hour or so ago.

If I say "Alexa, next fun fact" she replies "Sorry I don't know that."

What am I missing?!?!

please help!

: )

The Skill I'm noting:

Space Flight Fun Facts

by TwiceEnergyProductions

https://www.amazon.com/Michael-Van-Vooren-Space-Flight/dp/B06XYM6RX9/ref=sr_1_3?s=digital-skills&ie=UTF8&qid=1491394931&sr=1-3&keywords=vooren

And, on a related note...

When I published Space Flight Fun Facts (and when our family published all the others...)

the Publishing page, and the reviewers during certification, made us enter the three "Example Phrases" that you see on the skill's page on the Alexa app on your iPhone or iPad and on the amazon.com page for the skill.

That meant we needed to create those as intents, which we did.

BUT we can't use them.

the three for Space Flight Fun Facts are:

Alexa Ask Space Flight Fun Facts

Open Space Flight Fun Facts

Please share a Space Flight fun Facts

The first two work but "Please share" does not.

And none of the 30 other sample utterances I shared on the Interaction Model / GetNewFactIntent are usable.

WHY?!?!?!

Mike

0 Likes 0 ·
MikeV avatar image
MikeV answered

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

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

There are many questions here and the layout of these are pretty hard to follow, so I would suggest that you check out our launch sample here to see if you can get that working seeing as you are using the new skill builder tool. See here.

10 |5000

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

MikeV avatar image
MikeV answered

Jamie,

Apologies for the delay... we took Alexa/ECHO with us on a family vacation to Wyoming. Great trip. Good to have Alexa with us... challenge... when a hotel resets the wifi password overnight you lose the Alexa connection and your wake up alarm = need a better solution.

Thank you for the new skill builder tool link.

I went to the new skill builder tool and the cookbook link - https://github.com/alexa/alexa-cookbook/blob/master/handling-responses/dialog-directive-delegate/speech-assets/InteractionModel.json - is broken on both the "1. Voice User Interface" & "2. Lambda Function" pages... both provide a 404 Not Found error.

Q1: Thoughts?

Returning to our discussion...

NextIntent...

Thank you for confirming that my list of Next Intents look good.

I have entered them all in my Space Flight Fun Facts skill.

And thanks for the perspective of interrupting Alexa, but I don't want to invoke them by interrupting Alexa.

I want Alexa to state a fact from the Lambda function, and pause and ask "Do you want another fact?"

How to do this?

Q2: Perhaps, better to ask... WHERE to do this, in the Lambda function?

If so HOW?!?

It seems like it should be in the GetFact's var SpeechOutput.

Q3: If so... how to get Alexa to pause for a response?

Side question: Are you and the dev team aware that, as I have shown myself more than once... I'm using the year-old (bought summer of 2016) iPad Pro 9.7" and the Lambda Console DOES NOT recognize the iPad Pro's Apple keyboard AT ALL... you can tap the screen and position the cursor, but cannot type to update your Lambda function. Frustrating.

Q4: There MUST be something somewhere about NextIntent, but I have not found it. Can you point me to it?

Thanks,

Mike

10 |5000

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

MikeV avatar image
MikeV answered

P.S. This editor could make it easier to read our comments if it kept the blank lines we insert between sections.

10 |5000

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

MikeV avatar image
MikeV answered

Jamie,

With regards to your Nov. 27 response...

>>

Jamie@Amazon MikeV · 8 days ago 0 Like Share

More...

So focusing on those two questions:

  1. Yup. These built-in intents are only catching utterances from your users and mapping it to them. It's up to you to provide the logic, so for example, if you're offering your user an option to pick from and they say next, you can include the AMAZON.NextIntent and cover the logic of offering another selection. For Repeat, your user may want Alexa to repeat the last response Alexa said, so you can do that by storing all of your responses such as 'lastResponse' in your session attributes, and using them in your AMAZON.RepeatIntent if your user asks for Alexa to repeat
  2. Hopefully this is answered in 1.

Thanks,

Jamie

<<

Can you understand that my entire posting, and the others relating to this, are all exactly on the point you make... "it's up to me to provide the logic" AND THAT

1) I have articulated in the other thread (https://forums.developer.amazon.com/questions/96081/alexa-skill-kit-fact-skill-nextfactintent-and-repe.html) where I think I need to add that logic

and 2) I don't know what logic to add / I don't understand what to do

and 3) I don't know where to get help beyond this forum where I cannot get an answer.

So... can you or anyone else help

1) answer the questions that I restated (per you request) in this other thread - https://forums.developer.amazon.com/questions/96081/alexa-skill-kit-fact-skill-nextfactintent-and-repe.html

2) educate me (and others) on what logic is to be added with NextIntent and RepeatIntent

?

Thanks,

Mike

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

Focusing on the content in this thread, I can only provide so much guidance without writing the skill itself. When I say you need to provide the logic, you should be able to code this on the back end in those respective intents (next/repeat). Your logic defines exactly how you want your skill to respond; not everyone will use those intents the same way.

Regardless, for the repeat intent, lets say we just want Alexa to respond with the last thing that Alexa said. The trivia sample does just this, so I'd suggest checking out how its done. The code is here; see sample below:

'AMAZON.RepeatIntent': function () {        
	this.response.speak(this.attributes['speechOutput']).listen(this.attributes['repromptText']);        
	this.emit(':responseReady');    
},

You can see that it is assigned in the 'handleUserGuess', so in the case the user does say repeat, it will repeat the last thing defined here. This is not handled internally; it is up to you to store the last response from Alexa using session attributes, and then pull them back as shown above if the user chooses the repeat intent.

For the next intent, if you just want it to say another fact, then sure; write something like the following and add it to your code, and call the relevant function:

'AMAZON.NextIntent': function () {        
	  //call getFact if you like
},

Hope this helps.

10 |5000

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