Getting started with Smart Speakers & Voice Interfaces Ben - - PowerPoint PPT Presentation

getting started with smart speakers voice interfaces
SMART_READER_LITE
LIVE PREVIEW

Getting started with Smart Speakers & Voice Interfaces Ben - - PowerPoint PPT Presentation

Getting started with Smart Speakers & Voice Interfaces Ben Teese Darren Cibis What were going to do Demo Amazon Echo Google Home Parting thoughts Demo The Interweb Amazon Echo Lambda Alexa Skill Function The Lambda


slide-1
SLIDE 1

Getting started with Smart Speakers & Voice Interfaces

Ben Teese Darren Cibis

slide-2
SLIDE 2

What we’re going to do

  • Demo
  • Amazon Echo
  • Google Home
  • Parting thoughts
slide-3
SLIDE 3

Demo

slide-4
SLIDE 4
slide-5
SLIDE 5
slide-6
SLIDE 6

The Interweb

slide-7
SLIDE 7

Amazon Echo

slide-8
SLIDE 8

Alexa Skill

Lambda Function

slide-9
SLIDE 9
slide-10
SLIDE 10
slide-11
SLIDE 11
slide-12
SLIDE 12
slide-13
SLIDE 13
slide-14
SLIDE 14

The Lambda Function

exports.handler = function(event, context, callback) { const request = event.request; const session = event.session; const type = request.type; if (type === 'LaunchRequest') { … } else if (type === 'IntentRequest') {

  • nIntent(request, session, callback);

} else { … } };

slide-15
SLIDE 15

Drilling in…

function onIntent(request, session, callback) { const intent = request.intent; const intentName = intent.name; if (intentName === 'AMAZON.HelpIntent') { … } else if (intentName === 'AMAZON.StopIntent') { … } else if (intentName === 'SetLampColour') { setLampColor(intent, session, callback); } }

slide-16
SLIDE 16

function setLampColor(intent, session, callback) {

const position = intent.slots.position.value || session.attributes.position; let newSessionAttributes, responseText; if (position) { const colour = intent.slots.colour.value; newSessionAttributes = { position }; responseText = "Setting " + position + " lamp colour to " + colour; // Call Lif-X service with the position and colour … } else { responseText = "I'm not sure which lamp you want to use. Please try again.”; } callback(null, { version: '1.0', sessionAttributes: newSessionAttributes, response: {

  • utputSpeech: {

type: ‘PlainText', text: responseText, }, shouldEndSession: false } }); }

slide-17
SLIDE 17
slide-18
SLIDE 18
slide-19
SLIDE 19
slide-20
SLIDE 20

Alexa Skill Key Concepts

  • Intents
  • Sample Utterances
  • Slots
  • Dialog Model
slide-21
SLIDE 21

Google Home

slide-22
SLIDE 22

Actions on Google

Cloud Function

API.AI Agent

slide-23
SLIDE 23
slide-24
SLIDE 24

Cloud Function

exports.apiDemo = function apiDemo (req, res) { const http = require(‘https'); var color = req.body.result.parameters.Color; var position = req.body.result.parameters.Position; const options = { protocol: "https:", hostname: "api.lifx.com", path: "/v1/lights/label:" + position + "/state", method: "PUT", headers: {"Authorization": "Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"} }; const httpReq = http.request(options); httpReq.on('error', (e) => { console.log('problem with request: ${e.message}'); }); httpReq.write(JSON.stringify({color: color})); httpReq.end(); res.send(); };

slide-25
SLIDE 25
slide-26
SLIDE 26

Webhook Responses

slide-27
SLIDE 27

API.AI Agent Key Concepts

  • Intents
  • User Expressions
  • Entities
  • Context
slide-28
SLIDE 28
slide-29
SLIDE 29

It’s About Conversational Interfaces

slide-30
SLIDE 30

Thanks

@benteese @darren_cibis