Bring It All Together and Test It
So far on our journey, we have:
- Created a skill in the Amazon Developer Portal.
- Defined a voice user interface for our skill using the Skill Builder.
- Created and tested an AWS Lambda function to power our skill.
Finally, we now connect our skill to our Lambda function and then actually test it on an Echo device. Don’t have one? Don’t worry, we’ve got you covered.
- Go back to the Amazon Developer Portal and select Edit to open your skill from the list.
- Click Endpoint from the menu on the left side.
- For Service Endpoint Type, choose AWS Lambda ARN. Note that you can link to any HTTPS endpoint, but for now we use the AWS Lambda function we just created.
- Paste your Lambda’s ARN from the previous unit into the Default Region textbox.
- Click Save Endpoints.
- Select Test to proceed with testing of the skill.
You should now be in the Testing tab of the Amazon Developer Portal. There are a few ways for us to actually validate the skill is working the way we want before testing it live on a device.
At the top of the page, you should see an option to enable testing on your account. By selecting this option, any devices associated with the account you used to log in to the Developer Portal automatically have this skill enabled. Select Development.
Don’t worry, no one else can see the skill yet, but you can invoke it just like any other skills you enabled.
Before we get to device testing, there are a few extra features to help with testing.
To validate that your skill is working as expected, use the Alexa Simulator. This passes in the utterance you provide to your skill as if that’s what Alexa heard.
Let’s try it now by entering open space facts in the Enter Utterance text box. Now try other utterances, like ask space facts for a fact.
This text box lets you enter compatible Speech Syntax Markup Language (SSML) tags to hear how Alexa says the contents. This can be helpful to see how Alexa talks in order to tweak a skill response without needing to modify your Lambda function. Check out the SSML reference documentation for the whole list of possible options.
To see how this works, try some of the following examples by pasting each line directly into the text box, then click Play.
- <speak>This is my normal voice. <amazon:effect name="whispered">This is my 6-inches away voice.</amazon:effect></speak>
- <speak>This is my normal volume. <prosody volume="x-loud">This is me turning up the volume to 11</prosody>. <prosody rate="x-slow">Here I am, speaking slowly</prosody>. <prosody pitch="x-high"> What do you think about my high-pitch voice? </prosody></speak>
- <speak>For a countdown, do you want it like this, <say-as interpret-as="cardinal">54321</say-as>, or do you prefer, <say-as interpret-as="digits">54321</say-as>?</speak>
- <speak>Speechcons let me say special words like, <say-as interpret-as="interjection">bazinga!</say-as>, and, <say-as interpret-as="interjection">cowabunga</say-as>.</speak>
Now that we’ve had a chance to play around with the testing features of the Developer Portal, let’s test on a real device.
If you don’t have a physical device, Echosim.io is a community project that allows you to use an Echo in your web browser. Simply log in with your Amazon account that you used for the Developer Portal, and you can use this virtual Echo device as if it was an Echo sitting next to you. Note: You need a microphone attached to your computer; click the microphone icon on the page to use it.
With your device or Echosim.io, try some of these utterances and see how your skill reacts.
- Alexa, open space facts.
- Alexa, ask space facts for a fact.
- Alexa, give me trivia from space facts.
Although you have a working skill, the skill isn’t yet available in the Alexa Skills Store. In order to do that, you need to follow the publication and certification process.
We’re not going to walk through this process now, but for more information on how to complete this process, check out this Alexa Developer blog post to avoid common pitfalls and refer to the official documentation for comprehensive information to get through certification.
You’ve done it! A functional, end-to-end skill to educate you on some space facts.
By using the tools and processes we’ve covered, such as learning how to design and build voice user interfaces and how to customize your Lambda function, you can change the skill to be relevant for any facts or information of your choosing. Then, all you need to do is change the invocation name to make more sense for your facts. Then follow the certification checklist, and you can certify and publish your own skill in no time at all.
If space facts aren’t your fancy, your imagination is the limit. We can’t wait to see what new and innovative skills you come up with.
- Find more tutorials to learn more ways to use Alexa: https://developer.amazon.com/alexa-skills-kit/tutorials
We won't check any of your setup. Click Verify Step to earn your badge.