SlideShare a Scribd company logo
Develop Alexa SkillsDevelop Alexa Skills
for Amazon Echo with PHPfor Amazon Echo with PHP
AWS Tech Community Days, Cologne, 27/09/2017AWS Tech Community Days, Cologne, 27/09/2017
Ralf EggertRalf Eggert
CEO Travello GmbH, Trainer, Author, Coach,CEO Travello GmbH, Trainer, Author, Coach,
PHP Developer & Alexa Skill DeveloperPHP Developer & Alexa Skill Developer
Three questions!Three questions!
AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 44 fromfrom 5858
AgendaAgenda
Amazon Alexa Basics 
Prepare skill 
Why PHP?
Implement skill code
Learnings 
Amazon Alexa BasicsAmazon Alexa Basics
AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 66 fromfrom 5858
How does an Alexa request work?How does an Alexa request work?
AWS
Lambda
Function
Alexa Voice Service


AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 77 fromfrom 5858
How does an Alexa request work?How does an Alexa request work?
AWS
Lambda
Function
Alexa Voice Service

Voice Command

AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 88 fromfrom 5858
How does an Alexa request work?How does an Alexa request work?
AWS
Lambda
Function
Alexa Voice Service

Voice Command
Voice Request

AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 99 fromfrom 5858
How does an Alexa request work?How does an Alexa request work?
AWS
Lambda
Function
Alexa Voice Service

Voice Command
Voice Request
JSON Request

AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 1010 fromfrom 5858
How does an Alexa request work?How does an Alexa request work?
AWS
Lambda
Function
Alexa Voice Service

Voice Command
Voice Request
JSON Request
JSON Response
AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 1111 fromfrom 5858
How does an Alexa request work?How does an Alexa request work?
AWS
Lambda
Function
Alexa Voice Service
Text Response

Voice Command
Voice Request
JSON Request
JSON Response
AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 1212 fromfrom 5858
How does an Alexa request work?How does an Alexa request work?
AWS
Lambda
Function
Alexa Voice Service
Text Response

Voice Response
Card Response
Voice Command
Voice Request
JSON Request
JSON Response
AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 1313 fromfrom 5858
Alternative requestAlternative request
HTTPS
Endpoint
Server
Alexa Voice Service
Text Response

