Search code examples
alexa-skills-kitamazon-echo

Custom slot for StartOverIntent


How to set up slots with AMAZON.StartOverIntent utterance?

Ex: I want to start the skill with a custom slot value as in Alexa, ask <my skill> the definition of <custom value>

I read that AMAZON.StartOverIntent cannot have custom slot so I broke it like this:

DefIntent {Term}
AMAZON.StartOverIntent the definition of
AMAZON.StartOverIntent define
AMAZON.StartOverIntent what is

That doesn't seem to work when I test it with Echo. How do you go about declaring such utterance?


Solution

  • Why are you trying to override StarOverIntent? The normal way to do things is to use your own intents. You only need to use the built in intents if you want to. And, even then, it is just a short cut. You still have to implement them. They don't actually come with in built in functionality.

    For what you want, you can declare the following intent:

    {
       "intents":[
          {
             "intent":"DefIntent",
             "slots":[
                {
                   "name":"term",
                   "type":"TERM"
                }
             ]
          }
        ]
    }
    

    This creates one intent with one slot which is a custom type TERM. You can create the list of terms you want to look up in plan text file and upload it as the values for that custom type. You can then declare utterances:

    DefIntent the definition of {term}
    DefIntent define {term}
    DefIntent what is {term}
    

    That should give you what you want.

    Or close to what you want. I imagine you want the user to be able to say anything at all for {term}. But Alexa is not a dictation machine. It doesn't work that way. It expects a moderately restrictive vocabulary in order to produce the highest quality recognition.

    You can fake it out, by providing a custom list with a hundred thousand words in it. Or other techniques to create a "generic slot". But it will not perform with a high quality of recognition. You are better off re-thinking your design so that you don't need generic dictation.

    For a fully worked, complex example of an Alexa skill, with nearly an hour of video, see SubWar.