
This tutorial is part of the Quick & Dirty series for developing a custom Alexa skill called My Zoo.
Estimated time: 15 – 20 minutes
No programming experience necessary
Overview
With this tutorial, you’ll be introduced to 3 main components of an Alexa Interaction: intents, utterances and slots using the Alexa Development Console (ADC).
Prerequisites
- Complete Part 1 (“Hello Zoo!”)
What are Intents, Utterances and Slots?
Before delving deeper into Alexa skill development, it’s important to understand the 3 basic components of an Alexa interaction. I won’t go into them too deeply here, this is a Quick & Dirty tutorial after all. So, take a few moments to read through this short overview:
When we create a custom skill, we define the words and phrases a user can say to Alexa to get the skill to do what they want (within the scope of the skill, of course). When the user says something and Alexa responds in some way, this is called in Interaction.
A single skill session may have 1 or more interactions. Each interaction goes something like this:
Interaction | Example | |
1 | The user says something | “Make the sound of a lion” |
2 | Alexa does its best to interpret what the user says | Alexa searches for the sound associated with “lion” |
3 | Alexa makes a response, which may include a prompt to start another interaction | Alexa says “Roar!” |
Together, these are called an Interaction Model. Interaction Models includes:
- Utterances – sets of likely phrases the user might say, or utter (e.g. “Make the sound of a lion”)
- Slots – variable pieces of information found in an utterance (e.g. animal = “lion”)
- Intents – the actions that fulfill the user’s request, associated with utterances, optionally with one or more slots (e.g. find the sound associated with “lion”)

In My Zoo, Alexa prompts the user for the name of an animal to initiate an interaction. You, the developer, need to teach Alexa how to interpret what the user utters, and do the right thing based on the slot value.
Intents have 2 parts: the skill’s front-end, and the back-end. Don’t worry about understanding what that means right now … we’ll walk through this step-by-step.
Tip: For more details, peruse About Voice Interaction Models, About intents, slots, and dialogs, and Create an Interaction Model for your Skill.
The Intent (Front-End)
Step 1: Create Intent
Create an intent named CaptureAnimal.
- Log into the Alexa developer console and open My Zoo.
- Click Build near the top of your ADC screen.
- Click Interaction Model on the left column.
- Click Intents on the left column.
Notice (at least) 5 intents already listed on the right-hand side. These were installed automatically when you created your skill. We’ll leave these alone for now. - Click Add Intent.
- In the Create custom intent field, enter
CaptureAnimal
(all one word).

- Click Create custom intent.
Utterances
Step 2: Add sample utterances
You created the intent in Step 1 to get Alexa to find the name of the animal in the user’s utterance, then find the right animal sound for Alexa to ‘speak’. If this isn’t clear yet, that’s ok, just keep going …
Give Alexa some example phrases that the user might utter to ask for an animal’s sound.
- In the Sample Utterances box, enter
make the sound of a lion
. - Press the plus on the right side of the box.

- Add more Sample Utterances in the same way. Don’t forget to press the plus sign each time.
Sample Utterance suggestions:
– what noise does a chicken make
– can you sound like a dog
– be a cow
– monkey
Tip: It does not matter what animal name is entered in the Sample Utterances. You can use any animal, or any word at all. The word you use is a kind of placeholder. Or, in Alexa terms, a Slot (which you’ll be creating in the next Step.)
- Click Save Model.

Slots
Step 3: Add slots
Slots are variables. They are the bits of information used to determine what response to give the user (e.g. which sound to make.) If you look at the Sample Utterances you created in the previous Step, note the word(s) that represent the variables. These are the slots. In our case, the various names of animals are the variables. You’ll need to create just 1 slot type: animal.
- Double-click on the first utterance’s slot word (e.g. “monkey”).
- Since you have not created an animal slot yet, do it now: in the Create a new slot box, enter
animal
then click Add.

- Notice “monkey” is now replaced with “{animal}”.
- Update the rest of the Sample Utterances in the same way (double-click the animal word, click the ‘animal’ slot.)

Step 4: Assign a type to {animal} slot
Each slot needs a slot type.
- Scroll down and find the Intent Slots section. “animal” is listed, but it does not have a Slot Type.
- Click Select a slot type field and choose AMAZON.animal from the drop-down list. This is a ‘built-in’ slot type. Be aware that you may want to create a custom slot type for various reasons. But, for now, let’s just use the built-in.
- Click Save Model at the top of the page.