Voice Response
Card Response
Voice Command
Voice Request
JSON Request
JSON Response
AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 1414 fromfrom 5858
Alexa Voice Service (AVS)Alexa Voice Service (AVS)
Alexa Voice Service
Automatic
Speech
Recognition
(ASR)
Natural
Language
Understanding
(NLU)
Text
To
Speech
(TTS)
Voice
Command
Mapping
AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 1515 fromfrom 5858
Alexa Skills Kit (ASK)Alexa Skills Kit (ASK)
Alexa Skills Kit
Interaction-Model /
Skill Builder
Configuration
Publishing /
Privacy
Test
Service Simulator
Beta Test
AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 1616 fromfrom 5858
ASK OverviewASK Overview
AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 1717 fromfrom 5858
Alexa Skill BuilderAlexa Skill Builder
AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 1818 fromfrom 5858
AWS Lambda FunctionsAWS Lambda Functions
Why PHP?Why PHP?
AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 2020 fromfrom 5858
Possible solutionsPossible solutions
Compile PHP for AWS
Use supported runtime engine for AWS
Use own HTTPS endpoint server
AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 2121 fromfrom 5858
Use supported runtime engine?Use supported runtime engine?
AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 2222 fromfrom 5858
Compile PHP for AWS Lambda?Compile PHP for AWS Lambda?
https://goo.gl/N9VVvb
AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 2323 fromfrom 5858
Use own HTTPS endpoint server?Use own HTTPS endpoint server?
AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 2424 fromfrom 5858
Solution foundSolution found
Compile PHP for AWS
Use supported runtime engine for AWS
Use own HTTPS endpoint server
AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 2525 fromfrom 5858
Disadvantages own HTTPS endpointDisadvantages own HTTPS endpoint
Some dev-tools only work with Lambda (API, CLI)
Need to build own library for Alexa
Server administration
AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 2626 fromfrom 5858
Advantages own HTTPS endpointAdvantages own HTTPS endpoint
Use any software you want
Full control over server environment
Privacy concerns (soft concern)
AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 2727 fromfrom 5858
Open-source PHP libraryOpen-source PHP library
https://github.com/travello-gmbh/
AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 2828 fromfrom 5858
My current tech stackMy current tech stack
Prepare skillPrepare skill
AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 3030 fromfrom 5858
Create sample dialogsCreate sample dialogs
AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 3131 fromfrom 5858
Sample dialog ISample dialog I
Alexa, start my zoo! 
Welcome to your zoo.
Please name an animal in my zoo! 
An elephant lives in your zoo.
Thanks, Alexa. 
You are welcome.
AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 3232 fromfrom 5858
Sample dialog IISample dialog II
Alexa, start my zoo! 
Welcome to your zoo.
How many animals live in my zoo? 
42 animals live in your zoo.
Thanks, Alexa. 
You are welcome.
AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 3333 fromfrom 5858
Create flow diagramsCreate flow diagrams
AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 3434 fromfrom 5858
Flow diagrammFlow diagramm
Welcome to
your zoo
Start my zoo
An elephant
lives in your zoo
42 animals
live in your zoo
»name« »number«
»name« »number«
You're welcome
»thanks« »thanks«
»thanks«
AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 3535 fromfrom 5858
Configure Alexa Skills KitConfigure Alexa Skills Kit
AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 3636 fromfrom 5858
Create custom slot typesCreate custom slot types
AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 3737 fromfrom 5858
Create custom intentsCreate custom intents
AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 3838 fromfrom 5858
Configure HTTPS endpointConfigure HTTPS endpoint
AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 3939 fromfrom 5858
Configure SSL certificateConfigure SSL certificate
AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 4040 fromfrom 5858
Test HTTPS endpointTest HTTPS endpoint
Implement skill codeImplement skill code
AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 4242 fromfrom 5858
Install sample applicationInstall sample application
$ git clone https://github.com/travello-gmbh/example-zoo-skill
$ cd example-zoo-skill
$ composer install
$ sudo chmod -R 777 data/cache/
// setup a virtual host for http://example-zoo-skill
// with the example-zoo-skill/html/ path as doc root
AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 4343 fromfrom 5858
Test sample applicationTest sample application
/data/postman/collection.json
AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 4444 fromfrom 5858
Update text fileUpdate text file
return [
'alexaLaunchTitle' => 'Welcome',
'alexaLaunchMessage' => 'Welcome to my zoo',
'alexaRepromptMessage' => 'Another animal or cancel?',
'alexaHelpTitle' => 'Help',
'alexaHelpMessage' => 'You can ask me which animal ' .
'lives in your zoo or how many animals live there.',
'alexaCancelTitle' => 'Thanks',
'alexaCancelMessage' => 'Thanks and see you soon!',
'alexaStopTitle' => 'Thanks',
'alexaStopMessage' => 'Thanks and see you soon!',
'alexaAnimalTitle' => 'An animal',
'alexaAnimalMessage' => '%1$s lives in your zoo!',
'alexaCountTitle' => 'Animal census',
'alexaCountMessage' => '%1$s animals live in your zoo!',
];
/data/texts/zoo.common.texts.de-DE.php
AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 4545 fromfrom 5858
Create text helper classCreate text helper class
<?php
namespace ZooApplicationHelper;
use TravelloAlexaLibraryApplicationHelperAbstractTextHelper;
class ZooTextHelper extends AbstractTextHelper implements ZooTextHelperInterface
{
public function getAnimalTitle(): string
{
return $this->commonTexts[$this->locale]['alexaAnimalTitle'];
}
public function getAnimalMessage(string $animal): string
{
return sprintf($this->commonTexts[$this->locale]['alexaAnimalMessage'], $animal);
}
public function getCountTitle(): string
{
return $this->commonTexts[$this->locale]['alexaCountTitle'];
}
public function getCountMessage(int $count): string
{
return sprintf($this->commonTexts[$this->locale]['alexaCountMessage'], $count);
}
} /module/Zoo/src/Application/Helper/ZooTextHelper.php
AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 4646 fromfrom 5858
Create zoo application ICreate zoo application I
<?php
namespace ZooApplication;
use TravelloAlexaLibraryApplicationAbstractAlexaApplication;
use TravelloAlexaLibraryRequestRequestTypeIntentRequestType;
use ZooApplicationHelperZooTextHelperInterface;
class ZooApplication extends AbstractAlexaApplication
{
protected function handleIntentRequest(): bool
{
$intentRequest = $this->alexaRequest->getRequest();
switch ($intentRequest->getIntent()->getName()) {
case 'AnimalIntent':
return $this->animalIntent();
case 'AMAZON.StopIntent':
return $this->stopIntent();
/* ... */
}
}
}
/module/Zoo/src/Application/ZooApplication.php
AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 4747 fromfrom 5858
Create zoo application IICreate zoo application II
<?php
namespace ZooApplication;
use TravelloAlexaLibraryResponseCardStandard;
use TravelloAlexaLibraryResponseOutputSpeechSSML;
class ZooApplication extends AbstractAlexaApplication
{
private function animalIntent(): bool
{
$zooMessage = $this->textHelper->getAnimalMessage('An elephant');
$this->alexaResponse->setOutputSpeech(new SSML($zooMessage));
$this->alexaResponse->setCard(new Standard(
$this->textHelper->getAnimalTitle(),
$zooMessage,
$this->smallImageUrl,
$this->largeImageUrl
));
return true;
}
}
/module/Zoo/src/Application/ZooApplication.php
AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 4848 fromfrom 5858
Test zoo applicationTest zoo application
/data/postman/collection.json
AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 4949 fromfrom 5858
More featuresMore features
Session attributes step2→
Second intent step4→
https://github.com/travello-gmbh/example-zoo-skill
Species slot type step3→
AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 5050 fromfrom 5858
Coming soon in Library 2.0Coming soon in Library 2.0
https://github.com/travello-gmbh/amazon-alexa-skill-library
Introducing Intent classes
Automatic intent handling
LearningsLearnings
AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 5252 fromfrom 5858
Early successEarly success
6 months top 10 activated skills
75.000 customers so far
64 customer reviews so far
2.500.000 utterances so far
Most accessed DE skill in 05/2017
AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 5353 fromfrom 5858
Biggest challengesBiggest challenges
First name slot type
Signature validation
Category slot type intents→
Chance to break first skill
2nd server for tests
More complex VUI / CUI
AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 5454 fromfrom 5858
Certification processCertification process
7 days for feedback (02/2017)
Signature validation issue
16 hours to go live (07/2017)
Single-word invocation issue
0 issues
»abbrechen« intent issue
AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 5555 fromfrom 5858
Development numbersDevelopment numbers
10 working days total
80% for infrastructure code
15 working days total
90% for skill code
20% for skill code
10% for infrastructure code
AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 5656 fromfrom 5858
LearningsLearnings
Start with simple skill
Test thoroughly
Write a solid code base
Build more than one skill
Design a sophisticated VUI
Do not trust slot-types blindly
Have fun!
Questions?Questions?
Thanks!Thanks!
Mail: ralf@travello.audioMail: ralf@travello.audio
Web: www.travello.audioWeb: www.travello.audio

