Slide 1

Slide 1 text

Alexa Skills or The Unexpected Virtue of Laziness !! Aswini Dasika Principal Software Engineer DWP Digital

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

Necessity Laziness is the mother of invention.

Slide 4

Slide 4 text

Alexa intelligent personal assistant developed by Amazon capable of voice interaction music playback making to-do lists setting alarms streaming podcasts playing audiobooks providing weather, traffic, and other real-time information can control compatible smart devices such as light bulbs, TVs etc.

Slide 5

Slide 5 text

Echo (1st Gen) Echo Dot Echo Plus (built-in ZigBee smart home hub) Echo Show Echo Buttons (Alexa Gadgets) Echo (2nd Gen)

Slide 6

Slide 6 text

Demo Polygon Pal

Slide 7

Slide 7 text

Wiggle Your Parts!! Demo

Slide 8

Slide 8 text

AWS DEVELOPER CONSOLE Building an Alexa Skill

Slide 9

Slide 9 text

AWS MANAGEMENT CONSOLE Building an Alexa Skill

Slide 10

Slide 10 text

Sample Intent Handling Code exports.handler = function (event, context) { try { // Restrict this function to just a given skill id if (event.session.application.applicationId !== “your_skill_id”) { context.fail("Invalid Application ID"); } if (event.session.new) { onSessionStarted({requestId: event.request.requestId}, event.session); } if (event.request.type === "LaunchRequest") { onLaunch(event.request, event.session, function callback(sessionAttributes, speechletResponse) { context.succeed(buildResponse(sessionAttributes, speechletResponse)); }); } else if (event.request.type === "IntentRequest") { onIntent(event.request, event.session, function callback(sessionAttributes, speechletResponse) { context.succeed(buildResponse(sessionAttributes, speechletResponse)); }); } else if (event.request.type === "SessionEndedRequest") { onSessionEnded(event.request, event.session); context.succeed(); } } catch (e) { context.fail("Exception: " + e); } };

Slide 11

Slide 11 text

function onIntent(intentRequest, session, callback) { var intent = intentRequest.intent, intentName = intentRequest.intent.name; // dispatch custom intents to handlers here if (intentName === 'WiggleIndicator') { handleWiggleRequest(intent, session, callback, false); } else if (intentName === 'FailIndicator') { handleFailRequest(intent, session, callback, false, “"); } else if (intentName === 'AMAZON.YesIntent') { handleYesRequest(intent, session, callback); } else if (intentName === 'AMAZON.NoIntent') { handleNoRequest(intent, session, callback); } else if (intentName === 'AMAZON.HelpIntent') { handleHelpRequest(intent, session, callback); } else if (intentName === 'AMAZON.CancelIntent' || intentName == 'AMAZON.StopIntent') { handleStopRequest(intent, session, callback); } else { throw "Invalid intent"; } }

Slide 12

Slide 12 text

function handleWiggleRequest(intent, session, callback, atLaunch) { if(intent.slots) { var wiggleIndicatorsSlot = intent.slots.WiggleIndicators; var wiggleIndicatorName; if (wiggleIndicatorsSlot && wiggleIndicatorsSlot.value) { wiggleIndicatorName = wiggleIndicatorsSlot.value.toLowerCase(); } /* YOUR SKILL LOGIC HERE */ var output = “SOMETHING FOR ALEXA TO SAY"; var speechletResponse = buildSSMLSpeechletResponse(output, "", "false"); callback(session.attributes, speechletResponse); } else { /* SOMETHING WRONG, HANDLE IT ! */ } } function handleFailRequest(intent, session, callback, wrongPlayOption, wiggleIndicatorName) { /* YOU KNOW THE PLAYER FAILED IF YOU ARE HERE, SO NO NEED TO INTERROGATE INTENT AND THE SLOT */ /* LOGIC TO GATHER GAME SCORES etc. HERE */ output = “SOMETHING FOR ALEXA TO SAY UPON PLAYER”S FAILURE OR GAME ENDED"; speechletResponse = buildSSMLSpeechletResponse(output, "", "true"); callback(session.attributes, speechletResponse); } }

Slide 13

Slide 13 text

Speech Synthesis Markup Language (SSML) https://developer.amazon.com/docs/custom-skills/speech-synthesis-markup-language-ssml-reference.html function getApplauseSSML(score) { var applauseSSML = ""; if (score <= 2 ) { applauseSSML = ""; } else if(score <= 10 ) { applauseSSML = ""; } else { applauseSSML = ""; } return applauseSSML; }

Slide 14

Slide 14 text

function buildSSMLSpeechletResponse(output, repromptText, shouldEndSession) { return { outputSpeech: { type: "SSML", ssml: output }, reprompt: { outputSpeech: { type: "SSML", ssmlssml: repromptText } }, shouldEndSession: shouldEndSession }; } function buildSpeechletResponse(title, output, shouldEndSession) { return { outputSpeech: { type: "PlainText", text: output }, card: { type: "Simple", title: title, content: output } shouldEndSession: shouldEndSession }; }

Slide 15

Slide 15 text

Alexa Skills Lingo Alexa, ask polygon pal about a pentagon } } —> Wake Word —> Launch Phrase —> Invocation Name } } —> Utterance • Alexa • Echo • Computer • Amazon —> • Ask • Launch • Play • Tell • & more at —> https://developer.amazon.com/docs/custom-skills/understanding-how-users-invoke-custom-skills.html

Slide 16

Slide 16 text

Alexa Skill Certification and Publishing Amazon’s skills promotion and incentives - alexa swag - monetary rewards - advertising

Slide 17

Slide 17 text

More Games.. err Demos ? Mind Your Words - DynamoDB What3Words - Google Location API, Amazon Device API, What3Words API Mark My Words - Word based game, DynamoDB

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

https://www.youtube.com/watch?v=YvT_gqs5ETk Let’s have some laugh !!

Slide 20

Slide 20 text

https://en.wikipedia.org/wiki/Natural_language_processing#Natural_language_processing_APIs

Slide 21

Slide 21 text

What kind of skills can I build ? • Custom Skills • Smart Home Skills • Flash Briefing Skills • Video Skills • List Skills https://developer.amazon.com/docs/ask-overviews/understanding-the-different-types-of-skills.html

Slide 22

Slide 22 text

12 reasons to be developing Alexa Skills right now https://medium.com/voiceflow/12-reasons-to-be-developing-alexa-skills-right-now-c4c93cf8f7f6

Slide 23

Slide 23 text

Potential for Voice Control Technology in Application Development Paper Forms —> Email Attachments —> Web Forms —> Voice Interactive Technology

Slide 24

Slide 24 text

• Can revolutionise how our customers interact with our product - Do away with web forms ? • Improve accessibility with a new way to solve problems - Take commands by voice DEMO - JobSearch skill • Natural Language Processing (NLP) APIs - use them to create organisation specific NLP universe and host them on-premise using Alexa for business. • Amazon Lex - sophisticated, natural language chatbots with flexibility of natural language understanding (NLU) and automatic speech recognition (ASR)

Slide 25

Slide 25 text

Alexa, Say Thank You ! [email protected] @aswinidasika