Skip to content

Skylark95/alexa-skill-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Alexa Skill Demo

To view the steps from last session click here

Alexa Skill Slots

Intents can optionally have arguments called slots. Slot values are extracted from utterances and sent with the intent request. Each slot has a Variable Name (The slot name as it will appear in the intent request to your skill) and a Slot Type (Defines how data in the slot is recognized and handled).

Each group's skill has been given a slot with a variable name of name. This slot is of slot type AMAZON.FirstName.

Use the name skill slot

For this session look into using the name slot added to your skill to have your skill greet people by name. Instead of this guide walking you through step by step you'll need to look at Amazon's JavaDoc to find out how to read the name slot value.

The JavaDoc can be found at:

This link redirects to the JavaDoc above so you can type less:

Here's a few hints:

  • The handle method of HelloWorldIntentHandler has an input argument.
  • We should be able to get an IntentRequest from the input (You may have to class cast)
  • The Slot may be found on an Intent which you can get from an IntentRequest

Running the skill

Once you have modified the skill, build the jar (Visual Studio Code Command Pallete (Ctrl +Shift +P) and select Tasks: Run Build Task) and upload it to your lambda, replacing the source code.

Now to run the skill with your changes you can ask Alexa:

  • "ask {group name} to say hi to {name}"

Resources