More Related Content

PDF
Build an Alexa Skill Step-by-Step
PDF
Introduction to building alexa skills and putting your amazon echo to work
PDF
Building Voice Apps & Experiences For Amazon Echo
PDF
Amazon Alexa: our successes and fails
PPTX
Amazon alexa - building custom skills
PDF
David Isbitski - Enabling new voice experiences with Amazon Alexa and AWS Lambda
PPTX
Alexa Smart Home Skill
PDF
How to develop Alexa Skill Kit based on Serverless Architecture
Build an Alexa Skill Step-by-Step
Introduction to building alexa skills and putting your amazon echo to work
Building Voice Apps & Experiences For Amazon Echo
Amazon Alexa: our successes and fails
Amazon alexa - building custom skills
David Isbitski - Enabling new voice experiences with Amazon Alexa and AWS Lambda
Alexa Smart Home Skill
How to develop Alexa Skill Kit based on Serverless Architecture

What's hot (12)

PPTX
Alexa in 10 minutes
PPTX
Alexa Skills Kit
PPTX
Amazon Echo
PPTX
Voice enable all the things with Alexa
PDF
Your First Amazon Alexa Skill
PDF
Alexa for Developers
PDF
Alexa Skills Kit with Web API on Azure
PPTX
Amazon Alexa
PPTX
Amazon Alexa - Introduction & Custom Skills
PPTX
Amazon Alexa Development Overview
PDF
Alexa, nice to meet you!
PPTX
Building Boston Rail - An Alexa Skill
Alexa in 10 minutes
Alexa Skills Kit
Amazon Echo
Voice enable all the things with Alexa
Your First Amazon Alexa Skill
Alexa for Developers
Alexa Skills Kit with Web API on Azure
Amazon Alexa
Amazon Alexa - Introduction & Custom Skills
Amazon Alexa Development Overview
Alexa, nice to meet you!
Building Boston Rail - An Alexa Skill
Ad

