Amazon Alexa Skills: Post 4 - Test your skill on Alexa
This post is a continuation of a series of posts describing how to create a custom skill for the Alexa Voice System (AVS). The posts in this series are:
1. Overview and prerequisites.
2. How to set-up your development environment.
3. How to develop a custom skill.
4. How to test your skill on an Alexa-enabled device (this post).
5. How to successfully certify your skill.
All the source code for this project can be found on Github.
In this post we're going to run through how to set-up your skill and configure it in the Amazon Developer Portal and run through a test on our Alexa-enabled device.
Setting up the Skill
As mentioned at the beginning of this series of posts, we need to configure a web service to host and execute the code for our skill. In my case I'm going to use AWS Lambda because it's quick, easy, scalable and inexpensive for what I need.
All we need to do here is to create a new Lamnda function and upload the code from the "alexa-app-server\examples\apps\whoisright" folder we've been using to test the skill.
For those unfamiliar with AWS see the AWS documentation on Lambda.
Configuring the Skill
First we need to log into the Amazon Developer Portal. If you're not signed up please go back to the pre-requisites in the first post of this series.
Once logged in, select Alexa from the top menu and click Get Started on the Alexa Skills Kit box (see below).
Now you should see the Building Alexa Skills with the Alexa Skills Kit page. In here click Add a New Skill. The configuration wizard is split into seven sections as follows:
- Skill Information
- Interaction Model
- SSL Certificate
- Publishing Information
- Privacy & Compliance
Please Note: When entering the configuration wizard you can specify multiple languages and enter configuration information specifically for each language.
For our sample skill we're going to choose Custom Interaction Model. I've not investigated the other options yet, but to find out more you can click the Learn More link.
Language Select a language. I've picked English (U.K).
Name This is the name the skill will have when in the Alexa skill store.
Invocation Name Here we set the words used to invoke the skill. I would advise giving this step some serious thought as you need something that's quick and easy to say, easy for Alexa to understand and something that correctly describes your skill.
Audio Player Again, I've not investigated this but I selected No as my skill doesn't have any audio control capabilities.
- Intent Schema Here we add the JSON schema of our intents. Fortunately we don't have to generate this ourselves as we can go back to the Alexa-App Server we've been running locally and pull the schema from that (see below).
Custom Slot Types Custom slot types are used to identify the value of the word in the intent slots (see the slots value in the Intent Schema. In my case I've added a list of names to make it easier for Alexa to match what's said in the FirstPerson and SecondPerson slots to an actual name.
Sample Utterances Again these can be taken from the Alexa-App server test page for our skill. For reference they're generated from the code entered in
Service Endpoint This is where we specify the link to the service that's hosting our code. In my case I set-up a Lambda function in AWS so I select that option and specify the ARN (Amazon Resource Name). Finally I pick a region that's closest to the users (in this case Europe).
Account Linking Users of this skill don't need to create an account, so we select No here.
On this page we can enable our skill for testing on the Alexa-enabled device. You can also specify sample test and view the JSON response. This verifies that we're hooked up correctly to the Lambda function.
Once you save your settings your skill will now be considered "In Development". This means you'll be able to test it on your Alexa-enabled device. Have fun!
In the next post we'll cover the final configuration steps to apply for certification and a few short tips on some changes I had to make to get my skill to be accepted.