Creéz votre première Skill Alexa sur AWS
Sébastien Stormacq
Manager, Alexa Solution Architecture, EU @ sebsto
1 9 7 0 s 1 9 8 0 s 1 9 9 0 s P R E S E N T2 0 0 0 s
This Magic Moment
Character Mode
GUI
Web
Mobile
VUI
Voice represents the
next major disruption
in computing
W E B E L I E V E :
Comprised of two important frameworks that enable brands to connect to customers
Lives In The Cloud
Automated Speech
Recognition (ASR)
Natural Language
Understanding (NLU)
Always Learning
Alexa’s Framework
Comprised of two important frameworks that enable brands to connect to customers
Lives In The Cloud
Automated Speech
Recognition (ASR)
Natural Language
Understanding (NLU)
Always Learning
ALEX A
V O ICE
SERV ICE
Unparalleled Distribution:
AVS allows your content
to be everywhere
Alexa’s Framework
A L E X A - E N A B L E D D E V I C E S
Comprised of two important frameworks that enable brands to connect to customers
ALEX A
V O ICE
SERV ICE
Unparalleled Distribution:
AVS allows your content
to be everywhere
Lives In The Cloud
Automated Speech
Recognition (ASR)
Natural Language
Understanding (NLU)
Always Learning
ALEX A
SKILLS
KIT
Create Great Content:
ASK is how you connect
to your consumer
Alexa’s Framework
Alexa Skills Store
(Desktop & Mobile)
Alexa App
(Desktop & Mobile)
Or just ask Alexa!
Where and How to find Skills ?
Custom
For crafting unique
app experiences
Smart Home
For controlling smart
home and devices
Flash Briefing
For providing flash
briefing content (either
audio, video or text)
“Alexa, allume la
cuisine”
“Alexa, quel est mon
flash quotidien ?”
“Alexa, demande à
Marmiton une recette
de crêpes.”
Voice User Interface Programming Logic
+
developer.amazon.com aws.amazon.com
(could be hosted anywhere)
Back-EndFront-End
Alexa Skills Kit
Request
Audio
Response
Your Service
Text to Speech
Machine Learning
Natural Language Understanding
Speech Recognition
Cards
Wake word
detection
Beam forming
Cards
Your Service
Request
Alexa Skills Kit: Signal Processing
Text to Speech
Machine Learning
Natural Language Understanding
Speech Recognition
Response
Alexa
wake
word
S p e a k w i t h A l e x a
Alexa Skills Kit: Utterances Into Intents
Your Service
Cards
Utterances
Intents
Text to Speech
Machine Learning
Natural Language Understanding
Speech Recognition
Response
Alexa, ouvre mon restaurant
wake
word
Invocation namelaunch
S p e a k w i t h A l e x a
démarre
commence
lance
allume
mets
Alexa, demande à mon restaurant une suggestion pour le déjeuner
wake
word
Invocation namelaunch
S p e a k w i t h A l e x a
utterance
une recommendation pour le midi
un bon endroit pour manger
la meilleure place pour déjeuner
Alexa, ouvre mon restaurant
wake word invocation namelaunch
S p e a k w i t h A l e x a
Recommande-moi un restaurant avec quatre kilometres de marche
slot
utterance
RecommendationIntent
{distance: “4”}
slot value
intent
Alexa Skills Kit: Requests and Responses
Your Service
Cards
Audio
Intents
Text to Speech
Machine Learning
Natural Language Understanding
Speech Recognition
Response
Text to Speech (SSML)
Machine Learning
Natural Language Understanding
Speech Recognition
Alexa Skills Kit: Output
Your Service
Cards
Audio
Intents
Response
Upload your code Setup your triggers Runs only when triggered
Pay only for the compute
time used!
Deploy your Back-End
AWS Lambda
Language (Interaction) Model Skill Code (Lambda Function) Skill Publish Information
Alexa Developer Portal Alexa Developer PortalAWS Console Local Code+
Skill Development
Local Code
Language (Interaction) Model Skill Code (Lambda Function) Skill Publish Information
Skill Development
alexa.design/askcli
ASK Command Line Interface
Based on Node JS
• Runs on Windows, Mac, Linux
Manage Skills Programmatically
• uses Skills Management API (SMAPI)
Deploy Skill Lambda Functions
• uses AWS CLI under the hood
alexa.design/askcli
ASK CLI != AWS CLI
Skill Manifest
CLI mapping to profile
information
Front-End
Back-End
alexa.design/nodesdk alexa.design/javaalexa.design/python
LET’S BUILD A SKILL
Persistence
• Remember: AWS Lambda maintains no state across executions
• As a Skill Builder, you therefore have two layers of memory:
Session Attributes Persistent Attributes
Expire when session ends Persist across sessions
Memory
Sessions Attributes
const attributesManager = handlerInput.attributesManager;
const sessionAttributes = attributesManager.getSessionAttributes();
/*
YOUR CODE LOGIC HERE
*/
sessionAttributes["profile"] = ...;
attributesManager.setSessionAttributes(sessionAttributes);
Connect to Amazon DynamoDB
const skillBuilder = Alexa.SkillBuilders.standard();
exports.handler = skillBuilder
.addRequestHandlers( // ... handlers )
.addRequestInterceptors( // ... request interceptors )
.addResponseInterceptors( // ... response interceptors )
.addErrorHandlers(ErrorHandler)
.withTableName("theFoodie")
.withAutoCreateTable(true)
.lambda(); Table
Fully managed
Low cost
Predictable performance
Massively scalable
Highly available
Persistent Attributes
const attributesManager = handlerInput.attributesManager;
let persistentAttributes = await attributesManager.getPersistentAttributes();
persistentAttributes.profile.allergies = "shellfish";
attributesManager.setPersistentAttributes(persistentAttributes);
attributesManager.savePersistentAttributes();
AWS-SDK to call services
Ressources
alexa.design/france Alexa Skills Kit in France
alexa.design/github
alexa.design/guide Alexa Voice Design Guide
Github Alexa
alexa.design/videotutorial Video Series : Building Alexa Skills from Scratch
alexa.design/nodesdk Main repo for the ASK NodeJS SDK
alexa.design/askcli Alexa Command Line Interface
Merci !
@ sebsto
Alexa for Developers

Alexa for Developers

  • 1.
    Creéz votre premièreSkill Alexa sur AWS Sébastien Stormacq Manager, Alexa Solution Architecture, EU @ sebsto
  • 2.
    1 9 70 s 1 9 8 0 s 1 9 9 0 s P R E S E N T2 0 0 0 s This Magic Moment Character Mode GUI Web Mobile VUI
  • 3.
    Voice represents the nextmajor disruption in computing W E B E L I E V E :
  • 4.
    Comprised of twoimportant frameworks that enable brands to connect to customers Lives In The Cloud Automated Speech Recognition (ASR) Natural Language Understanding (NLU) Always Learning Alexa’s Framework
  • 5.
    Comprised of twoimportant frameworks that enable brands to connect to customers Lives In The Cloud Automated Speech Recognition (ASR) Natural Language Understanding (NLU) Always Learning ALEX A V O ICE SERV ICE Unparalleled Distribution: AVS allows your content to be everywhere Alexa’s Framework
  • 6.
    A L EX A - E N A B L E D D E V I C E S
  • 7.
    Comprised of twoimportant frameworks that enable brands to connect to customers ALEX A V O ICE SERV ICE Unparalleled Distribution: AVS allows your content to be everywhere Lives In The Cloud Automated Speech Recognition (ASR) Natural Language Understanding (NLU) Always Learning ALEX A SKILLS KIT Create Great Content: ASK is how you connect to your consumer Alexa’s Framework
  • 9.
    Alexa Skills Store (Desktop& Mobile) Alexa App (Desktop & Mobile) Or just ask Alexa! Where and How to find Skills ?
  • 10.
    Custom For crafting unique appexperiences Smart Home For controlling smart home and devices Flash Briefing For providing flash briefing content (either audio, video or text) “Alexa, allume la cuisine” “Alexa, quel est mon flash quotidien ?” “Alexa, demande à Marmiton une recette de crêpes.”
  • 11.
    Voice User InterfaceProgramming Logic + developer.amazon.com aws.amazon.com (could be hosted anywhere) Back-EndFront-End
  • 12.
    Alexa Skills Kit Request Audio Response YourService Text to Speech Machine Learning Natural Language Understanding Speech Recognition Cards
  • 13.
    Wake word detection Beam forming Cards YourService Request Alexa Skills Kit: Signal Processing Text to Speech Machine Learning Natural Language Understanding Speech Recognition Response
  • 14.
    Alexa wake word S p ea k w i t h A l e x a
  • 15.
    Alexa Skills Kit:Utterances Into Intents Your Service Cards Utterances Intents Text to Speech Machine Learning Natural Language Understanding Speech Recognition Response
  • 16.
    Alexa, ouvre monrestaurant wake word Invocation namelaunch S p e a k w i t h A l e x a démarre commence lance allume mets
  • 17.
    Alexa, demande àmon restaurant une suggestion pour le déjeuner wake word Invocation namelaunch S p e a k w i t h A l e x a utterance une recommendation pour le midi un bon endroit pour manger la meilleure place pour déjeuner
  • 18.
    Alexa, ouvre monrestaurant wake word invocation namelaunch S p e a k w i t h A l e x a Recommande-moi un restaurant avec quatre kilometres de marche slot utterance RecommendationIntent {distance: “4”} slot value intent
  • 19.
    Alexa Skills Kit:Requests and Responses Your Service Cards Audio Intents Text to Speech Machine Learning Natural Language Understanding Speech Recognition Response
  • 20.
    Text to Speech(SSML) Machine Learning Natural Language Understanding Speech Recognition Alexa Skills Kit: Output Your Service Cards Audio Intents Response
  • 21.
    Upload your codeSetup your triggers Runs only when triggered Pay only for the compute time used! Deploy your Back-End AWS Lambda
  • 22.
    Language (Interaction) ModelSkill Code (Lambda Function) Skill Publish Information Alexa Developer Portal Alexa Developer PortalAWS Console Local Code+ Skill Development
  • 23.
    Local Code Language (Interaction)Model Skill Code (Lambda Function) Skill Publish Information Skill Development alexa.design/askcli
  • 24.
    ASK Command LineInterface Based on Node JS • Runs on Windows, Mac, Linux Manage Skills Programmatically • uses Skills Management API (SMAPI) Deploy Skill Lambda Functions • uses AWS CLI under the hood alexa.design/askcli ASK CLI != AWS CLI
  • 25.
    Skill Manifest CLI mappingto profile information Front-End Back-End
  • 26.
  • 27.
  • 28.
  • 29.
    • Remember: AWSLambda maintains no state across executions • As a Skill Builder, you therefore have two layers of memory: Session Attributes Persistent Attributes Expire when session ends Persist across sessions Memory
  • 30.
    Sessions Attributes const attributesManager= handlerInput.attributesManager; const sessionAttributes = attributesManager.getSessionAttributes(); /* YOUR CODE LOGIC HERE */ sessionAttributes["profile"] = ...; attributesManager.setSessionAttributes(sessionAttributes);
  • 31.
    Connect to AmazonDynamoDB const skillBuilder = Alexa.SkillBuilders.standard(); exports.handler = skillBuilder .addRequestHandlers( // ... handlers ) .addRequestInterceptors( // ... request interceptors ) .addResponseInterceptors( // ... response interceptors ) .addErrorHandlers(ErrorHandler) .withTableName("theFoodie") .withAutoCreateTable(true) .lambda(); Table
  • 32.
    Fully managed Low cost Predictableperformance Massively scalable Highly available
  • 33.
    Persistent Attributes const attributesManager= handlerInput.attributesManager; let persistentAttributes = await attributesManager.getPersistentAttributes(); persistentAttributes.profile.allergies = "shellfish"; attributesManager.setPersistentAttributes(persistentAttributes); attributesManager.savePersistentAttributes();
  • 34.
  • 35.
    Ressources alexa.design/france Alexa SkillsKit in France alexa.design/github alexa.design/guide Alexa Voice Design Guide Github Alexa alexa.design/videotutorial Video Series : Building Alexa Skills from Scratch alexa.design/nodesdk Main repo for the ASK NodeJS SDK alexa.design/askcli Alexa Command Line Interface
  • 36.