Similar to Develop Alexa Skills for Amazon Echo with PHP (20)

PDF
Learnings Building Alexa Skills with PHP
PDF
Learnings Building Alexa Skills with PHP
PPTX
Lex and connect
PDF
Twilio Voice Applications with Amazon AWS S3 and EC2
PPTX
Guest Lecture _ Python Basics _ Alexa Skill Dev _ by Shivam Dutt Sharma
PPTX
Integrate drupal 8 with alexa - Rakshith
PDF
Building Alexa Skills - Floor28
PDF
DIY Your Amazon Echo
PDF
Marcel Pociot "Alexa, let's build a voice-powered app"
PPTX
Building an aws sdk for Perl - Granada Perl Workshop 2014
PDF
Make your own Amazon Alexa Skill
PDF
Get Started Developing with Alexa and Drupal
PDF
Building Public and Business Alexa Skills [Aug 2019]
PPTX
introductiontoalexaskillskit-160426090427.pptx
PDF
2013 PyCon SG - Building your cloud infrastructure with Python
PDF
「リモートペアプロでマントルを突き抜けろ!」AWS Cloud9でリモートペアプロ&楽々サーバーレス開発
PDF
Best devops course syllabus pdf 2025.pdf
PDF
Alexa enabled smart home programming in Python - PyCon India 2018
PDF
A 60-mn tour of AWS compute (March 2016)
PDF
Aws Technical Day 2015 - Amazon API Gateway
Learnings Building Alexa Skills with PHP
Learnings Building Alexa Skills with PHP
Lex and connect
Twilio Voice Applications with Amazon AWS S3 and EC2
Guest Lecture _ Python Basics _ Alexa Skill Dev _ by Shivam Dutt Sharma
Integrate drupal 8 with alexa - Rakshith
Building Alexa Skills - Floor28
DIY Your Amazon Echo
Marcel Pociot "Alexa, let's build a voice-powered app"
Building an aws sdk for Perl - Granada Perl Workshop 2014
Make your own Amazon Alexa Skill
Get Started Developing with Alexa and Drupal
Building Public and Business Alexa Skills [Aug 2019]
introductiontoalexaskillskit-160426090427.pptx
2013 PyCon SG - Building your cloud infrastructure with Python
「リモートペアプロでマントルを突き抜けろ!」AWS Cloud9でリモートペアプロ&楽々サーバーレス開発
Best devops course syllabus pdf 2025.pdf
Alexa enabled smart home programming in Python - PyCon India 2018
A 60-mn tour of AWS compute (March 2016)
Aws Technical Day 2015 - Amazon API Gateway
Ad

