how to create a custom skill

58
Create a Custom Skill on the Amazon Echo Emily Lam, DeveloperWeek 2/13/2017

Upload: emily-hong-lam

Post on 22-Jan-2018

279 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: How to Create a Custom Skill

Create a Custom Skill on the Amazon Echo

Emily Lam, DeveloperWeek 2/13/2017

Page 2: How to Create a Custom Skill

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

Page 3: How to Create a Custom Skill

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

Page 4: How to Create a Custom Skill

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/

Page 5: How to Create a Custom Skill

Click on Alexa

https://developer.amazon.com/

Page 6: How to Create a Custom Skill

Click on Get Started > under the Alexa Skills Kit

https://developer.amazon.com/

Page 7: How to Create a Custom Skill

Click on “Add a New Skill”

https://developer.amazon.com/

Page 8: How to Create a Custom Skill

https://developer.amazon.com/

Page 9: How to Create a Custom Skill

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/

Page 10: How to Create a Custom Skill

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/

Page 11: How to Create a Custom Skill

Interaction Model

u  Intent Schema: A JSON structure which declares the set of intents your service can accept and process.

https://developer.amazon.com/

Page 12: How to Create a Custom Skill

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

Page 13: How to Create a Custom Skill

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/

Page 14: How to Create a Custom Skill

Configuration Select AWS Lambda ARN (Amazon Resource Name) and then North America.

https://developer.amazon.com/

Page 15: How to Create a Custom Skill

Go to https://aws.amazon.com Sign in to the Console

https://aws.amazon.com/

Page 16: How to Create a Custom Skill

Sign In or Create an AWS Account

https://aws.amazon.com/

Page 17: How to Create a Custom Skill

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/

Page 18: How to Create a Custom Skill

Type in Lambda and select the Lambda option

https://aws.amazon.com/

Page 19: How to Create a Custom Skill

Select Create a Lambda function

https://aws.amazon.com/

Page 20: How to Create a Custom Skill

Type Alexa in the filter and then select alexa-skill-kit-sdk-triviaskill

https://aws.amazon.com/

Page 21: How to Create a Custom Skill

Click on the gray square

https://aws.amazon.com/

Page 22: How to Create a Custom Skill

Select Alexa Skills Kit and then Next

https://aws.amazon.com/

Page 23: How to Create a Custom Skill

Type in a function name

https://aws.amazon.com/

Function name must contain only letters, numbers, hyphens, or underscores.

Page 24: How to Create a Custom Skill

Click on the dropdown menu and select Create a custom role

https://aws.amazon.com

Page 25: How to Create a Custom Skill

Click on “Allow”

https://aws.amazon.com

Page 26: How to Create a Custom Skill

Click on “Next”

https://aws.amazon.com

Page 27: How to Create a Custom Skill

Click on “Create function”

https://aws.amazon.com

Page 28: How to Create a Custom Skill

Click on “Test” and look at the execution result

https://aws.amazon.com

Page 29: How to Create a Custom Skill

Click on “Actions and then “Export function”

https://aws.amazon.com

Page 30: How to Create a Custom Skill

Click on “Download deployment package”

https://aws.amazon.com

Page 31: How to Create a Custom Skill

Edit index.js and question.js

https://aws.amazon.com

Page 32: How to Create a Custom Skill

Select the two files + node_modules and compress the 3 items.

https://aws.amazon.com

Page 33: How to Create a Custom Skill

Upload Archive.zip

https://aws.amazon.com

Page 34: How to Create a Custom Skill

Click Save and test

https://aws.amazon.com

Page 35: How to Create a Custom Skill

Copy the ARN

https://aws.amazon.com

Page 36: How to Create a Custom Skill

Paste the ARN in your skill at https://developer.amazon.com and the select “Next”

https://developer.amazon.com

Page 37: How to Create a Custom Skill

Select a Category and Subcategory if necessary Then, write in testing instructions.

https://developer.amazon.com

Page 38: How to Create a Custom Skill

Write a short description (160 character max.) about the skill

https://developer.amazon.com

Page 39: How to Create a Custom Skill

Write a full description that will appear in the skill’s detail card

https://developer.amazon.com

Page 40: How to Create a Custom Skill

Write up to three example phrases that appear as aids for users when they see your skill’s detail card.

https://developer.amazon.com

Page 41: How to Create a Custom Skill

Answer privacy related questions and export compliance

https://developer.amazon.com

Page 42: How to Create a Custom Skill

Click “Submit for Certification” and you are done!

https://developer.amazon.com

Page 43: How to Create a Custom Skill

In-depth Topics

u  Built-in and Custom slots

u  Account linking

u  SSML Tags

Page 44: How to Create a Custom Skill

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.

Page 45: How to Create a Custom Skill

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.

Page 46: How to Create a Custom Skill

Custom Slots

You create a slot type (ie LIST_OF_INCIDENTS) and then you write the values.

Page 47: How to Create a Custom Skill

Custom Slots

You reference the intent and slot name in the Sample Utterances

Page 48: How to Create a Custom Skill

Custom Slots

You can use the value of the custom slot in your lambda code.

Page 49: How to Create a Custom Skill

Account linking

You can link an external account to the Alexa.

Page 50: How to Create a Custom Skill

Account linking

You create an application and link it to Alexa through the Alexa app.

Page 51: How to Create a Custom Skill

Account linking

The client id and client secret are retrieved from the external account

Page 52: How to Create a Custom Skill

Account linking

Page 53: How to Create a Custom Skill

Account linking

Token: 59010bf8-4a29-4f59-8bd7-3a59ac383781 Redirects back to https://pitangui.amazon.com/api/skill/link/M1PJIQE7PVNV1

Page 54: How to Create a Custom Skill

Account linking

Token: 59010bf8-4a29-4f59-8bd7-3a59ac383781 Redirects back to https://pitangui.amazon.com/api/skill/link/M1PJIQE7PVNV1

Page 55: How to Create a Custom Skill

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)

Page 56: How to Create a Custom Skill

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

Page 57: How to Create a Custom Skill

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

Page 58: How to Create a Custom Skill

Thank you!

Questions? Tweet me @hongily Email me at [email protected]