SlideShare uma empresa Scribd logo
1 de 58
Baixar para ler offline
Alexa Skills für Amazon EchoAlexa Skills für Amazon Echo
mit PHP entwickelnmit PHP entwickeln
Ralf EggertRalf Eggert
CEO Travello GmbH, Trainer, Autor, Coach,CEO Travello GmbH, Trainer, Autor, Coach,
PHP Entwickler & Alexa Skill EntwicklerPHP Entwickler & Alexa Skill Entwickler
Drei Fragen!Drei Fragen!
code.talks 2017code.talks 2017Ralf EggertRalf Eggert 44 vonvon 5858
AgendaAgenda
Amazon Alexa Grundlagen 
Skill vorbereiten 
Warum PHP?
Skill Code implementieren
Meine Erkenntnisse 
Amazon Alexa GrundlagenAmazon Alexa Grundlagen
code.talks 2017code.talks 2017Ralf EggertRalf Eggert 66 vonvon 5858
Wie funktioniert ein Alexa Request?Wie funktioniert ein Alexa Request?
AWS
Lambda
Function
Alexa Voice Service


code.talks 2017code.talks 2017Ralf EggertRalf Eggert 77 vonvon 5858
Wie funktioniert ein Alexa Request?Wie funktioniert ein Alexa Request?
AWS
Lambda
Function
Alexa Voice Service

Voice Command

code.talks 2017code.talks 2017Ralf EggertRalf Eggert 88 vonvon 5858
Wie funktioniert ein Alexa Request?Wie funktioniert ein Alexa Request?
AWS
Lambda
Function
Alexa Voice Service

Voice Command
Voice Request

code.talks 2017code.talks 2017Ralf EggertRalf Eggert 99 vonvon 5858
Wie funktioniert ein Alexa Request?Wie funktioniert ein Alexa Request?
AWS
Lambda
Function
Alexa Voice Service

Voice Command
Voice Request
JSON Request

code.talks 2017code.talks 2017Ralf EggertRalf Eggert 1010 vonvon 5858
Wie funktioniert ein Alexa Request?Wie funktioniert ein Alexa Request?
AWS
Lambda
Function
Alexa Voice Service

Voice Command
Voice Request
JSON Request
JSON Response
code.talks 2017code.talks 2017Ralf EggertRalf Eggert 1111 vonvon 5858
Wie funktioniert ein Alexa Request?Wie funktioniert ein Alexa Request?
AWS
Lambda
Function
Alexa Voice Service
Text Response

Voice Command
Voice Request
JSON Request
JSON Response
code.talks 2017code.talks 2017Ralf EggertRalf Eggert 1212 vonvon 5858
Wie funktioniert ein Alexa Request?Wie funktioniert ein Alexa Request?
AWS
Lambda
Function
Alexa Voice Service
Text Response

Voice Response
Card Response
Voice Command
Voice Request
JSON Request
JSON Response
code.talks 2017code.talks 2017Ralf EggertRalf Eggert 1313 vonvon 5858
Alternativer RequestAlternativer Request
HTTPS
Endpoint
Server
Alexa Voice Service
Text Response

