Search code examples
alexa-skills-kitalexa-slot

Single term answer to Alexa Skill


Background

I'm writing an Alexa Skill and looking to get pieces of information from the user.

The following conversation for example:

Alexa: What month were you born at?
User: April
Alexa: Good. And what was your favorite movie?
User: April

The problem

Given the following utterances:

GetMonthIntent {month}
GetMovieIntent {movie}

Once a user answers April for the second time, the GetMonthIntent might be triggered.

What I have tried

Asking the user to specify which piece of information is giving by using the following utterances:

GetMonthIntent Month {month}
GetMovieIntent Movie {movie}

The question

What is the right way to make Alexa wait for a single term answer based on the current context?


Solution

  • Unfortunately, there is no solution. There is no way to specify the 'context' in which a user reply should be interpreted, so you have to tell the user "what was your favorite movie? Please say 'my favorite movie is' and then the name of the movie".

    Here are two ASK feature requests that I think would address your issue:
    https://forums.developer.amazon.com/content/idea/41062/creating-something-to-help-with-more-structured-qu.html
    https://forums.developer.amazon.com/content/idea/55525/allow-a-response-to-specify-a-set-of-expected-inte.html

    Personally I think this is fairly important so I voted for those, but they are not near the top.