More from Ralf Eggert (20)

PDF
PHP Frameworks: I want to break free (IPC Berlin 2024)
PDF
PHP Rewrite: Do the right thing (IPC Berlin 2024)
PDF
ChatGPT: unser täglich' Bot gib uns heute
PDF
Der ultimative PHP Framework Vergleich 2023 Edition
PDF
PHP Module als Rundum-Sorglos-Pakete entwickeln
PDF
Alexa, what's next?
PDF
Alexa, wohin geht die Reise
PDF
8. Hamburg Voice Interface Meetup
PDF
Welcome Bixby
PDF
Alexa Skill Maintenance
PDF
Vom Zend Framework zu Laminas
PDF
Alexa Skills und PHP? Passt das zusammen?
PDF
Mit Jovo von 0 auf 100
PDF
Vom Zend Framework zu Laminas
PDF
Alexa for Hospitality
PDF
Alexa, lass uns Geld verdienen – fünf Geschäftsmodelle, die wirklich funktion...
PDF
Fortgeschrittene Techniken für erfolgreiche Sprachanwendungen
PDF
Die sieben Projektphasen für Voice Projekte
PDF
Künstliche Intelligenz – Traum und Wirklichkeit
PDF
Multi-Modal Voice Development with Amazon Alexa
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Rewrite: Do the right thing (IPC Berlin 2024)
ChatGPT: unser täglich' Bot gib uns heute
Der ultimative PHP Framework Vergleich 2023 Edition
PHP Module als Rundum-Sorglos-Pakete entwickeln
Alexa, what's next?
Alexa, wohin geht die Reise
8. Hamburg Voice Interface Meetup
Welcome Bixby
Alexa Skill Maintenance
Vom Zend Framework zu Laminas
Alexa Skills und PHP? Passt das zusammen?
Mit Jovo von 0 auf 100
Vom Zend Framework zu Laminas
Alexa for Hospitality
Alexa, lass uns Geld verdienen – fünf Geschäftsmodelle, die wirklich funktion...
Fortgeschrittene Techniken für erfolgreiche Sprachanwendungen
Die sieben Projektphasen für Voice Projekte
Künstliche Intelligenz – Traum und Wirklichkeit
Multi-Modal Voice Development with Amazon Alexa

Recently uploaded (20)

PPTX
Tartificialntelligence_presentation.pptx
PPTX
OMC Textile Division Presentation 2021.pptx
PPTX
TLE Review Electricity (Electricity).pptx
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PDF
project resource management chapter-09.pdf
PDF
Zenith AI: Advanced Artificial Intelligence
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
August Patch Tuesday
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PPTX
1. Introduction to Computer Programming.pptx
PPTX
A Presentation on Artificial Intelligence
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Getting Started with Data Integration: FME Form 101
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
WOOl fibre morphology and structure.pdf for textiles
Tartificialntelligence_presentation.pptx
OMC Textile Division Presentation 2021.pptx
TLE Review Electricity (Electricity).pptx
A comparative analysis of optical character recognition models for extracting...
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
project resource management chapter-09.pdf
Zenith AI: Advanced Artificial Intelligence
MIND Revenue Release Quarter 2 2025 Press Release
Accuracy of neural networks in brain wave diagnosis of schizophrenia
A comparative study of natural language inference in Swahili using monolingua...
August Patch Tuesday
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
1. Introduction to Computer Programming.pptx
A Presentation on Artificial Intelligence
Encapsulation_ Review paper, used for researhc scholars
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Getting Started with Data Integration: FME Form 101
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
WOOl fibre morphology and structure.pdf for textiles