Step 5: Make slot required
Make the “animal” slot required so we can enable Dialog Delegation (don’t worry about what this means right now.)
- From the Intent Slots section, click “animal”.
- Find Slot Filling – Is this slot required … and toggle it “on”.
- In the Alexa speech prompts field, enter
Which animal do you want to hear?
. - Double-click on “animal”, which you just entered in the prompts field.
- Under Select an Existing Slot, click “animal”.
- Click the plus sign (very important!)

- Click Save Model at top of page.
- Click Build Model (may take a couple minutes … the more complex the Skill, the longer builds take.)
Step 6: Test
- Click Test on the top menu bar.
- Enter
my zoo
in the micfield.
- At this point, Alexa does not prompt for an animal name since we haven’t added a prompt yet. I know … that doesn’t seem right. Didn’t we just add what looked like a prompt in the previous step (“Which animal do you want to hear?”)?? Ignore the lack of prompting from Alexa for now. Just test one of your Sample Utterances anyway …

If Alexa responds with “You just triggered CaptureAnimal”, celebrate! Your Intent front-end build is successful.
At this point, the CaptureAnimal Intent exists only on the front-end, which is why Alexa says “You just triggered CaptureAnimal” (a default message when the back-end doesn’t exist.) We’ll create the intent‘s back-end logic in next part of this Tutorial Series.
But first, let’s add a prompt by updating the back-end code.
Add Prompts
Step 7: Add a prompt
- Click Code on the top menu bar.
- You should see a bunch of code in the editor on the right part of your screen. Find this line:
class
LaunchRequestHandler(AbstractRequestHandler)
- About 8 lines down from there, find this line (it should look familiar if you did Part 1 of this tutorial series):
speak_output = "Welcome to My Zoo, I make animal sounds!
” - Add a prompt to the end of your welcome message. For example:
speak_output = "Welcome to My Zoo, I make animal sounds! What animal do you want to hear?"
- Click Save button near top-right of screen.
- Click Deploy to make the changes take affect. This may take a minute.
Step 8: Test
Tip: You may find it easier to have 2 ADC browser windows open: 1 dedicated for testing, the other for making updates to the skill. Remember to refresh the ‘test’ browser window after making a skill update.
- Click Test on the top menu bar.
- Enter
my zoo
in the micfield.
- You should now hear/see your new prompt. What happens if you utter an animal that does not exist?

Remember when you assigned AMAZON.animal type to the {animal} slot in Step 4? When you did that, you instructed Alexa to verify animal (slot) values against AMAZON’s list of animals. If the user then asks for a non-existing animal, Alexa will not invoke the CaptureAnimal intent. Instead, Alexa will simply prompt again.
Wouldn’t it be nicer if Alexa explained that the animal doesn’t exist? Let’s make that happen with a re-prompt.
Step 9: Add a re-prompt
- Click Code on the top menu bar.
- Find the
speak_output =
line you updated in Step 7. - After it, add this line of code:
reprompt = "I do not know that one. What other animal do you want to hear?"
- About 5 lines down, look for
.ask(speak_output)
. Change it to.ask(reprompt)
The block of code should now look like this:
class LaunchRequestHandler(AbstractRequestHandler): """Handler for Skill Launch.""" def can_handle(self, handler_input): # type: (HandlerInput) -> bool return ask_utils.is_request_type("LaunchRequest")(handler_input) def handle(self, handler_input): # type: (HandlerInput) -> Response speak_output = "Welcome to My Zoo, I make animal sounds! What animal do you want to hear?" reprompt = "I do not know that one. What other animal do you want to hear?" return ( handler_input.response_builder .speak(speak_output) .ask(reprompt) .response )
- Click Save button near top-right of screen.
- Click Deploy, and wait for it to finish.
Step 10: Test
- Click Test, and enter
my zoo
. - Enter a non-existing animal. You should now hear/see the new re-prompt.
- Try an existing animal to trigger CaptureIntent.

Phew! That was a lot of steps!
Conclusion
Congratulations! You’ve successfully added CaptureIntent on the front-end, defining the associated Sample Utterances and Slot value types.
Continue to Create a Custom Alexa Skill, Part 3 (Code an Intent), to add CaptureIntent logic on the back-end. This is where you tell Alexa which sound to make depending on which animal the user uttered. The fun just keeps on coming, right?!
As always, thank you for visiting my blog. If you have corrections or suggestions for this tutorial series, please add a comment below.
Related Resources
Alexa Skill Kit (ASK) (official Alexa documentation)
Create Intents, Utterances, and Slots (official Alexa documentation)
Leave a Reply