SlideShare a Scribd company logo
1 of 47
Download to read offline
Control your Voice
like a Bene Gesserit
Jorge D. Ortiz Fuentes
@jdortiz
A Canonical
Examples
Production
@jdortiz
Agenda
★ Context
★ Voice User Interfaces 101
★ Advanced Architecture Brief
★ VUI + Adv. Architecture
★ Lessons Learned
Warning
Sorry!
Put all your devices
in non listening
mode
Some
Context
Living like a 3rd
Stage Guild Navigator
@jdortiz
The Request
★ Existing App
★ Refactored to an Advanced Architecture
★ Wanted to explore VUI
★ Prototype with minimum cost
Voice User
Interfaces
101
Welcome to the
Future
@jdortiz
Maybe not as good as we
wished (YET)
★ “Sorry. I don’t know that one” “Sorry about
that. I’m still learning”
★ English, German, French, Japanese (Voice
interaction)
★ Private actions
The Contenders
Alexa Google Home SiriCortana
– Bene Genesserit
“I must not fear. Fear is the mind-killer.
Fear is the little-death that brings total
obliteration. I will face my fear.”
The Guts
Domain 1
Domain 2
Domain 3
Domain n
Routing
Natural
Language
Processing
Automatic
Speech
Recognition
Text to
Speech
Voice ➡
Voice
Text
Domain &
Intent &
Parameters
Text
Domain nDomain n
Extend the System
JSON ➡
JSON
HTTPS
Parse
Request
Do Your
Stuff
Build
Response
@jdortiz
Development
★ Node JS library (Alexa Skills & Google
Actions)
★ Also Alexa SDK for Java(/Kotlin)
★ Several unofficial ones
@jdortiz
var routes = Routes()
routes.add(method: .post, uri: “/") { request, response in
defer {
response.completed()
}
if let postString = request.postBodyString,
let data = postString.data(using:.utf8) {
let reply = AlexaServiceResponse(version: "1.0",
response: AlexaResponse(outputSpeech:
OutputSpeech(text: "Hello. I am your Genie. How can I help
you?",
type: .plaintext)))
let encoder = JSONEncoder()
let responseData = try! encoder.encode(reply)
let responseString = String(bytes: responseData, encoding: .utf8) !?? ""
response.setHeader(.contentType, value: "application/json")
response.setBody(string: responseString)
} else {
response.badRequest(message: "No request data found.")
}
}
@jdortiz
var routes = Routes()
routes.add(method: .post, uri: “/") { request, response in
defer {
response.completed()
}
if let postString = request.postBodyString,
let data = postString.data(using:.utf8) {
let reply = GAV1ServiceResponse(speech:
"Hello. I am your Genie. How can I help you?",
data:
gaServiceRequest.originalRequest.data)
let encoder = JSONEncoder()
let responseData = try! encoder.encode(reply)
let responseString = String(bytes: responseData, encoding: .utf8) !??
""
response.setHeader(.contentType, value: "application/json")
response.setBody(string: responseString)
} else {
response.badRequest(message: "No request data found.")
}
}
OK
But…
Why do I need a
good architecture?
Advanced
Architecture
@jdortiz
Persistance FW
View
Network
LocationFW
Presenter
Entity Gateway
Clean Architecture
Interactor
Entity
Advanced Architecture:
Mobile
App
Delegate /
Application
View (VC)
/ Activity
Presenter Use Case
Entity
Gateway
Connector
Tap on
phone button
User wants
to talk to
contact
Start call
if…
Get
contact
details
@jdortiz
Injecting Dependencies
View
Presenter
UseCaseFactory
Entity
Gateway
Connector
VUI +
Advanced
Architecture
Kwisatz Haderach
Advanced Architecture
VUI
Server
UI Presenter Use Case
Entity
Gateway
Connector
Reuse
Domain
Logic
Intent
StartCall
User wants
to talk to
contact
Start call
if…
Get
contact
details
Lessons
Learned
– Dune, Frank Herbert
“Muad'Dib learned rapidly because his first
training was in how to learn. And the first
lesson of all was the basic trust that he
could learn… Muad'Dib knew that
every experience carries its lesson.”
The not-so-relevant
Technical Stuff
@jdortiz
Implementation Details
★ Rebuild your Model (Alexa Skills)
★ Lots of corner cases in Codable
★ Documentation of the JSON requests /
responses could be better
@jdortiz
var routes = Routes()
routes.add(method: .post,
uri: “/alexa/“,
handler: alexaRequestHandler)
routes.add(method: .post,
uri: “/gaction/“,
handler: gactionRequestHandler)
let server = HTTPServer()
server.addRoutes(routes)
server.serverPort = UInt16(httpPort)
do {
try server.start()
} catch PerfectError.networkError(let err, let msg) {
LogFile.debug("Network error thrown: (err) (msg)")
}
@jdortiz
func gactionRequestHander(request: HTTPRequest, response: HTTPResponse) {
defer {
response.completed()
}
LogFile.info("!>> Google Action Service Request received !>>")
if let postString = request.postBodyString,
let data = postString.data(using:.utf8) {
do {
let decoder = JSONDecoder()
let gaRequest = try decoder.decode(GAV1ServiceRequest.self, from: data)
let reply = try gaction.process(serviceRequest: gaRequest)
let encoder = JSONEncoder()
let responseData = try! encoder.encode(reply)
let responseString = String(bytes: responseData, encoding: .utf8) !?? ""
LogFile.debug("Response: (responseString)")
response.appendBody(string: responseString)
response.setHeader(.contentType, value: "application/json")
} catch let error as GActionError {
response.append(error: error)
LogFile.error("Google Action error: (error)”)
} catch let error {
response.badRequest(message: "Request data is wrong.")
LogFile.error("Error decoding request: (error)")
}
} else {
response.badRequest(message: "No request data found.")
LogFile.error("No request data found.")
}
}
@jdortiz
let skill = AlexaSkill(id: appId,
welcomeMessage: "Welcome to Family Chores.
How can I help you?",
logger: GenericLogger())
skill.register(controller: RecordTaskAlexaUIController(),
forIntent: "RecordTask")
let connector = PersonReportAlexaConnector()
skill.register(controller: PersonReportAlexaController(),
forIntent: "PersonReport")
@jdortiz
protocol AlexaUIController {
func process(serviceRequest: ASServiceRequest) throws !-> ASServiceResponse
}
class AlexaSkill { !//…
func process(serviceRequest: ASServiceRequest) throws !-> ASServiceResponse {
guard serviceRequest.safetyCheck(id: id) else {
throw SkillError.wrongSkillId
}
switch serviceRequest.request.type {
case .launch:
return serviceRequest.reply(message: welcomeMessage)
case let ASRequestType.intent(data: intentData):
if let controller = controllerMap[intentData.name] {
return try controller.process(serviceRequest: serviceRequest)
} else {
throw SkillError.undefinedIntent
}
case .sessionEnd:
return serviceRequest.end()
}
}
}
Identity & Flow
@jdortiz
Flow
★ Don’t make your users talk their way
through
★ Straight from A -> B
But wait!
There is concurrency
@jdortiz
skill.register(controller: PersonReportAlexaController(),
forIntent: "PersonReport")
@jdortiz
skill.register(connector = PersonReportAlexaConnector(),
forIntent: "PersonReport")
Fast Prototyping
@jdortiz
Quality Time
★ Avoid duplication to address both platforms
★ Ignore the DB
★ Reuse and extend use cases
Recap
@jdortiz
Key Takeaways
★ Having (/Going to) an Advanced
Architecture is key
★ Pros & Cons of own API interface
★ Easy Prototyping
★ Speak what you wish /Use what you wish
Bedankt!
Thank
You!
@jdortiz

More Related Content

What's hot

Java Development with MongoDB
Java Development with MongoDBJava Development with MongoDB
Java Development with MongoDBScott Hernandez
 
The Ring programming language version 1.7 book - Part 14 of 196
The Ring programming language version 1.7 book - Part 14 of 196The Ring programming language version 1.7 book - Part 14 of 196
The Ring programming language version 1.7 book - Part 14 of 196Mahmoud Samir Fayed
 
JNI - Java & C in the same project
JNI - Java & C in the same projectJNI - Java & C in the same project
JNI - Java & C in the same projectKarol Wrótniak
 
What do you mean, Backwards Compatibility?
What do you mean, Backwards Compatibility?What do you mean, Backwards Compatibility?
What do you mean, Backwards Compatibility?Trisha Gee
 
Jsonsaga 100605143125-phpapp02
Jsonsaga 100605143125-phpapp02Jsonsaga 100605143125-phpapp02
Jsonsaga 100605143125-phpapp02Ramamohan Chokkam
 
Introduction to Python
Introduction to PythonIntroduction to Python
Introduction to PythonKHNOG
 
Automatically generating-json-from-java-objects-java-objects268
Automatically generating-json-from-java-objects-java-objects268Automatically generating-json-from-java-objects-java-objects268
Automatically generating-json-from-java-objects-java-objects268Ramamohan Chokkam
 
Alexander Mostovenko "Modern approach to localization in javascript with the ...
Alexander Mostovenko "Modern approach to localization in javascript with the ...Alexander Mostovenko "Modern approach to localization in javascript with the ...
Alexander Mostovenko "Modern approach to localization in javascript with the ...OdessaJS Conf
 
Simple fuzzy Name Matching in Elasticsearch - Graham Morehead
Simple fuzzy Name Matching in Elasticsearch - Graham MoreheadSimple fuzzy Name Matching in Elasticsearch - Graham Morehead
Simple fuzzy Name Matching in Elasticsearch - Graham MoreheadBasis Technology
 
RESTing with the new Yandex.Disk API, Clemens Аuer
RESTing with the new Yandex.Disk API, Clemens АuerRESTing with the new Yandex.Disk API, Clemens Аuer
RESTing with the new Yandex.Disk API, Clemens АuerYandex
 
Building a Gigaword Corpus (PyCon 2017)
Building a Gigaword Corpus (PyCon 2017)Building a Gigaword Corpus (PyCon 2017)
Building a Gigaword Corpus (PyCon 2017)Rebecca Bilbro
 
GPars (Groovy Parallel Systems)
GPars (Groovy Parallel Systems)GPars (Groovy Parallel Systems)
GPars (Groovy Parallel Systems)Gagan Agrawal
 
Spring Data JPA from 0-100 in 60 minutes
Spring Data JPA from 0-100 in 60 minutesSpring Data JPA from 0-100 in 60 minutes
Spring Data JPA from 0-100 in 60 minutesVMware Tanzu
 
Logging your node.js application
Logging your node.js applicationLogging your node.js application
Logging your node.js applicationMd. Sohel Rana
 

What's hot (20)

Java Development with MongoDB
Java Development with MongoDBJava Development with MongoDB
Java Development with MongoDB
 
Access Control
Access ControlAccess Control
Access Control
 
The Ring programming language version 1.7 book - Part 14 of 196
The Ring programming language version 1.7 book - Part 14 of 196The Ring programming language version 1.7 book - Part 14 of 196
The Ring programming language version 1.7 book - Part 14 of 196
 
Procesamiento del lenguaje natural con python
Procesamiento del lenguaje natural con pythonProcesamiento del lenguaje natural con python
Procesamiento del lenguaje natural con python
 
JNI - Java & C in the same project
JNI - Java & C in the same projectJNI - Java & C in the same project
JNI - Java & C in the same project
 
What do you mean, Backwards Compatibility?
What do you mean, Backwards Compatibility?What do you mean, Backwards Compatibility?
What do you mean, Backwards Compatibility?
 
Jsonsaga 100605143125-phpapp02
Jsonsaga 100605143125-phpapp02Jsonsaga 100605143125-phpapp02
Jsonsaga 100605143125-phpapp02
 
Introduction to Python
Introduction to PythonIntroduction to Python
Introduction to Python
 
Automatically generating-json-from-java-objects-java-objects268
Automatically generating-json-from-java-objects-java-objects268Automatically generating-json-from-java-objects-java-objects268
Automatically generating-json-from-java-objects-java-objects268
 
Cpp lab 13_pres
Cpp lab 13_presCpp lab 13_pres
Cpp lab 13_pres
 
Json the-x-in-ajax1588
Json the-x-in-ajax1588Json the-x-in-ajax1588
Json the-x-in-ajax1588
 
Alexander Mostovenko "Modern approach to localization in javascript with the ...
Alexander Mostovenko "Modern approach to localization in javascript with the ...Alexander Mostovenko "Modern approach to localization in javascript with the ...
Alexander Mostovenko "Modern approach to localization in javascript with the ...
 
J s-o-n-120219575328402-3
J s-o-n-120219575328402-3J s-o-n-120219575328402-3
J s-o-n-120219575328402-3
 
Simple fuzzy Name Matching in Elasticsearch - Graham Morehead
Simple fuzzy Name Matching in Elasticsearch - Graham MoreheadSimple fuzzy Name Matching in Elasticsearch - Graham Morehead
Simple fuzzy Name Matching in Elasticsearch - Graham Morehead
 
RESTing with the new Yandex.Disk API, Clemens Аuer
RESTing with the new Yandex.Disk API, Clemens АuerRESTing with the new Yandex.Disk API, Clemens Аuer
RESTing with the new Yandex.Disk API, Clemens Аuer
 
Building a Gigaword Corpus (PyCon 2017)
Building a Gigaword Corpus (PyCon 2017)Building a Gigaword Corpus (PyCon 2017)
Building a Gigaword Corpus (PyCon 2017)
 
GPars (Groovy Parallel Systems)
GPars (Groovy Parallel Systems)GPars (Groovy Parallel Systems)
GPars (Groovy Parallel Systems)
 
Groovy.pptx
Groovy.pptxGroovy.pptx
Groovy.pptx
 
Spring Data JPA from 0-100 in 60 minutes
Spring Data JPA from 0-100 in 60 minutesSpring Data JPA from 0-100 in 60 minutes
Spring Data JPA from 0-100 in 60 minutes
 
Logging your node.js application
Logging your node.js applicationLogging your node.js application
Logging your node.js application
 

Similar to Control your Voice like a Bene Gesserit

Value protocols and codables
Value protocols and codablesValue protocols and codables
Value protocols and codablesFlorent Vilmart
 
Ajax for dummies, and not only.
Ajax for dummies, and not only.Ajax for dummies, and not only.
Ajax for dummies, and not only.Nerd Tzanetopoulos
 
CouchDB on Android
CouchDB on AndroidCouchDB on Android
CouchDB on AndroidSven Haiges
 
Typescript - why it's awesome
Typescript - why it's awesomeTypescript - why it's awesome
Typescript - why it's awesomePiotr Miazga
 
Windows 8 JavaScript (Wonderland)
Windows 8 JavaScript (Wonderland)Windows 8 JavaScript (Wonderland)
Windows 8 JavaScript (Wonderland)Christopher Bennage
 
Hacking google cloud run
Hacking google cloud runHacking google cloud run
Hacking google cloud runAviv Laufer
 
Akka with Scala
Akka with ScalaAkka with Scala
Akka with ScalaOto Brglez
 
async/await in Swift
async/await in Swiftasync/await in Swift
async/await in SwiftPeter Friese
 
node.js practical guide to serverside javascript
node.js practical guide to serverside javascriptnode.js practical guide to serverside javascript
node.js practical guide to serverside javascriptEldar Djafarov
 
{"JSON, Swift and Type Safety" : "It's a wrap"}
{"JSON, Swift and Type Safety" : "It's a wrap"}{"JSON, Swift and Type Safety" : "It's a wrap"}
{"JSON, Swift and Type Safety" : "It's a wrap"}Anthony Levings
 
Node Powered Mobile
Node Powered MobileNode Powered Mobile
Node Powered MobileTim Caswell
 
Java script at backend nodejs
Java script at backend   nodejsJava script at backend   nodejs
Java script at backend nodejsAmit Thakkar
 
Building android apps with kotlin
Building android apps with kotlinBuilding android apps with kotlin
Building android apps with kotlinShem Magnezi
 
What can be done with Java, but should better be done with Erlang (@pavlobaron)
What can be done with Java, but should better be done with Erlang (@pavlobaron)What can be done with Java, but should better be done with Erlang (@pavlobaron)
What can be done with Java, but should better be done with Erlang (@pavlobaron)Pavlo Baron
 

Similar to Control your Voice like a Bene Gesserit (20)

Go react codelab
Go react codelabGo react codelab
Go react codelab
 
Value protocols and codables
Value protocols and codablesValue protocols and codables
Value protocols and codables
 
Ajax for dummies, and not only.
Ajax for dummies, and not only.Ajax for dummies, and not only.
Ajax for dummies, and not only.
 
CouchDB on Android
CouchDB on AndroidCouchDB on Android
CouchDB on Android
 
Node.js - A Quick Tour
Node.js - A Quick TourNode.js - A Quick Tour
Node.js - A Quick Tour
 
Socket.io
Socket.ioSocket.io
Socket.io
 
Typescript - why it's awesome
Typescript - why it's awesomeTypescript - why it's awesome
Typescript - why it's awesome
 
Windows 8 JavaScript (Wonderland)
Windows 8 JavaScript (Wonderland)Windows 8 JavaScript (Wonderland)
Windows 8 JavaScript (Wonderland)
 
NodeJS
NodeJSNodeJS
NodeJS
 
Hacking google cloud run
Hacking google cloud runHacking google cloud run
Hacking google cloud run
 
Akka with Scala
Akka with ScalaAkka with Scala
Akka with Scala
 
Trimming The Cruft
Trimming The CruftTrimming The Cruft
Trimming The Cruft
 
async/await in Swift
async/await in Swiftasync/await in Swift
async/await in Swift
 
node.js practical guide to serverside javascript
node.js practical guide to serverside javascriptnode.js practical guide to serverside javascript
node.js practical guide to serverside javascript
 
{"JSON, Swift and Type Safety" : "It's a wrap"}
{"JSON, Swift and Type Safety" : "It's a wrap"}{"JSON, Swift and Type Safety" : "It's a wrap"}
{"JSON, Swift and Type Safety" : "It's a wrap"}
 
Node.js - Best practices
Node.js  - Best practicesNode.js  - Best practices
Node.js - Best practices
 
Node Powered Mobile
Node Powered MobileNode Powered Mobile
Node Powered Mobile
 
Java script at backend nodejs
Java script at backend   nodejsJava script at backend   nodejs
Java script at backend nodejs
 
Building android apps with kotlin
Building android apps with kotlinBuilding android apps with kotlin
Building android apps with kotlin
 
What can be done with Java, but should better be done with Erlang (@pavlobaron)
What can be done with Java, but should better be done with Erlang (@pavlobaron)What can be done with Java, but should better be done with Erlang (@pavlobaron)
What can be done with Java, but should better be done with Erlang (@pavlobaron)
 

More from Jorge Ortiz

Tell Me Quando - Implementing Feature Flags
Tell Me Quando - Implementing Feature FlagsTell Me Quando - Implementing Feature Flags
Tell Me Quando - Implementing Feature FlagsJorge Ortiz
 
Unit Test your Views
Unit Test your ViewsUnit Test your Views
Unit Test your ViewsJorge Ortiz
 
Kata gilded rose en Golang
Kata gilded rose en GolangKata gilded rose en Golang
Kata gilded rose en GolangJorge Ortiz
 
CYA: Cover Your App
CYA: Cover Your AppCYA: Cover Your App
CYA: Cover Your AppJorge Ortiz
 
Refactor your way forward
Refactor your way forwardRefactor your way forward
Refactor your way forwardJorge Ortiz
 
201710 Fly Me to the View - iOS Conf SG
201710 Fly Me to the View - iOS Conf SG201710 Fly Me to the View - iOS Conf SG
201710 Fly Me to the View - iOS Conf SGJorge Ortiz
 
Home Improvement: Architecture & Kotlin
Home Improvement: Architecture & KotlinHome Improvement: Architecture & Kotlin
Home Improvement: Architecture & KotlinJorge Ortiz
 
Architectural superpowers
Architectural superpowersArchitectural superpowers
Architectural superpowersJorge Ortiz
 
Architecting Alive Apps
Architecting Alive AppsArchitecting Alive Apps
Architecting Alive AppsJorge Ortiz
 
iOS advanced architecture workshop 3h edition
iOS advanced architecture workshop 3h editioniOS advanced architecture workshop 3h edition
iOS advanced architecture workshop 3h editionJorge Ortiz
 
Android clean architecture workshop 3h edition
Android clean architecture workshop 3h editionAndroid clean architecture workshop 3h edition
Android clean architecture workshop 3h editionJorge Ortiz
 
To Protect & To Serve
To Protect & To ServeTo Protect & To Serve
To Protect & To ServeJorge Ortiz
 
Clean architecture workshop
Clean architecture workshopClean architecture workshop
Clean architecture workshopJorge Ortiz
 
Escape from Mars
Escape from MarsEscape from Mars
Escape from MarsJorge Ortiz
 
Why the Dark Side should use Swift and a SOLID Architecture
Why the Dark Side should use Swift and a SOLID ArchitectureWhy the Dark Side should use Swift and a SOLID Architecture
Why the Dark Side should use Swift and a SOLID ArchitectureJorge Ortiz
 
Dependence day insurgence
Dependence day insurgenceDependence day insurgence
Dependence day insurgenceJorge Ortiz
 
Architectural superpowers
Architectural superpowersArchitectural superpowers
Architectural superpowersJorge Ortiz
 
TDD for the masses
TDD for the massesTDD for the masses
TDD for the massesJorge Ortiz
 
7 Stages of Unit Testing in iOS
7 Stages of Unit Testing in iOS7 Stages of Unit Testing in iOS
7 Stages of Unit Testing in iOSJorge Ortiz
 
Building for perfection
Building for perfectionBuilding for perfection
Building for perfectionJorge Ortiz
 

More from Jorge Ortiz (20)

Tell Me Quando - Implementing Feature Flags
Tell Me Quando - Implementing Feature FlagsTell Me Quando - Implementing Feature Flags
Tell Me Quando - Implementing Feature Flags
 
Unit Test your Views
Unit Test your ViewsUnit Test your Views
Unit Test your Views
 
Kata gilded rose en Golang
Kata gilded rose en GolangKata gilded rose en Golang
Kata gilded rose en Golang
 
CYA: Cover Your App
CYA: Cover Your AppCYA: Cover Your App
CYA: Cover Your App
 
Refactor your way forward
Refactor your way forwardRefactor your way forward
Refactor your way forward
 
201710 Fly Me to the View - iOS Conf SG
201710 Fly Me to the View - iOS Conf SG201710 Fly Me to the View - iOS Conf SG
201710 Fly Me to the View - iOS Conf SG
 
Home Improvement: Architecture & Kotlin
Home Improvement: Architecture & KotlinHome Improvement: Architecture & Kotlin
Home Improvement: Architecture & Kotlin
 
Architectural superpowers
Architectural superpowersArchitectural superpowers
Architectural superpowers
 
Architecting Alive Apps
Architecting Alive AppsArchitecting Alive Apps
Architecting Alive Apps
 
iOS advanced architecture workshop 3h edition
iOS advanced architecture workshop 3h editioniOS advanced architecture workshop 3h edition
iOS advanced architecture workshop 3h edition
 
Android clean architecture workshop 3h edition
Android clean architecture workshop 3h editionAndroid clean architecture workshop 3h edition
Android clean architecture workshop 3h edition
 
To Protect & To Serve
To Protect & To ServeTo Protect & To Serve
To Protect & To Serve
 
Clean architecture workshop
Clean architecture workshopClean architecture workshop
Clean architecture workshop
 
Escape from Mars
Escape from MarsEscape from Mars
Escape from Mars
 
Why the Dark Side should use Swift and a SOLID Architecture
Why the Dark Side should use Swift and a SOLID ArchitectureWhy the Dark Side should use Swift and a SOLID Architecture
Why the Dark Side should use Swift and a SOLID Architecture
 
Dependence day insurgence
Dependence day insurgenceDependence day insurgence
Dependence day insurgence
 
Architectural superpowers
Architectural superpowersArchitectural superpowers
Architectural superpowers
 
TDD for the masses
TDD for the massesTDD for the masses
TDD for the masses
 
7 Stages of Unit Testing in iOS
7 Stages of Unit Testing in iOS7 Stages of Unit Testing in iOS
7 Stages of Unit Testing in iOS
 
Building for perfection
Building for perfectionBuilding for perfection
Building for perfection
 

Recently uploaded

Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesKrzysztofKkol1
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfRTS corp
 
Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsStrategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsJean Silva
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingShane Coughlan
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxRTS corp
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesVictoriaMetrics
 
Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITmanoharjgpsolutions
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLionel Briand
 
SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?Alexandre Beguel
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldRoberto Pérez Alcolea
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slidesvaideheekore1
 
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdfAndrey Devyatkin
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jGraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jNeo4j
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxRTS corp
 

Recently uploaded (20)

Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
 
Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsStrategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero results
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 Updates
 
Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh IT
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and Repair
 
SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository world
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slides
 
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jGraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
 

Control your Voice like a Bene Gesserit

  • 1. Control your Voice like a Bene Gesserit Jorge D. Ortiz Fuentes @jdortiz
  • 3. @jdortiz Agenda ★ Context ★ Voice User Interfaces 101 ★ Advanced Architecture Brief ★ VUI + Adv. Architecture ★ Lessons Learned
  • 6. Put all your devices in non listening mode
  • 8. Living like a 3rd Stage Guild Navigator
  • 9. @jdortiz The Request ★ Existing App ★ Refactored to an Advanced Architecture ★ Wanted to explore VUI ★ Prototype with minimum cost
  • 12. @jdortiz Maybe not as good as we wished (YET) ★ “Sorry. I don’t know that one” “Sorry about that. I’m still learning” ★ English, German, French, Japanese (Voice interaction) ★ Private actions
  • 13. The Contenders Alexa Google Home SiriCortana
  • 14. – Bene Genesserit “I must not fear. Fear is the mind-killer. Fear is the little-death that brings total obliteration. I will face my fear.”
  • 15. The Guts Domain 1 Domain 2 Domain 3 Domain n Routing Natural Language Processing Automatic Speech Recognition Text to Speech Voice ➡ Voice Text Domain & Intent & Parameters Text
  • 16. Domain nDomain n Extend the System JSON ➡ JSON HTTPS Parse Request Do Your Stuff Build Response
  • 17. @jdortiz Development ★ Node JS library (Alexa Skills & Google Actions) ★ Also Alexa SDK for Java(/Kotlin) ★ Several unofficial ones
  • 18. @jdortiz var routes = Routes() routes.add(method: .post, uri: “/") { request, response in defer { response.completed() } if let postString = request.postBodyString, let data = postString.data(using:.utf8) { let reply = AlexaServiceResponse(version: "1.0", response: AlexaResponse(outputSpeech: OutputSpeech(text: "Hello. I am your Genie. How can I help you?", type: .plaintext))) let encoder = JSONEncoder() let responseData = try! encoder.encode(reply) let responseString = String(bytes: responseData, encoding: .utf8) !?? "" response.setHeader(.contentType, value: "application/json") response.setBody(string: responseString) } else { response.badRequest(message: "No request data found.") } }
  • 19. @jdortiz var routes = Routes() routes.add(method: .post, uri: “/") { request, response in defer { response.completed() } if let postString = request.postBodyString, let data = postString.data(using:.utf8) { let reply = GAV1ServiceResponse(speech: "Hello. I am your Genie. How can I help you?", data: gaServiceRequest.originalRequest.data) let encoder = JSONEncoder() let responseData = try! encoder.encode(reply) let responseString = String(bytes: responseData, encoding: .utf8) !?? "" response.setHeader(.contentType, value: "application/json") response.setBody(string: responseString) } else { response.badRequest(message: "No request data found.") } }
  • 20. OK But… Why do I need a good architecture?
  • 23. Advanced Architecture: Mobile App Delegate / Application View (VC) / Activity Presenter Use Case Entity Gateway Connector Tap on phone button User wants to talk to contact Start call if… Get contact details
  • 27. Advanced Architecture VUI Server UI Presenter Use Case Entity Gateway Connector Reuse Domain Logic Intent StartCall User wants to talk to contact Start call if… Get contact details
  • 29. – Dune, Frank Herbert “Muad'Dib learned rapidly because his first training was in how to learn. And the first lesson of all was the basic trust that he could learn… Muad'Dib knew that every experience carries its lesson.”
  • 31. @jdortiz Implementation Details ★ Rebuild your Model (Alexa Skills) ★ Lots of corner cases in Codable ★ Documentation of the JSON requests / responses could be better
  • 32. @jdortiz var routes = Routes() routes.add(method: .post, uri: “/alexa/“, handler: alexaRequestHandler) routes.add(method: .post, uri: “/gaction/“, handler: gactionRequestHandler) let server = HTTPServer() server.addRoutes(routes) server.serverPort = UInt16(httpPort) do { try server.start() } catch PerfectError.networkError(let err, let msg) { LogFile.debug("Network error thrown: (err) (msg)") }
  • 33. @jdortiz func gactionRequestHander(request: HTTPRequest, response: HTTPResponse) { defer { response.completed() } LogFile.info("!>> Google Action Service Request received !>>") if let postString = request.postBodyString, let data = postString.data(using:.utf8) { do { let decoder = JSONDecoder() let gaRequest = try decoder.decode(GAV1ServiceRequest.self, from: data) let reply = try gaction.process(serviceRequest: gaRequest) let encoder = JSONEncoder() let responseData = try! encoder.encode(reply) let responseString = String(bytes: responseData, encoding: .utf8) !?? "" LogFile.debug("Response: (responseString)") response.appendBody(string: responseString) response.setHeader(.contentType, value: "application/json") } catch let error as GActionError { response.append(error: error) LogFile.error("Google Action error: (error)”) } catch let error { response.badRequest(message: "Request data is wrong.") LogFile.error("Error decoding request: (error)") } } else { response.badRequest(message: "No request data found.") LogFile.error("No request data found.") } }
  • 34. @jdortiz let skill = AlexaSkill(id: appId, welcomeMessage: "Welcome to Family Chores. How can I help you?", logger: GenericLogger()) skill.register(controller: RecordTaskAlexaUIController(), forIntent: "RecordTask") let connector = PersonReportAlexaConnector() skill.register(controller: PersonReportAlexaController(), forIntent: "PersonReport")
  • 35. @jdortiz protocol AlexaUIController { func process(serviceRequest: ASServiceRequest) throws !-> ASServiceResponse } class AlexaSkill { !//… func process(serviceRequest: ASServiceRequest) throws !-> ASServiceResponse { guard serviceRequest.safetyCheck(id: id) else { throw SkillError.wrongSkillId } switch serviceRequest.request.type { case .launch: return serviceRequest.reply(message: welcomeMessage) case let ASRequestType.intent(data: intentData): if let controller = controllerMap[intentData.name] { return try controller.process(serviceRequest: serviceRequest) } else { throw SkillError.undefinedIntent } case .sessionEnd: return serviceRequest.end() } } }
  • 37. @jdortiz Flow ★ Don’t make your users talk their way through ★ Straight from A -> B
  • 38. But wait! There is concurrency
  • 42. @jdortiz Quality Time ★ Avoid duplication to address both platforms ★ Ignore the DB ★ Reuse and extend use cases
  • 43. Recap
  • 44. @jdortiz Key Takeaways ★ Having (/Going to) an Advanced Architecture is key ★ Pros & Cons of own API interface ★ Easy Prototyping ★ Speak what you wish /Use what you wish