Voice Response
Card Response
Voice Command
Voice Request
JSON Request
JSON Response
code.talks 2017code.talks 2017Ralf EggertRalf Eggert 1414 vonvon 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
code.talks 2017code.talks 2017Ralf EggertRalf Eggert 1515 vonvon 5858
Alexa Skills Kit (ASK)Alexa Skills Kit (ASK)
Alexa Skills Kit
Interaction-Model /
Skill Builder
Configuration
Publishing /
Privacy
Test
Service Simulator
Beta Test
code.talks 2017code.talks 2017Ralf EggertRalf Eggert 1616 vonvon 5858
ASK ÜberblickASK Überblick
code.talks 2017code.talks 2017Ralf EggertRalf Eggert 1717 vonvon 5858
Alexa Skill BuilderAlexa Skill Builder
code.talks 2017code.talks 2017Ralf EggertRalf Eggert 1818 vonvon 5858
AWS Lambda FunctionsAWS Lambda Functions
Warum PHP?Warum PHP?
code.talks 2017code.talks 2017Ralf EggertRalf Eggert 2020 vonvon 5858
Mögliche LösungsansätzeMögliche Lösungsansätze
PHP für AWS kompilieren
Unterstützte Runtime Engine für AWS einsetzen
Eigenen HTTPS Endpoint Server einsetzen
code.talks 2017code.talks 2017Ralf EggertRalf Eggert 2121 vonvon 5858
Unterstützte Runtime Engine?Unterstützte Runtime Engine?
code.talks 2017code.talks 2017Ralf EggertRalf Eggert 2222 vonvon 5858
PHP für AWS Lambda kompilieren?PHP für AWS Lambda kompilieren?
https://goo.gl/N9VVvb
code.talks 2017code.talks 2017Ralf EggertRalf Eggert 2323 vonvon 5858
Eigener HTTPS Endpoint Server?Eigener HTTPS Endpoint Server?
code.talks 2017code.talks 2017Ralf EggertRalf Eggert 2424 vonvon 5858
Lösung gefundenLösung gefunden
PHP für AWS kompilieren
Unterstützte Runtime Engine für AWS einsetzen
Eigenen HTTPS Endpoint Server einsetzen
code.talks 2017code.talks 2017Ralf EggertRalf Eggert 2525 vonvon 5858
Nachteile eigener HTTPS EndpointNachteile eigener HTTPS Endpoint
Einige Tools arbeiten nur mit Lambda (API, CLI)
Eigene Library für Alexa aufbauen
Server Administration
code.talks 2017code.talks 2017Ralf EggertRalf Eggert 2626 vonvon 5858
Vorteile eigener HTTPS EndpointVorteile eigener HTTPS Endpoint
Jede gewünschte Software einsetzbar
Vollständige Kontroller über die Serverumgebung
Keine Datenschutzbedenken (weiche Bedenken)
code.talks 2017code.talks 2017Ralf EggertRalf Eggert 2727 vonvon 5858
Open-source PHP LibraryOpen-source PHP Library
https://github.com/travello-gmbh/
code.talks 2017code.talks 2017Ralf EggertRalf Eggert 2828 vonvon 5858
Mein aktueller Tech StackMein aktueller Tech Stack
Skill vorbereitenSkill vorbereiten
code.talks 2017code.talks 2017Ralf EggertRalf Eggert 3030 vonvon 5858
Beispieldialoge erstellenBeispieldialoge erstellen
code.talks 2017code.talks 2017Ralf EggertRalf Eggert 3131 vonvon 5858
Beispieldialog IBeispieldialog I
Alexa, starte Mein Zoo! 
Willkommen in deinem Zoo.
Nenne mir ein Tier aus meinem Zoo! 
Ein Elefant lebt in deinem Zoo.
Danke Alexa. 
Bitte!
code.talks 2017code.talks 2017Ralf EggertRalf Eggert 3232 vonvon 5858
Beispieldialog IIBeispieldialog II
Alexa, starte Mein Zoo! 
Willkommen in deinem Zoo.
Wie viele Tiere leben in meinem Zoo? 
In deinem Zoo leben 42 Tiere!
Danke Alexa. 
Bitte!
code.talks 2017code.talks 2017Ralf EggertRalf Eggert 3333 vonvon 5858
Flussdiagramme erstellenFlussdiagramme erstellen
code.talks 2017code.talks 2017Ralf EggertRalf Eggert 3434 vonvon 5858
FlussdiagrammFlussdiagramm
Willkommen in
deinem Zoo.
Starte Mein Zoo
Nenne mir ein Tier
aus meinem Zoo!
In deinem Zoo
leben 42 Tiere!
»nenne« »anzahl«
»nenne« »anzahl«
Bitte!
»danke« »danke«
»danke«
code.talks 2017code.talks 2017Ralf EggertRalf Eggert 3535 vonvon 5858
Alexa Skills Kit konfigurierenAlexa Skills Kit konfigurieren
code.talks 2017code.talks 2017Ralf EggertRalf Eggert 3636 vonvon 5858
Eigene Slot Types erstellenEigene Slot Types erstellen
code.talks 2017code.talks 2017Ralf EggertRalf Eggert 3737 vonvon 5858
Eigene Intents erstellenEigene Intents erstellen
code.talks 2017code.talks 2017Ralf EggertRalf Eggert 3838 vonvon 5858
HTTPS Endpoint konfigurierenHTTPS Endpoint konfigurieren
code.talks 2017code.talks 2017Ralf EggertRalf Eggert 3939 vonvon 5858
SSL Zertifikat konfigurierenSSL Zertifikat konfigurieren
code.talks 2017code.talks 2017Ralf EggertRalf Eggert 4040 vonvon 5858
HTTPS Endpoint testenHTTPS Endpoint testen
Skill Code implementierenSkill Code implementieren
code.talks 2017code.talks 2017Ralf EggertRalf Eggert 4242 vonvon 5858
Beispielanwendung installierenBeispielanwendung installieren
$ git clone https://github.com/travello-gmbh/example-zoo-skill
$ cd example-zoo-skill
$ composer install
$ sudo chmod -R 777 data/cache/
// Virtual Host für http://example-zoo-skill einrichte
// mit dem Pfad example-zoo-skill/html/ als Doc Root
code.talks 2017code.talks 2017Ralf EggertRalf Eggert 4343 vonvon 5858
Beispielanwendung testenBeispielanwendung testen
/data/postman/collection.json
code.talks 2017code.talks 2017Ralf EggertRalf Eggert 4444 vonvon 5858
Textdatei aktualisierenTextdatei aktualisieren
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
code.talks 2017code.talks 2017Ralf EggertRalf Eggert 4545 vonvon 5858
Texthelfer Klasse erstellenTexthelfer Klasse erstellen
<?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
code.talks 2017code.talks 2017Ralf EggertRalf Eggert 4646 vonvon 5858
Zoo Anwendung erstellen IZoo Anwendung erstellen 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
code.talks 2017code.talks 2017Ralf EggertRalf Eggert 4747 vonvon 5858
Zoo Anwendung erstellen IIZoo Anwendung erstellen II
<?php
namespace ZooApplication;
use TravelloAlexaLibraryResponseCardStandard;
use TravelloAlexaLibraryResponseOutputSpeechSSML;
class ZooApplication extends AbstractAlexaApplication
{
private function animalIntent(): bool
{
$zooMessage = $this->textHelper->getAnimalMessage('Ein Elefant');
$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
code.talks 2017code.talks 2017Ralf EggertRalf Eggert 4848 vonvon 5858
Zoo Anwendung testenZoo Anwendung testen
/data/postman/collection.json
code.talks 2017code.talks 2017Ralf EggertRalf Eggert 4949 vonvon 5858
Weitere FeaturesWeitere Features
Session Attribute step2→
Zweiter Intent step4→
https://github.com/travello-gmbh/example-zoo-skill
Slot type Tierarten step3→
code.talks 2017code.talks 2017Ralf EggertRalf Eggert 5050 vonvon 5858
In Kürze in der Library 2.0In Kürze in der Library 2.0
https://github.com/travello-gmbh/amazon-alexa-skill-library
Einführung von Intent-Klassen
Automatische Intent-Verarbeitung
Meine ErkenntnisseMeine Erkenntnisse
code.talks 2017code.talks 2017Ralf EggertRalf Eggert 5252 vonvon 5858
Früher ErfolgFrüher Erfolg
6 Monate Top 10 Aktivierte Skills
75.000 Kunden bisher
64 Kundenbewertungen bisher
2.500.000 »Utterances« bisher
Meist genutzter Skill (DE) in 05/2017
code.talks 2017code.talks 2017Ralf EggertRalf Eggert 5353 vonvon 5858
Größte HerausforderungenGrößte Herausforderungen
Slot Type für deutsche Vorname
Signaturvalidierung
Kategorie Slot Type Intents→
Chance ersten Skill abzuschießen
Zweiter Server für Tests
Komplexeres VUI / CUI
code.talks 2017code.talks 2017Ralf EggertRalf Eggert 5454 vonvon 5858
ZertifizierungsprozessZertifizierungsprozess
7 Tage für Feedback (02/2017)
Signaturvalidierung Problem
16 Stunden bis Live (07/2017)
Invocation Name Problem
0 Probleme
»Abbrechen« Intent Problem
code.talks 2017code.talks 2017Ralf EggertRalf Eggert 5555 vonvon 5858
Zahlen zur EntwicklungZahlen zur Entwicklung
10 Arbeitstage zusammen
80% für Infrastruktur Code
15 Arbeitstage zusammen
90% für Skill Code
20% für Skill Code
10% für Infrastruktur Code
code.talks 2017code.talks 2017Ralf EggertRalf Eggert 5656 vonvon 5858
Wichtigste ErkenntnisseWichtigste Erkenntnisse
Mit einfachem Skill beginnen
Gründlich testen
Solide Code Basis schreiben
Mehr als einen Skill erstellen
Durchdachte VUI erstellen
Slot-Types nicht blind vertrauen
Spaß haben!
Fragen?Fragen?
Danke!Danke!
Mail: ralf@travello.audioMail: ralf@travello.audio
Web: www.travello.audioWeb: www.travello.audio

Mais conteúdo relacionado

Semelhante a Alexa Skills für Amazon Echo mit PHP entwickeln

Source-Code-Analyse – ein praktikabler Ansatz
Source-Code-Analyse – ein praktikabler AnsatzSource-Code-Analyse – ein praktikabler Ansatz
Source-Code-Analyse – ein praktikabler AnsatzDigicomp Academy AG
 
#SpeakRoslyn - Die Microsoft .NET Compiler Plattform
#SpeakRoslyn - Die Microsoft .NET Compiler Plattform#SpeakRoslyn - Die Microsoft .NET Compiler Plattform
#SpeakRoslyn - Die Microsoft .NET Compiler PlattformRobin Sedlaczek
 
Production-ready Infrastruktur in 3 Wochen
Production-ready Infrastruktur in 3 WochenProduction-ready Infrastruktur in 3 Wochen
Production-ready Infrastruktur in 3 WochenAndré Goliath
 
Perl - die Taschenkettensäge unter den Programmiersprachen - Vortrag 2003
Perl - die Taschenkettensäge unter den Programmiersprachen - Vortrag 2003Perl - die Taschenkettensäge unter den Programmiersprachen - Vortrag 2003
Perl - die Taschenkettensäge unter den Programmiersprachen - Vortrag 2003Brigitte Jellinek
 
Perl 5.20: Feature, Kultur, Module, Werkzeuge
Perl 5.20: Feature, Kultur, Module, WerkzeugePerl 5.20: Feature, Kultur, Module, Werkzeuge
Perl 5.20: Feature, Kultur, Module, Werkzeugelichtkind
 
Hands-on Workshop: API-Dokumentation mit OpenAPI / Swagger in ASP.NET Core
Hands-on Workshop: API-Dokumentation mit OpenAPI / Swagger in ASP.NET CoreHands-on Workshop: API-Dokumentation mit OpenAPI / Swagger in ASP.NET Core
Hands-on Workshop: API-Dokumentation mit OpenAPI / Swagger in ASP.NET CoreGregor Biswanger
 

Semelhante a Alexa Skills für Amazon Echo mit PHP entwickeln (6)

Source-Code-Analyse – ein praktikabler Ansatz
Source-Code-Analyse – ein praktikabler AnsatzSource-Code-Analyse – ein praktikabler Ansatz
Source-Code-Analyse – ein praktikabler Ansatz
 
#SpeakRoslyn - Die Microsoft .NET Compiler Plattform
#SpeakRoslyn - Die Microsoft .NET Compiler Plattform#SpeakRoslyn - Die Microsoft .NET Compiler Plattform
#SpeakRoslyn - Die Microsoft .NET Compiler Plattform
 
Production-ready Infrastruktur in 3 Wochen
Production-ready Infrastruktur in 3 WochenProduction-ready Infrastruktur in 3 Wochen
Production-ready Infrastruktur in 3 Wochen
 
Perl - die Taschenkettensäge unter den Programmiersprachen - Vortrag 2003
Perl - die Taschenkettensäge unter den Programmiersprachen - Vortrag 2003Perl - die Taschenkettensäge unter den Programmiersprachen - Vortrag 2003
Perl - die Taschenkettensäge unter den Programmiersprachen - Vortrag 2003
 
Perl 5.20: Feature, Kultur, Module, Werkzeuge
Perl 5.20: Feature, Kultur, Module, WerkzeugePerl 5.20: Feature, Kultur, Module, Werkzeuge
Perl 5.20: Feature, Kultur, Module, Werkzeuge
 
Hands-on Workshop: API-Dokumentation mit OpenAPI / Swagger in ASP.NET Core
Hands-on Workshop: API-Dokumentation mit OpenAPI / Swagger in ASP.NET CoreHands-on Workshop: API-Dokumentation mit OpenAPI / Swagger in ASP.NET Core
Hands-on Workshop: API-Dokumentation mit OpenAPI / Swagger in ASP.NET Core
 

Mais de Ralf Eggert

ChatGPT: unser täglich' Bot gib uns heute
ChatGPT: unser täglich' Bot gib uns heuteChatGPT: unser täglich' Bot gib uns heute
ChatGPT: unser täglich' Bot gib uns heuteRalf Eggert
 
Der ultimative PHP Framework Vergleich 2023 Edition
Der ultimative PHP Framework Vergleich 2023 EditionDer ultimative PHP Framework Vergleich 2023 Edition
Der ultimative PHP Framework Vergleich 2023 EditionRalf Eggert
 
PHP Module als Rundum-Sorglos-Pakete entwickeln
PHP Module als Rundum-Sorglos-Pakete entwickelnPHP Module als Rundum-Sorglos-Pakete entwickeln
PHP Module als Rundum-Sorglos-Pakete entwickelnRalf Eggert
 
Alexa, what's next?
Alexa, what's next?Alexa, what's next?
Alexa, what's next?Ralf Eggert
 
Alexa, wohin geht die Reise
Alexa, wohin geht die ReiseAlexa, wohin geht die Reise
Alexa, wohin geht die ReiseRalf Eggert
 
8. Hamburg Voice Interface Meetup
8. Hamburg Voice Interface Meetup8. Hamburg Voice Interface Meetup
8. Hamburg Voice Interface MeetupRalf Eggert
 
Alexa Skill Maintenance
Alexa Skill MaintenanceAlexa Skill Maintenance
Alexa Skill MaintenanceRalf Eggert
 
Vom Zend Framework zu Laminas
Vom Zend Framework zu LaminasVom Zend Framework zu Laminas
Vom Zend Framework zu LaminasRalf Eggert
 
Mit Jovo von 0 auf 100
Mit Jovo von 0 auf 100Mit Jovo von 0 auf 100
Mit Jovo von 0 auf 100Ralf Eggert
 
Vom Zend Framework zu Laminas
Vom Zend Framework zu LaminasVom Zend Framework zu Laminas
Vom Zend Framework zu LaminasRalf Eggert
 
Alexa for Hospitality
Alexa for HospitalityAlexa for Hospitality
Alexa for HospitalityRalf Eggert
 
Alexa, lass uns Geld verdienen – fünf Geschäftsmodelle, die wirklich funktion...
Alexa, lass uns Geld verdienen – fünf Geschäftsmodelle, die wirklich funktion...Alexa, lass uns Geld verdienen – fünf Geschäftsmodelle, die wirklich funktion...
Alexa, lass uns Geld verdienen – fünf Geschäftsmodelle, die wirklich funktion...Ralf Eggert
 
Fortgeschrittene Techniken für erfolgreiche Sprachanwendungen
Fortgeschrittene Techniken für erfolgreiche SprachanwendungenFortgeschrittene Techniken für erfolgreiche Sprachanwendungen
Fortgeschrittene Techniken für erfolgreiche SprachanwendungenRalf Eggert
 
Die sieben Projektphasen für Voice Projekte
Die sieben Projektphasen für Voice ProjekteDie sieben Projektphasen für Voice Projekte
Die sieben Projektphasen für Voice ProjekteRalf Eggert
 
Künstliche Intelligenz – Traum und Wirklichkeit
Künstliche Intelligenz – Traum und WirklichkeitKünstliche Intelligenz – Traum und Wirklichkeit
Künstliche Intelligenz – Traum und WirklichkeitRalf Eggert
 
Multi-Modal Voice Development with Amazon Alexa
Multi-Modal Voice Development with Amazon AlexaMulti-Modal Voice Development with Amazon Alexa
Multi-Modal Voice Development with Amazon AlexaRalf Eggert
 
Mein Haus, mein Auto, mein Backend
Mein Haus, mein Auto, mein BackendMein Haus, mein Auto, mein Backend
Mein Haus, mein Auto, mein BackendRalf Eggert
 
Zend/Expressive 3 – The Next Generation
Zend/Expressive 3 – The Next GenerationZend/Expressive 3 – The Next Generation
Zend/Expressive 3 – The Next GenerationRalf Eggert
 
Sieben Tipps für den Voice Commerce mit PHP
Sieben Tipps für den Voice Commerce mit PHPSieben Tipps für den Voice Commerce mit PHP
Sieben Tipps für den Voice Commerce mit PHPRalf Eggert
 

Mais de Ralf Eggert (20)

ChatGPT: unser täglich' Bot gib uns heute
ChatGPT: unser täglich' Bot gib uns heuteChatGPT: unser täglich' Bot gib uns heute
ChatGPT: unser täglich' Bot gib uns heute
 
Der ultimative PHP Framework Vergleich 2023 Edition
Der ultimative PHP Framework Vergleich 2023 EditionDer ultimative PHP Framework Vergleich 2023 Edition
Der ultimative PHP Framework Vergleich 2023 Edition
 
PHP Module als Rundum-Sorglos-Pakete entwickeln
PHP Module als Rundum-Sorglos-Pakete entwickelnPHP Module als Rundum-Sorglos-Pakete entwickeln
PHP Module als Rundum-Sorglos-Pakete entwickeln
 
Alexa, what's next?
Alexa, what's next?Alexa, what's next?
Alexa, what's next?
 
Alexa, wohin geht die Reise
Alexa, wohin geht die ReiseAlexa, wohin geht die Reise
Alexa, wohin geht die Reise
 
8. Hamburg Voice Interface Meetup
8. Hamburg Voice Interface Meetup8. Hamburg Voice Interface Meetup
8. Hamburg Voice Interface Meetup
 
Welcome Bixby
Welcome BixbyWelcome Bixby
Welcome Bixby
 
Alexa Skill Maintenance
Alexa Skill MaintenanceAlexa Skill Maintenance
Alexa Skill Maintenance
 
Vom Zend Framework zu Laminas
Vom Zend Framework zu LaminasVom Zend Framework zu Laminas
Vom Zend Framework zu Laminas
 
Mit Jovo von 0 auf 100
Mit Jovo von 0 auf 100Mit Jovo von 0 auf 100
Mit Jovo von 0 auf 100
 
Vom Zend Framework zu Laminas
Vom Zend Framework zu LaminasVom Zend Framework zu Laminas
Vom Zend Framework zu Laminas
 
Alexa for Hospitality
Alexa for HospitalityAlexa for Hospitality
Alexa for Hospitality
 
Alexa, lass uns Geld verdienen – fünf Geschäftsmodelle, die wirklich funktion...
Alexa, lass uns Geld verdienen – fünf Geschäftsmodelle, die wirklich funktion...Alexa, lass uns Geld verdienen – fünf Geschäftsmodelle, die wirklich funktion...
Alexa, lass uns Geld verdienen – fünf Geschäftsmodelle, die wirklich funktion...
 
Fortgeschrittene Techniken für erfolgreiche Sprachanwendungen
Fortgeschrittene Techniken für erfolgreiche SprachanwendungenFortgeschrittene Techniken für erfolgreiche Sprachanwendungen
Fortgeschrittene Techniken für erfolgreiche Sprachanwendungen
 
Die sieben Projektphasen für Voice Projekte
Die sieben Projektphasen für Voice ProjekteDie sieben Projektphasen für Voice Projekte
Die sieben Projektphasen für Voice Projekte
 
Künstliche Intelligenz – Traum und Wirklichkeit
Künstliche Intelligenz – Traum und WirklichkeitKünstliche Intelligenz – Traum und Wirklichkeit
Künstliche Intelligenz – Traum und Wirklichkeit
 
Multi-Modal Voice Development with Amazon Alexa
Multi-Modal Voice Development with Amazon AlexaMulti-Modal Voice Development with Amazon Alexa
Multi-Modal Voice Development with Amazon Alexa
 
Mein Haus, mein Auto, mein Backend
Mein Haus, mein Auto, mein BackendMein Haus, mein Auto, mein Backend
Mein Haus, mein Auto, mein Backend
 
Zend/Expressive 3 – The Next Generation
Zend/Expressive 3 – The Next GenerationZend/Expressive 3 – The Next Generation
Zend/Expressive 3 – The Next Generation
 
Sieben Tipps für den Voice Commerce mit PHP
Sieben Tipps für den Voice Commerce mit PHPSieben Tipps für den Voice Commerce mit PHP
Sieben Tipps für den Voice Commerce mit PHP
 

Alexa Skills für Amazon Echo mit PHP entwickeln

  • 1. Alexa Skills für Amazon EchoAlexa Skills für Amazon Echo mit PHP entwickelnmit PHP entwickeln
  • 2. Ralf EggertRalf Eggert CEO Travello GmbH, Trainer, Autor, Coach,CEO Travello GmbH, Trainer, Autor, Coach, PHP Entwickler & Alexa Skill EntwicklerPHP Entwickler & Alexa Skill Entwickler
  • 4. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 44 vonvon 5858 AgendaAgenda Amazon Alexa Grundlagen  Skill vorbereiten  Warum PHP? Skill Code implementieren Meine Erkenntnisse 
  • 5. Amazon Alexa GrundlagenAmazon Alexa Grundlagen
  • 6. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 66 vonvon 5858 Wie funktioniert ein Alexa Request?Wie funktioniert ein Alexa Request? AWS Lambda Function Alexa Voice Service  
  • 7. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 77 vonvon 5858 Wie funktioniert ein Alexa Request?Wie funktioniert ein Alexa Request? AWS Lambda Function Alexa Voice Service  Voice Command 
  • 8. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 88 vonvon 5858 Wie funktioniert ein Alexa Request?Wie funktioniert ein Alexa Request? AWS Lambda Function Alexa Voice Service  Voice Command Voice Request 
  • 9. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 99 vonvon 5858 Wie funktioniert ein Alexa Request?Wie funktioniert ein Alexa Request? AWS Lambda Function Alexa Voice Service  Voice Command Voice Request JSON Request 
  • 10. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 1010 vonvon 5858 Wie funktioniert ein Alexa Request?Wie funktioniert ein Alexa Request? AWS Lambda Function Alexa Voice Service  Voice Command Voice Request JSON Request JSON Response
  • 11. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 1111 vonvon 5858 Wie funktioniert ein Alexa Request?Wie funktioniert ein Alexa Request? AWS Lambda Function Alexa Voice Service Text Response  Voice Command Voice Request JSON Request JSON Response
  • 12. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 1212 vonvon 5858 Wie funktioniert ein Alexa Request?Wie funktioniert ein Alexa Request? AWS Lambda Function Alexa Voice Service Text Response  Voice Response Card Response Voice Command Voice Request JSON Request JSON Response
  • 13. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 1313 vonvon 5858 Alternativer RequestAlternativer Request HTTPS Endpoint Server Alexa Voice Service Text Response  Voice Response Card Response Voice Command Voice Request JSON Request JSON Response
  • 14. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 1414 vonvon 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. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 1515 vonvon 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. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 1616 vonvon 5858 ASK ÜberblickASK Überblick
  • 17. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 1717 vonvon 5858 Alexa Skill BuilderAlexa Skill Builder
  • 18. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 1818 vonvon 5858 AWS Lambda FunctionsAWS Lambda Functions
  • 20. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 2020 vonvon 5858 Mögliche LösungsansätzeMögliche Lösungsansätze PHP für AWS kompilieren Unterstützte Runtime Engine für AWS einsetzen Eigenen HTTPS Endpoint Server einsetzen
  • 21. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 2121 vonvon 5858 Unterstützte Runtime Engine?Unterstützte Runtime Engine?
  • 22. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 2222 vonvon 5858 PHP für AWS Lambda kompilieren?PHP für AWS Lambda kompilieren? https://goo.gl/N9VVvb
  • 23. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 2323 vonvon 5858 Eigener HTTPS Endpoint Server?Eigener HTTPS Endpoint Server?
  • 24. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 2424 vonvon 5858 Lösung gefundenLösung gefunden PHP für AWS kompilieren Unterstützte Runtime Engine für AWS einsetzen Eigenen HTTPS Endpoint Server einsetzen
  • 25. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 2525 vonvon 5858 Nachteile eigener HTTPS EndpointNachteile eigener HTTPS Endpoint Einige Tools arbeiten nur mit Lambda (API, CLI) Eigene Library für Alexa aufbauen Server Administration
  • 26. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 2626 vonvon 5858 Vorteile eigener HTTPS EndpointVorteile eigener HTTPS Endpoint Jede gewünschte Software einsetzbar Vollständige Kontroller über die Serverumgebung Keine Datenschutzbedenken (weiche Bedenken)
  • 27. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 2727 vonvon 5858 Open-source PHP LibraryOpen-source PHP Library https://github.com/travello-gmbh/
  • 28. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 2828 vonvon 5858 Mein aktueller Tech StackMein aktueller Tech Stack
  • 30. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 3030 vonvon 5858 Beispieldialoge erstellenBeispieldialoge erstellen
  • 31. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 3131 vonvon 5858 Beispieldialog IBeispieldialog I Alexa, starte Mein Zoo!  Willkommen in deinem Zoo. Nenne mir ein Tier aus meinem Zoo!  Ein Elefant lebt in deinem Zoo. Danke Alexa.  Bitte!
  • 32. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 3232 vonvon 5858 Beispieldialog IIBeispieldialog II Alexa, starte Mein Zoo!  Willkommen in deinem Zoo. Wie viele Tiere leben in meinem Zoo?  In deinem Zoo leben 42 Tiere! Danke Alexa.  Bitte!
  • 33. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 3333 vonvon 5858 Flussdiagramme erstellenFlussdiagramme erstellen
  • 34. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 3434 vonvon 5858 FlussdiagrammFlussdiagramm Willkommen in deinem Zoo. Starte Mein Zoo Nenne mir ein Tier aus meinem Zoo! In deinem Zoo leben 42 Tiere! »nenne« »anzahl« »nenne« »anzahl« Bitte! »danke« »danke« »danke«
  • 35. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 3535 vonvon 5858 Alexa Skills Kit konfigurierenAlexa Skills Kit konfigurieren
  • 36. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 3636 vonvon 5858 Eigene Slot Types erstellenEigene Slot Types erstellen
  • 37. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 3737 vonvon 5858 Eigene Intents erstellenEigene Intents erstellen
  • 38. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 3838 vonvon 5858 HTTPS Endpoint konfigurierenHTTPS Endpoint konfigurieren
  • 39. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 3939 vonvon 5858 SSL Zertifikat konfigurierenSSL Zertifikat konfigurieren
  • 40. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 4040 vonvon 5858 HTTPS Endpoint testenHTTPS Endpoint testen
  • 41. Skill Code implementierenSkill Code implementieren
  • 42. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 4242 vonvon 5858 Beispielanwendung installierenBeispielanwendung installieren $ git clone https://github.com/travello-gmbh/example-zoo-skill $ cd example-zoo-skill $ composer install $ sudo chmod -R 777 data/cache/ // Virtual Host für http://example-zoo-skill einrichte // mit dem Pfad example-zoo-skill/html/ als Doc Root
  • 43. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 4343 vonvon 5858 Beispielanwendung testenBeispielanwendung testen /data/postman/collection.json
  • 44. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 4444 vonvon 5858 Textdatei aktualisierenTextdatei aktualisieren 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. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 4545 vonvon 5858 Texthelfer Klasse erstellenTexthelfer Klasse erstellen <?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. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 4646 vonvon 5858 Zoo Anwendung erstellen IZoo Anwendung erstellen 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. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 4747 vonvon 5858 Zoo Anwendung erstellen IIZoo Anwendung erstellen II <?php namespace ZooApplication; use TravelloAlexaLibraryResponseCardStandard; use TravelloAlexaLibraryResponseOutputSpeechSSML; class ZooApplication extends AbstractAlexaApplication { private function animalIntent(): bool { $zooMessage = $this->textHelper->getAnimalMessage('Ein Elefant'); $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. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 4848 vonvon 5858 Zoo Anwendung testenZoo Anwendung testen /data/postman/collection.json
  • 49. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 4949 vonvon 5858 Weitere FeaturesWeitere Features Session Attribute step2→ Zweiter Intent step4→ https://github.com/travello-gmbh/example-zoo-skill Slot type Tierarten step3→
  • 50. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 5050 vonvon 5858 In Kürze in der Library 2.0In Kürze in der Library 2.0 https://github.com/travello-gmbh/amazon-alexa-skill-library Einführung von Intent-Klassen Automatische Intent-Verarbeitung
  • 52. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 5252 vonvon 5858 Früher ErfolgFrüher Erfolg 6 Monate Top 10 Aktivierte Skills 75.000 Kunden bisher 64 Kundenbewertungen bisher 2.500.000 »Utterances« bisher Meist genutzter Skill (DE) in 05/2017
  • 53. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 5353 vonvon 5858 Größte HerausforderungenGrößte Herausforderungen Slot Type für deutsche Vorname Signaturvalidierung Kategorie Slot Type Intents→ Chance ersten Skill abzuschießen Zweiter Server für Tests Komplexeres VUI / CUI
  • 54. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 5454 vonvon 5858 ZertifizierungsprozessZertifizierungsprozess 7 Tage für Feedback (02/2017) Signaturvalidierung Problem 16 Stunden bis Live (07/2017) Invocation Name Problem 0 Probleme »Abbrechen« Intent Problem
  • 55. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 5555 vonvon 5858 Zahlen zur EntwicklungZahlen zur Entwicklung 10 Arbeitstage zusammen 80% für Infrastruktur Code 15 Arbeitstage zusammen 90% für Skill Code 20% für Skill Code 10% für Infrastruktur Code
  • 56. code.talks 2017code.talks 2017Ralf EggertRalf Eggert 5656 vonvon 5858 Wichtigste ErkenntnisseWichtigste Erkenntnisse Mit einfachem Skill beginnen Gründlich testen Solide Code Basis schreiben Mehr als einen Skill erstellen Durchdachte VUI erstellen Slot-Types nicht blind vertrauen Spaß haben!
  • 58. Danke!Danke! Mail: ralf@travello.audioMail: ralf@travello.audio Web: www.travello.audioWeb: www.travello.audio