Develop Alexa Skills for Amazon Echo with PHP

  • 1. Develop Alexa SkillsDevelop Alexa Skills for Amazon Echo with PHPfor Amazon Echo with PHP AWS Tech Community Days, Cologne, 27/09/2017AWS Tech Community Days, Cologne, 27/09/2017
  • 2. Ralf EggertRalf Eggert CEO Travello GmbH, Trainer, Author, Coach,CEO Travello GmbH, Trainer, Author, Coach, PHP Developer & Alexa Skill DeveloperPHP Developer & Alexa Skill Developer
  • 4. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 44 fromfrom 5858 AgendaAgenda Amazon Alexa Basics  Prepare skill  Why PHP? Implement skill code Learnings 
  • 5. Amazon Alexa BasicsAmazon Alexa Basics
  • 6. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 66 fromfrom 5858 How does an Alexa request work?How does an Alexa request work? AWS Lambda Function Alexa Voice Service  
  • 7. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 77 fromfrom 5858 How does an Alexa request work?How does an Alexa request work? AWS Lambda Function Alexa Voice Service  Voice Command 
  • 8. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 88 fromfrom 5858 How does an Alexa request work?How does an Alexa request work? AWS Lambda Function Alexa Voice Service  Voice Command Voice Request 
  • 9. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 99 fromfrom 5858 How does an Alexa request work?How does an Alexa request work? AWS Lambda Function Alexa Voice Service  Voice Command Voice Request JSON Request 
  • 10. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 1010 fromfrom 5858 How does an Alexa request work?How does an Alexa request work? AWS Lambda Function Alexa Voice Service  Voice Command Voice Request JSON Request JSON Response
  • 11. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 1111 fromfrom 5858 How does an Alexa request work?How does an Alexa request work? AWS Lambda Function Alexa Voice Service Text Response  Voice Command Voice Request JSON Request JSON Response
  • 12. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 1212 fromfrom 5858 How does an Alexa request work?How does an Alexa request work? AWS Lambda Function Alexa Voice Service Text Response  Voice Response Card Response Voice Command Voice Request JSON Request JSON Response
  • 13. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 1313 fromfrom 5858 Alternative requestAlternative request HTTPS Endpoint Server Alexa Voice Service Text Response  Voice Response Card Response Voice Command Voice Request JSON Request JSON Response
  • 14. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 1414 fromfrom 5858 Alexa Voice Service (AVS)Alexa Voice Service (AVS) Alexa Voice Service Automatic Speech Recognition (ASR) Natural Language Understanding (NLU) Text To Speech (TTS) Voice Command Mapping
  • 15. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 1515 fromfrom 5858 Alexa Skills Kit (ASK)Alexa Skills Kit (ASK) Alexa Skills Kit Interaction-Model / Skill Builder Configuration Publishing / Privacy Test Service Simulator Beta Test
  • 16. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 1616 fromfrom 5858 ASK OverviewASK Overview
  • 17. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 1717 fromfrom 5858 Alexa Skill BuilderAlexa Skill Builder
  • 18. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 1818 fromfrom 5858 AWS Lambda FunctionsAWS Lambda Functions
  • 20. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 2020 fromfrom 5858 Possible solutionsPossible solutions Compile PHP for AWS Use supported runtime engine for AWS Use own HTTPS endpoint server
  • 21. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 2121 fromfrom 5858 Use supported runtime engine?Use supported runtime engine?
  • 22. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 2222 fromfrom 5858 Compile PHP for AWS Lambda?Compile PHP for AWS Lambda? https://goo.gl/N9VVvb
  • 23. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 2323 fromfrom 5858 Use own HTTPS endpoint server?Use own HTTPS endpoint server?
  • 24. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 2424 fromfrom 5858 Solution foundSolution found Compile PHP for AWS Use supported runtime engine for AWS Use own HTTPS endpoint server
  • 25. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 2525 fromfrom 5858 Disadvantages own HTTPS endpointDisadvantages own HTTPS endpoint Some dev-tools only work with Lambda (API, CLI) Need to build own library for Alexa Server administration
  • 26. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 2626 fromfrom 5858 Advantages own HTTPS endpointAdvantages own HTTPS endpoint Use any software you want Full control over server environment Privacy concerns (soft concern)
  • 27. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 2727 fromfrom 5858 Open-source PHP libraryOpen-source PHP library https://github.com/travello-gmbh/
  • 28. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 2828 fromfrom 5858 My current tech stackMy current tech stack
  • 30. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 3030 fromfrom 5858 Create sample dialogsCreate sample dialogs
  • 31. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 3131 fromfrom 5858 Sample dialog ISample dialog I Alexa, start my zoo!  Welcome to your zoo. Please name an animal in my zoo!  An elephant lives in your zoo. Thanks, Alexa.  You are welcome.
  • 32. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 3232 fromfrom 5858 Sample dialog IISample dialog II Alexa, start my zoo!  Welcome to your zoo. How many animals live in my zoo?  42 animals live in your zoo. Thanks, Alexa.  You are welcome.
  • 33. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 3333 fromfrom 5858 Create flow diagramsCreate flow diagrams
  • 34. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 3434 fromfrom 5858 Flow diagrammFlow diagramm Welcome to your zoo Start my zoo An elephant lives in your zoo 42 animals live in your zoo »name« »number« »name« »number« You're welcome »thanks« »thanks« »thanks«
  • 35. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 3535 fromfrom 5858 Configure Alexa Skills KitConfigure Alexa Skills Kit
  • 36. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 3636 fromfrom 5858 Create custom slot typesCreate custom slot types
  • 37. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 3737 fromfrom 5858 Create custom intentsCreate custom intents
  • 38. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 3838 fromfrom 5858 Configure HTTPS endpointConfigure HTTPS endpoint
  • 39. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 3939 fromfrom 5858 Configure SSL certificateConfigure SSL certificate
  • 40. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 4040 fromfrom 5858 Test HTTPS endpointTest HTTPS endpoint
  • 42. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 4242 fromfrom 5858 Install sample applicationInstall sample application $ git clone https://github.com/travello-gmbh/example-zoo-skill $ cd example-zoo-skill $ composer install $ sudo chmod -R 777 data/cache/ // setup a virtual host for http://example-zoo-skill // with the example-zoo-skill/html/ path as doc root
  • 43. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 4343 fromfrom 5858 Test sample applicationTest sample application /data/postman/collection.json
  • 44. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 4444 fromfrom 5858 Update text fileUpdate text file return [ 'alexaLaunchTitle' => 'Welcome', 'alexaLaunchMessage' => 'Welcome to my zoo', 'alexaRepromptMessage' => 'Another animal or cancel?', 'alexaHelpTitle' => 'Help', 'alexaHelpMessage' => 'You can ask me which animal ' . 'lives in your zoo or how many animals live there.', 'alexaCancelTitle' => 'Thanks', 'alexaCancelMessage' => 'Thanks and see you soon!', 'alexaStopTitle' => 'Thanks', 'alexaStopMessage' => 'Thanks and see you soon!', 'alexaAnimalTitle' => 'An animal', 'alexaAnimalMessage' => '%1$s lives in your zoo!', 'alexaCountTitle' => 'Animal census', 'alexaCountMessage' => '%1$s animals live in your zoo!', ]; /data/texts/zoo.common.texts.de-DE.php
  • 45. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 4545 fromfrom 5858 Create text helper classCreate text helper class <?php namespace ZooApplicationHelper; use TravelloAlexaLibraryApplicationHelperAbstractTextHelper; class ZooTextHelper extends AbstractTextHelper implements ZooTextHelperInterface { public function getAnimalTitle(): string { return $this->commonTexts[$this->locale]['alexaAnimalTitle']; } public function getAnimalMessage(string $animal): string { return sprintf($this->commonTexts[$this->locale]['alexaAnimalMessage'], $animal); } public function getCountTitle(): string { return $this->commonTexts[$this->locale]['alexaCountTitle']; } public function getCountMessage(int $count): string { return sprintf($this->commonTexts[$this->locale]['alexaCountMessage'], $count); } } /module/Zoo/src/Application/Helper/ZooTextHelper.php
  • 46. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 4646 fromfrom 5858 Create zoo application ICreate zoo application I <?php namespace ZooApplication; use TravelloAlexaLibraryApplicationAbstractAlexaApplication; use TravelloAlexaLibraryRequestRequestTypeIntentRequestType; use ZooApplicationHelperZooTextHelperInterface; class ZooApplication extends AbstractAlexaApplication { protected function handleIntentRequest(): bool { $intentRequest = $this->alexaRequest->getRequest(); switch ($intentRequest->getIntent()->getName()) { case 'AnimalIntent': return $this->animalIntent(); case 'AMAZON.StopIntent': return $this->stopIntent(); /* ... */ } } } /module/Zoo/src/Application/ZooApplication.php
  • 47. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 4747 fromfrom 5858 Create zoo application IICreate zoo application II <?php namespace ZooApplication; use TravelloAlexaLibraryResponseCardStandard; use TravelloAlexaLibraryResponseOutputSpeechSSML; class ZooApplication extends AbstractAlexaApplication { private function animalIntent(): bool { $zooMessage = $this->textHelper->getAnimalMessage('An elephant'); $this->alexaResponse->setOutputSpeech(new SSML($zooMessage)); $this->alexaResponse->setCard(new Standard( $this->textHelper->getAnimalTitle(), $zooMessage, $this->smallImageUrl, $this->largeImageUrl )); return true; } } /module/Zoo/src/Application/ZooApplication.php
  • 48. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 4848 fromfrom 5858 Test zoo applicationTest zoo application /data/postman/collection.json
  • 49. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 4949 fromfrom 5858 More featuresMore features Session attributes step2→ Second intent step4→ https://github.com/travello-gmbh/example-zoo-skill Species slot type step3→
  • 50. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 5050 fromfrom 5858 Coming soon in Library 2.0Coming soon in Library 2.0 https://github.com/travello-gmbh/amazon-alexa-skill-library Introducing Intent classes Automatic intent handling
  • 52. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 5252 fromfrom 5858 Early successEarly success 6 months top 10 activated skills 75.000 customers so far 64 customer reviews so far 2.500.000 utterances so far Most accessed DE skill in 05/2017
  • 53. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 5353 fromfrom 5858 Biggest challengesBiggest challenges First name slot type Signature validation Category slot type intents→ Chance to break first skill 2nd server for tests More complex VUI / CUI
  • 54. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 5454 fromfrom 5858 Certification processCertification process 7 days for feedback (02/2017) Signature validation issue 16 hours to go live (07/2017) Single-word invocation issue 0 issues »abbrechen« intent issue
  • 55. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 5555 fromfrom 5858 Development numbersDevelopment numbers 10 working days total 80% for infrastructure code 15 working days total 90% for skill code 20% for skill code 10% for infrastructure code
  • 56. AWS Tech Community DaysAWS Tech Community DaysRalf EggertRalf Eggert 5656 fromfrom 5858 LearningsLearnings Start with simple skill Test thoroughly Write a solid code base Build more than one skill Design a sophisticated VUI Do not trust slot-types blindly Have fun!