This is part of a the Alexa Skill Demo series for Normal Community High School State Farm STEM Program. To view the steps from last session click here.
Alexa Skill Slots Link to heading
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
Link to heading
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 ofHelloWorldIntentHandler
has aninput
argument. - We should be able to get an
IntentRequest
from theinput
(You may have to class cast) - The
Slot
may be found on anIntent
which you can get from anIntentRequest
Running the skill Link to heading
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}”