An Alexa skill has two basic pieces:
- A skill services
- A skill interface
The skill service is where the logic is held. For our calculator, the skill service is responsible for handling events, running the computations and returning the answer. For this tutorial, we will create our skill service using Node.JS and AWS Lambda.
Why Node.JS? The short answer: I've been working with it on a few other project lately. I was actually torn between using Node.JS or Python.
The skill interface translates what a user says into events, which are then sent to the skill service for processing. For this tutorial, we will be using the Alexa Skill Builder tool, currently in beta.
Utterances Intent
- Sign in to the Amazon Developer Portal
- Select "Alexa" from the top menu bar.
- Under "Alexa Skills Kit", click the "Get Started" button
- Click the "Add New Skill" button
- Enter skill information then click the "Save" button
- After it saves, click the "Next" button.
- We are going to build the interaction model using the Skill BuilderClick the "Launch Skill Builder Beta" button. More information about the Skill Builder service (in Beta at the time of this writing) is available here. When prompted, choose "Discard".
- Add a new intent. Our first intent will be a greeting. This intent will be triggered when a user says "Alexa, open percent calculator".
- Save your model.
- Sign in to AWS at https://aws.amazon.com/.
- Choose "Lambda"
- Select the "Alexa Fact" blueprint. This makes it easier to get setup since there are some external libraries needed.
- Choose "Alexa Skills Kit" as a trigger. This will take care of permissions.
- Enter code
- Role: Create custom role
- At the role pop-up screen, click the "Allow" button
- Choose "Next" then click "Create function" button
- Copy the Amazon Resource Name (ARN) displayed in the upper-right corner of the console that starts with arn:aws:lambda....
- Alexa Skills Portal > Configuration: Update your endpoint
New to developing on Alexa (or anything for that matter) - is there sample code for the calculator? The directive of "enter code" is throwing me off as I'm not sure what to do with it.