Only getting one word options from Alexa Skills Kit

I write Alexa Skill and I can only get one word parameter in my code.

Here is the scheme of intent:

{ "intents": [ { "intent": "HeroQuizIntent", "slots": [ { "name": "SearchTerm", "type": "SEARCH_TERMS" } ] }, { "intent": "HeroAnswerIntent", "slots": [ { "name": "SearchTerm", "type": "SEARCH_TERMS" } ] }, { "intent": "AMAZON.HelpIntent" } ] } 

and my sample statements:

 HeroQuizIntent quiz me HeroAnswerIntent is it {SearchTerm} 

For HeroAnswerIntent, I check the SearchTerm slot and I only get single words.

So, “Peter Parker” gives “Parker”, “Steve Rogers” gives “Rogers”, and “Tony Stark” gives “Stark”.

How to take a few words into the slot?

+7
alexa-skills-kit alexa alexa-skill
source share
3 answers

I had to change the slot type to AMAZON.LITERAL.

The trick is that in the model statements, I also had to provide several statements in order to demonstrate the minimum and maximum sizes of literals that Alex should interpret. He wins, but works.

Here's a link for it: https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/alexa-skills-kit-interaction-model-reference

0
source share

I had the same problem with my skill and that the only solution that works for my ability to use multiple words, but you need to check if these slots are empty and combine them

Target Scheme:

 { "intent": "HeroAnswerIntent", "slots": [ { "name": "SearchTermFirst", "type": "SEARCH_TERMS" }, { "name": "SearchTermSecond", "type": "SEARCH_TERMS" }, { "name": "SearchTermThird", "type": "SEARCH_TERMS" } ] }, 

Statement Example

HeroAnswerIntent is it {SearchTermFirst} HeroAnswerIntent is it {SearchTermFirst} {SearchTermSecond} HeroAnswerIntent is it {SearchTermFirst} {SearchTermSecond} {SearchTermThird}

And in the latter case, you need to put each word on a separate line in the slot definition of SEARCH_TERMS

Also, using AMAZON.LITERAL, sometimes do not miss a variable at all costs, even if you test it using a service simulator (workshop console, test tab)

+2
source share

The @Xanxir solution is specified similarly to the newer custom slot format. In this case, you simply put a few length examples in your own list of values ​​for your slot type.

0
source share

All Articles