how to create a custom skill
TRANSCRIPT
Create a Custom Skill on the Amazon Echo
Emily Lam, DeveloperWeek 2/13/2017
About Me
u Emily Lam
u UCLA: Linguistics and specialization in Computing
u Currently: Frontend developer at Lieberman Software
u Skills published: 4
u Hackathons won using Alexa: 3
u Money 20/20 WorldPay
u 2nd Mojio Connected Car
u 1st GA + IBM Watson Workspace
Twitter: @hongily
https://liebsoft.com
Agenda
u 1. Walk you through how to create a basic trivia skill
u 2. Discuss In-depth Topics
u Built-in and Custom slots
u Account linking
u SSML Tags
Sign into https://developer.amazon.com/ This is the same account that you use to sign into www.amazon.com. Don’t have an Amazon account? You can create one after you click “Sign In”.
https://developer.amazon.com/
Click on Alexa
https://developer.amazon.com/
Click on Get Started > under the Alexa Skills Kit
https://developer.amazon.com/
Click on “Add a New Skill”
https://developer.amazon.com/
https://developer.amazon.com/
Skills Information
u Skill Type
u Custom Interaction Model: Gives you the most control over the user’s experience and is the most flexible kind of skill you can build.
u Smart Home Skill API: Great for building a skill with smart home devices
u Flash Briefing Skill API: Easy for creating flash briefings/RSS feed
u Language
u You can choose English (U.S.), English (U.K.), or German
https://developer.amazon.com/
Skills Information u Name
u Appears as the title in the Alexa app. Ex. Morning Dose App Name
u Must be between 2-50 characters.
u Invocation Name
u The name you use to tell Alexa to open the skill. Ex. Morning Dose. See Invocation Guidelines.
u Global Fields
u Audio Player for music related skills ie. Spotify
https://developer.amazon.com/
Interaction Model
u Intent Schema: A JSON structure which declares the set of intents your service can accept and process.
https://developer.amazon.com/
Interaction Model u Intent Schema: A JSON structure which declares the set of intents your service
can accept and process.
https://developer.amazon.com/
u https://github.com/alexa/skill-sample-nodejs-trivia/tree/master/speechAssets
Interaction Model u Custom Slots: Custom slot types to be referenced by the Intent Schema and
Sample Utterances
u Sample Utterances: What you say to Alexa to trigger an intent
https://developer.amazon.com/
Configuration Select AWS Lambda ARN (Amazon Resource Name) and then North America.
https://developer.amazon.com/
Go to https://aws.amazon.com Sign in to the Console
https://aws.amazon.com/
Sign In or Create an AWS Account
https://aws.amazon.com/
Select US East (N. Virginia) for US skills and EU (Ireland) for UK/DE skills These are the only two regions currently supported for Alexa skill development on AWS Lambda
https://aws.amazon.com/
Type in Lambda and select the Lambda option
https://aws.amazon.com/
Select Create a Lambda function
https://aws.amazon.com/
Type Alexa in the filter and then select alexa-skill-kit-sdk-triviaskill
https://aws.amazon.com/
Click on the gray square
https://aws.amazon.com/
Select Alexa Skills Kit and then Next
https://aws.amazon.com/
Type in a function name
https://aws.amazon.com/
Function name must contain only letters, numbers, hyphens, or underscores.
Click on the dropdown menu and select Create a custom role
https://aws.amazon.com
Click on “Allow”
https://aws.amazon.com
Click on “Next”
https://aws.amazon.com
Click on “Create function”
https://aws.amazon.com
Click on “Test” and look at the execution result
https://aws.amazon.com
Click on “Actions and then “Export function”
https://aws.amazon.com
Click on “Download deployment package”
https://aws.amazon.com
Edit index.js and question.js
https://aws.amazon.com
Select the two files + node_modules and compress the 3 items.
https://aws.amazon.com
Upload Archive.zip
https://aws.amazon.com
Click Save and test
https://aws.amazon.com
Copy the ARN
https://aws.amazon.com
Paste the ARN in your skill at https://developer.amazon.com and the select “Next”
https://developer.amazon.com
Select a Category and Subcategory if necessary Then, write in testing instructions.
https://developer.amazon.com
Write a short description (160 character max.) about the skill
https://developer.amazon.com
Write a full description that will appear in the skill’s detail card
https://developer.amazon.com
Write up to three example phrases that appear as aids for users when they see your skill’s detail card.
https://developer.amazon.com
Answer privacy related questions and export compliance
https://developer.amazon.com
Click “Submit for Certification” and you are done!
https://developer.amazon.com
In-depth Topics
u Built-in and Custom slots
u Account linking
u SSML Tags
Built-in Slots and Custom Slots
Slots are arguments for intents.
A built-in slot type such as AMAZON.NUMBER converts numeric words (“five”) into digits (such as “5”).
You can view all the built-in slots at: https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/built-in-intent-ref/slot-type-reference
A custom slot type is used for items that are not covered by Amazon’s built-in set of types.
Built-in Slots and Custom Slots
"intents": [
{
"intent": "ReportIntent",
"slots": [
{
"name": "Incident",
"type": "LIST_OF_INCIDENTS"
}]
}
You define the slot type in the Intent Schema.
Custom Slots
You create a slot type (ie LIST_OF_INCIDENTS) and then you write the values.
Custom Slots
You reference the intent and slot name in the Sample Utterances
Custom Slots
You can use the value of the custom slot in your lambda code.
Account linking
You can link an external account to the Alexa.
Account linking
You create an application and link it to Alexa through the Alexa app.
Account linking
The client id and client secret are retrieved from the external account
Account linking
Account linking
Token: 59010bf8-4a29-4f59-8bd7-3a59ac383781 Redirects back to https://pitangui.amazon.com/api/skill/link/M1PJIQE7PVNV1
Account linking
Token: 59010bf8-4a29-4f59-8bd7-3a59ac383781 Redirects back to https://pitangui.amazon.com/api/skill/link/M1PJIQE7PVNV1
Account linking
A privacy policy is required for account linking. You also have to disclose if you are collect users' personal information (ie email, password, etc)
SSML Tags Speech Synthesis Markup Language provides additional control over how Alexa generates the speech text in your response. Examples: <say-as interpret-as="cardinal">12345</say-as> sounds like twelve thousand three hundred forty five <say-as interpret-as=”ordinal">12345</say-as> sounds like twelve thousand three hundred forty fifth <say-as interpret-as="spell-out">12345</say-as> sounds like one two three four five Reference: https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/speech-synthesis-markup-language-ssml-reference#supported-ssml-tags
SSML Tags Speech Synthesis Markup Language provides additional control over how Alexa generates the speech text in your response. Examples: <say-as interpret-as="cardinal">12345</say-as> sounds like twelve thousand three hundred forty five <say-as interpret-as=”ordinal">12345</say-as> sounds like twelve thousand three hundred forty fifth <say-as interpret-as="spell-out">12345</say-as> sounds like one two three four five Reference: https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/speech-synthesis-markup-language-ssml-reference#supported-ssml-tags
Thank you!
Questions? Tweet me @hongily Email me at [email protected]