Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Amazon alexa - building custom skills

12,641 views

Published on

Discussed in detail about how to design and develop custom skills (think custom apps) for Amazon Alexa Voice service.
Discusses how to design voice based experiences in detail.

Published in: Software
  • FREE TRAINING: "How to Earn a 6-Figure Side-Income Online" ... ●●● https://tinyurl.com/y3ylrovq
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Real Money Streams ~ Create multiple streams of wealth from your home! ♥♥♥ http://scamcb.com/ezpayjobs/pdf
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Want to preview some of our plans? You can get 50 Woodworking Plans and a 440-Page "The Art of Woodworking" Book... Absolutely FREE ■■■ http://ishbv.com/tedsplans/pdf
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Hello! Get Your Professional Job-Winning Resume Here - Check our website! https://vk.cc/818RFv
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • It is good and exhaustive..
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Amazon alexa - building custom skills

  1. 1. Aniruddha Chakrabarti AVP and Chief Architect, Digital, Mphasis @anchakra | Linkedin.com/in/aniruddhac | slideshare.net/aniruddha.chakrabarti/ Amazon Alexa Amazon Echo, Tap and Dot
  2. 2. Agenda • What is Echo and how does it work • Echo, Tap and Echo Dot • Alexa Voice Service (AVS) • Alexa Skill Kit (ASK) • Custom Alexa Skill
  3. 3. Echo/Alexa Product Line Amazon Echo Amazon Tap Amazon Echo Dot Echo enabled third party devices
  4. 4. What is Amazon Echo • Hands-free speaker you control with your voice. • Echo connects to the Alexa Voice Service to play music, provide information, news, sports scores, weather, and more - instantly. All you have to do is ask. • Echo has seven microphones and beam forming technology so it can hear you from across the room - even while music is playing. • Echo is also an expertly tuned speaker that can fill any room with 360° immersive sound. • When you want to use Echo, just say the wake word "Alexa" and Echo responds instantly.
  5. 5. Echo Details • Echo needs to be always connected to power outlet (does not have battery) • Always need to be connected to net (through a high speed router) to be functional as all of it’s power comes from cloud. • Echo is always on – using wake word (by default “Alexa”) wakes it up
  6. 6. Echo Dot and Tap • Has a tiny speaker, otherwise same as Echo – so called Echo Dot • Typically you'll hook Dot up to your own audio setup (via out jack or Bluetooth), so you can use Alexa with your existing speakers. • The tiny speaker won't output much audio - it's only for Alexa voice feedback (which, again, requires Wi- Fi). • Portable Bluetooth and Wi-Fi enabled speaker • Unlike Echo, Tap is wireless & must be set into the included cradle in order to charge • The Tap isn't an always-on, so you can't say "Alexa" to wake it and instead need to press the microphone button on the front.
  7. 7. Amazon Echo & Alexa History • Sept ‘14 - Amazon Echo was launched by Amazon • June ‘15 – Echo became widely available in US • March ‘16 - Amazon unveiled the Amazon Echo Dot and Tap • Amazon opened the API (Alexa Skill Skit and Alexa Voice Service) allowing developers to build new skills • Sept ‘16 – Echo and Dot is now Availabile in white color • Sept ‘16 - Echo became available outside US in UK and Germany
  8. 8. How does Echo work Alexa Enabled Device / Alexa Endpoint Amazon - Echo, Dot, Tap Amazon Fire TV, Fire TV Stick 3rd Party – Triby, Pebble Watch Req. Voice Stream Resp. Voice Stream Services / Data Sources "Alexa, what’s the time?" “ . . . ” User Amazon Alexa Service Wikipedia, Weather service, Time service, Traffic update service, Weather service, Music service, News service, etc.
  9. 9. What is Alexa • Alexa is the brain behind Alexa devices like Echo, Dot, Tap and other 3rd party Alexa enabled devices. • Alexa is the voice service that powers Amazon Echo, provides capabilities, or skills, that enable customers to interact with devices in a more intuitive way using voice. • Alexa is similar to Siri, Cortana or ok google/google home. • Alexa runs in the cloud – the device streams info to Alexa service running in the cloud. • Amazon is continuously improving and enhancing Alexa - so it is always getting smarter. The more customers use Alexa, the more she adapts to speech patterns, vocabulary, and personal preferences.
  10. 10. Skills • Functionalities or capabilities built by third party to extend core skills of Alexa and build new customer experiences. • Think of Skill in Alexa as an app in mobile parlance • Skill logic could be developed in any language & web stack (Java, Node.js, Python, C#, Go, PHP) • Skills could be hosted in cloud (AWS, Azure, Google Cloud Platform, Heroku, PCF, other PaaS or IaaS) or in your data center / on prem. (internet reachable)
  11. 11. Type of Skills • Out of the box skills developed by Amazon that comes pre-built when you purchase the device • Time, Weather, News, Wikipedia, Traffic, Music, … BUILT IN SKILLS • Anything that is not covered by Built in Skill • Food delivery, Request Taxi, Game, CUSTOM SKILLS • Skills to control smart home devices like lights, thermostats, router, freeze, car, any smart home automation/IOT device SMART HOME SKILLS • For building Flash Briefing skills which delivers pre- recorded audio clips and text-to-speech (TTS) updates to customers. • Examples include updates from popular broadcasters and blogs, recent headlines, weather • Each Flash Briefing skill contains one or more content feeds. FLASH BRIEFING SKILL Third PartyAmazon
  12. 12. Alexa Cloud Services ALEXA VOICE SERVICE (AVS) Scalable cloud service that adds voice-enabled experiences to any connected product (like Echo). Alexa Voice Service performs speech to text (and vice versa), Natural language processing (NLP) and other functions. ALEXA SKILL KIT (ASK) Collection of self-service APIs, tools, documentation and code samples that make building new Alexa Skills easy and fast.
  13. 13. + Settings in Developer Portal (Invocation Name, Name, Skill Type, Endpoint, Publishing Info) Amazon Developer Portal Custom Skill Components Intents (Intent schema) Sample Utterances (Text file) Slots (Text file for Custom Slots) Skill Code (Node.js / Java / Python / C# / Go) Cloud (AWS / Azure / Google Cloud / Private Cloud/datacenter) Interaction Model
  14. 14. Intents INTENTS • What the user specifically wants the skill to do. You map the user's spoken intents to intents your service can handle. • Intents are specific requests, questions or commands. e.g. "Alexa, Ask Alarmy to set the alarm for 7:30 am." • All Skills have intents – a skill at min should have one intent • Skills typically have multiple intents • Each intent maps to a method in your code that is called E.g. CapitalOne has built a Alexa skill for their customers which support these intents • Account balance • Last transactions • Credit card statement (amount due, payment date) • Pay credit card bill
  15. 15. Intents (Cont’d) BUILT IN INTENTS • Intents that are often used are already defined by Amazon • Allows users to engage with different skills in a consistent way • Using built-in intents for these types of common actions is useful for several reasons: • You do not need to spend the time writing sample utterances for the intent. • Users can use common, consistent phrases to access the intent across skills. This makes it easier for users to work with your skill. • Your skill gets the benefit of any future updates to the Alexa service that improve recognition and utterances for these intents. • E.g. - • StopIntent, CancelIntent, HelpIntent, YesIntent, NoIntent, RepeatIntent, StartOverIntent, … https://developer.amazon.com/public/solutions/alexa/alexaskills-kit/docs/implementing-the-built-in-intents
  16. 16. List of built in intents Intent Common Utterances Purpose AMAZON.CancelIntent •cancel •never mind •forget it Either of the following: •Let the user cancel a transaction or task (but remain in the skill) •Let the user completely exit the skill AMAZON.HelpIntent •help •help me •can you help me Provide help about how to use the skill. See “Offer Help for Complex Skills” in the Voice Design Best Practices for guidelines about help text. AMAZON.NextIntent •next •skip •skip forward Let the user navigate to the next item in a list. AMAZON.NoIntent •no •no thanks Let the user provide a negative response to a yes/no question for confirmation. AMAZON.PauseIntent •pause •pause that Let the user pause an action in progress. AMAZON.PreviousIntent •go back •skip back •back up Let the user go back to a previous item in a list. AMAZON.RepeatIntent •repeat •say that again •repeat that Let the user request to repeat the last action. AMAZON.ResumeIntent •resume •continue •keep going Let the user resume or continue an action. AMAZON.StartOverIntent •start over •restart •start again Let the user request to restart an action, such as restarting a game or a transaction. AMAZON.StopIntent •stop •off •shut up Either of the following: •Let the user stop an action (but remain in the skill) •Let the user completely exit the skill See below for more about canceling and stopping. AMAZON.YesIntent •yes •yes please •sure Let the user provide a positive response to a yes/no question for confirmation.
  17. 17. Slots SLOTS A variable passed to the intent – like when to set alarm, city for weather etc. BUILT IN SLOT TYPES Amazon.Date, Amazon.Duration, Amazon.Number, Amazon.US_City, Amazon.Four_Digit_Number, Amazon.Time, Amazon.US_State, Amazon.US_First_Name, … CUSTOM SLOT TYPES Used for items that are not covered by Amazon’s built-in set of types and is recommended for most use cases where a slot value is one of a set of possible values. Examples – • List of signs (Horoscope) • List of non US cities • List of services (Ola Prime, Ola Micro, Ola Mini, Ola Auto, Ola Shared) • List of stock exchanges (NASDAQ, London stock exchange, NSE, Tokyo stock exchange, Shanghai)
  18. 18. Parsing Invocation Name, Intent and Slots Alexa, ask Schneider for nearest distributors in London Alexa, ask DigiSure for status of my last vehicle claim Alexa, ask MyWeather for temp (No slot type specified – city is inferred as current location of user) Wake Word Invocation Name Intent Slot Wake Word could be configured to Alexa, Amazon or Echo
  19. 19. Solution Elements VUI • Design Voice User Interface (VUI) & Invocation Name • Decide Intents to be supported, Develop Intent Schema (.json) Speech • Define sample phrases / sample utterances • Define slot types Build • Build your code (Node / Python / Java) • Host your code (AWS Lambda / Other PaaS options) Portal • Define your app/skill in amazon developer portal • Define interaction model, link your skill to code hosted in cloud Test • Test your skill – echoism.io emulator and device (Echo/Dot/Tap) • Submit your skill for certification Before you start, refer Voice Design Handbook and Voice Design Best Practice
  20. 20. Voice User Interface (VUI) • Design the voice experience – voice experiences are different than web & mobile experience • Think about a core functionality that you want to build first – your skill should do one thing very well, rather than attempting multiple things • Later add additional functionality iteratively • User empathy
  21. 21. Invocation Name • Invocation name is how Alexa identifies the capability a user wants • Often this is the name if the Skill, though they could be different. • Should uniquely identify your skill, should be catchy and easy to remember and b/w 1 – 3 words (Guidelines) Alexa, ask Schneider for nearest distributors in London Alexa, ask DigiSure for status of my last vehicle claim
  22. 22. Other settings in Amazon Dev Portal • Contains other settings like Skill type (Custom / Smart Home / Flash Briefing), Name, Language supported, App Id (auto generated) etc
  23. 23. Other settings in Amazon Dev Portal • Contains Invocation Model • Intent Schema, • Custom Slot Types • Sample Utterances
  24. 24. Handling Requests Sent by Alexa • Verify that the Request is Intended for Your Service • To do this validation, every request sent by Alexa includes an application ID. You can check this ID to ensure that the request was intended for your service.
  25. 25. Request Types • Launch Request • Intent Request • Session Ended Request • Session Started • AudioPlayer Requests • PlaybackController Requests
  26. 26. Request Types LaunchRequest • Your service receives a LaunchRequest when the user invokes the skill with the invocation name, but does not provide any command mapping to an intent. • User: “Alexa, talk to Daily Horoscopes” / “Alexa, open Daily Horoscopes” • Skills that just do one thing (such as telling a joke), the service can take action without requesting more info from user. Services that need more info from user may need to respond with a prompt. • Maps to onLaunch() in Java SDK • A LaunchRequest always starts a new session
  27. 27. Request Types IntentRequest • Your service receives an IntentRequest when the user speaks a command that maps to an intent. • The request object sent to your service includes the specific intent and any defined slot values. • Maps to onIntent() in Java SDK • An IntentRequest can either start a new session or continue an existing session, depending on how the user begins interacting with the skill:
  28. 28. Request Types SessionEndedRequest • Your service receives a SessionEndedRequest when a currently open session is closed for one of the following reasons: 1. The user says “exit”. 2. The user does not respond or says something that does not match an intent defined in your voice interface while the device is listening for the user’s response. 3. An error occurs. • Maps to onSessionEnded() in Java SDK
  29. 29. Request Types AudioPlayer Requests and PlaybackController Requests • Your service receives the AudioPlayer and PlaybackController requests only if you are using the AudioPlayer interface to stream audio. • Alexa sends AudioPlayer requests to notify your service about the current status of the playback. • The PlaybackController request are sent when the user interacts with the device using hardware buttons, such as a remote control.
  30. 30. Intent Schema { "intents": [ { "intent": "MTriviaIntent" }, { "intent": "AMAZON.HelpIntent" }, { "intent": "AMAZON.StopIntent" }, { "intent": "AMAZON.CancelIntent" } ] } { "intents": [ { "intent": "SchneiderSearchIntent", "slots": [ { "name": "City", "type": "LIST_OF_CITIES" } ] }, { "intent": "HearMore" }, { "intent": "DontHearMore" }, { "intent": "AMAZON.HelpIntent" }, { "intent": "AMAZON.StopIntent" }, { "intent": "AMAZON.CancelIntent" } ] } London Coventry
  31. 31. Sample Utterances MTriviaIntent a fact MTriviaIntent a mphasis fact MTriviaIntent a emphasis fact MTriviaIntent tell me a fact MTriviaIntent tell me a mphasis fact MTriviaIntent tell me a emphasis fact MTriviaIntent give me a fact MTriviaIntent give me a mphasis fact MTriviaIntent give me a emphasis fact MTriviaIntent tell me trivia MTriviaIntent tell me a mphasis trivia MTriviaIntent tell me a emphasis trivia MTriviaIntent give me trivia MTriviaIntent give me a mphasis trivia MTriviaIntent give me a emphasis trivia MTriviaIntent give me some information MTriviaIntent give me some mphasis information MTriviaIntent give me some emphasis information MTriviaIntent tell me something MTriviaIntent give me something SchneiderSearchIntent get nearest distributors in {City} SchneiderSearchIntent get me nearest distributors in {City} SchneiderSearchIntent get best distributors in {City} SchneiderSearchIntent get me best distributors in {City} SchneiderSearchIntent get me {City} SchneiderSearchIntent top {City} SchneiderSearchIntent get top {City} SchneiderSearchIntent get me top {City} SchneiderSearchIntent nearest {City} SchneiderSearchIntent get nearest {City} SchneiderSearchIntent top distributors in {City} SchneiderSearchIntent get top distributors in {City} SchneiderSearchIntent best distributors in {City} SchneiderSearchIntent get best distributors in {City} SchneiderSearchIntent {City} SchneiderSearchIntent for nearest distributors in {City} SchneiderSearchIntent for distributors in {City} SchneiderSearchIntent distributors in {City} HearMore yes HearMore yep HearMore yeah HearMore sure HearMore yes please HearMore affirmative DontHearMore no DontHearMore nope
  32. 32. Alexa Custom Skill - Reference Architecture Echo/Dot Device AWS Lambda (Server-less compute in cloud) Req. Voice Stream1 2 5 REST service Resp. Voice Stream Services On Prem./Hosted/Cloud API Gateway & Management "Alexa, ask Digi Bank for …" “ . . . ” User Alexa Voice Service (AVS) (Cloud) 3 • Identifies skill name • Analyzes & understands the req. • Sends the custom Alexa skill a structured representation of user’s req. Custom Alexa Skill + Alexa Skill Kit 4 6 7 8 9 • Your custom Alexa skill receives the req. • Processes the req. and returns text (image – opt) response • Alexa converts the returned text to speech • Streams to Echo/Dot device
  33. 33. FedEx (Last Mile) – Alexa Reference Architecture Echo/Dot Device Azure (Azure Functions) Req. Voice Stream 1 2 5 REST service Resp. Voice Stream FedEx Last Mile Services Cloud FedEx API Gateway "Alexa, ask FedEx for …" “ . . . ” User Alexa Voice Service (AVS) (Cloud) 3 • Identifies skill name • Analyzes & understands the req. • Sends the custom Alexa skill a structured representation of user’s req. FedEx Last Mile Custom Alexa Skill + Alexa Skill Kit 4 67 8 9 • Your custom Alexa skill receives the req. • Processes the req. and returns text (image – opt) response • Alexa converts the returned text to speech • Streams to Echo/Dot device Cloud
  34. 34. Hosting Options AWS (AMAZON WEB SERVICE) • AWS Lambda (Recommended, SSL key not required & provides a seamless integration) • Java Servlet on EC2 (Elastic Compute Cloud) • AWS Elastic Beanstalk AZURE • Azure Functions • Azure Web App Service GOOGLE CLOUD PLATFORM (GCP) • Cloud Functions • App Engine HEROKU • Heroku Dynos OWN / ON PREM. • Anything that is internet reachable and returns JSON over HTTP on port 443 (SSL). Need to have a trusted certificate Note: Using Non AWS hosting would require SSL Keys.
  35. 35. AWS Lambda • Server-less compute option from AWS • Event driven - executes code on demand as specified event is triggered • Allows scaling without thinking of servers or nodes • Low cost compared to other compute options • To host Alexa skill, Lambda code should be hosted in N.Virginia / US East location
  36. 36. Azure Functions • Server-less compute option from Azure - Event driven, compute-on-demand • Expose Functions as HTTP API endpoints • Scale Functions based on customer demand • Very similar to AWS Lambda and GCP (Google) Cloud Functions • Supports a variety of languages, including JavaScript, C#, Python, and PHP
  37. 37. Request JSON • Session detail • User detail • Request detail https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/alexa-skills-kit-interface-reference
  38. 38. Session
  39. 39. Request - LaunchRequest
  40. 40. Request - IntentRequest
  41. 41. Request – IntentRequest (Cont’d)
  42. 42. Request - SessionEndedRequest
  43. 43. Response JSON • Response - Text that Alexa says back to the user. Could be text or SSML • Reprompt – Text Alexa says back to the user, if user does not respond. Could be text or SSML • Graphic Card details (title, text, image) – Appears in companion app • Session Attributes • Should the session be ended https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/alexa-skills-kit-interface-reference
  44. 44. Voice design best practices Getting Information from the User • Make It Clear that the User Needs to Respond • Don’t Assume Users Know What to Do • Clearly Present the Options • Keep it brief • Avoid Overwhelming Users with Too Many Choices • Offer Help for Complex Skills • Ask Only Necessary Questions • Obtain One Piece of Information at a Time • Use the Amazon Alexa App to Enhance Discovery https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/alexa-skills-kit-voice-design-best-practices
  45. 45. Voice design best practices Presenting Information to the User • Make Sure Users Know They are in the Right Place – Set the right context while responding • Present Information in Consumable Pieces – Use pagination where more information need to be presented • Write for the Ear, not the Eye – make the interaction as verbal as possible, users should feel that they are talking with another human being • Avoid Technical and Legal Jargon • Use Text-to-Speech Effectively • Use SSML where required https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/alexa-skills-kit-voice-design-best-practices
  46. 46. Interaction patterns - One shot model vs Dialog model User – Alexa, ask MyWeather whether it would rain in Bangalore tomorrow Alexa – There is a 60% chance that it would rain in Bangalore tomorrow User – Alexa, open MyWeather Alexa – Welcome to MyWeather. For which city you are looking for weather predictions? User – Bangalore Alexa – for which date? User – tomorrow Alexa - There is a 60% chance that it would rain in Bangalore tomorrow ONE SHOT MODEL DIALOG MODEL
  47. 47. Hello World Alexa Skill (Node.js) exports.handler = function( event, context ) { var response = { outputSpeech: { type: "PlainText", text: "Hello World" }, card: { type: "Simple", title: "Hello World", content: "Alexa Skills Kit" }, shouldEndSession: true }; context.succeed( { response: response } ); };
  48. 48. exports.handler = function (event, context) { try { console.log("event.session.application.applicationId=" + event.session.application.applicationId); if (event.session.application.applicationId !== "amzn1.echo-sdk-ams.app.[unique-value-here]") { 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); } }; If it’s a new session, initialize the session, etc… More on request handling … Verifying that the Request is Intended for Your Service Occurs when user launches a skill without an intent Occurs when user specifies an intent Occurs when session ends
  49. 49. function onIntent(intentRequest, session, callback) { console.log("onIntent requestId=" + intentRequest.requestId + ", sessionId=" + session.sessionId); var intent = intentRequest.intent, intentName = intentRequest.intent.name; // Dispatch to your skill's intent handlers if ("MyColorIsIntent" === intentName) { setColorInSession(intent, session, callback); } else if ("WhatsMyColorIntent" === intentName) { getColorFromSession(intent, session, callback); } else if ("AMAZON.HelpIntent" === intentName) { getWelcomeResponse(callback); } else if ("AMAZON.StopIntent" === intentName || "AMAZON.CancelIntent" === intentName) { handleSessionEndRequest(callback); } else { throw "Invalid intent"; } } More on request handling …
  50. 50. Response - Speech • Text • SSML
  51. 51. How to respond function getColorFromSession(intent, session, callback) { var favoriteColor; var repromptText = null; var sessionAttributes = {}; var shouldEndSession = false; var speechOutput = ""; if (session.attributes) { favoriteColor = session.attributes.favoriteColor; } if (favoriteColor) { speechOutput = "Your favorite color is " + favoriteColor + ". Goodbye."; shouldEndSession = true; } else { speechOutput = "I'm not sure what your favorite color is, you can say, my favorite color is red"; } // Setting repromptText to null signifies that we do not want to reprompt the user. // If the user does not respond or says something that is not understood, the session will end. callback(sessionAttributes, buildSpeechletResponse(intent.name, speechOutput, repromptText, shouldEndSession)); }
  52. 52. How to respond function buildSpeechletResponse(title, output, repromptText, shouldEndSession) { return { outputSpeech: { type: "PlainText", text: output }, card: { type: "Simple", title: "SessionSpeechlet - " + title, content: "SessionSpeechlet - " + output }, reprompt: { outputSpeech: { type: "PlainText", text: repromptText } }, shouldEndSession: shouldEndSession }; }
  53. 53. SSML - Speech Synthesis Markup Language Tags Description Usage Speak Root element of an SSML document. When using SSML with the Alexa Skills Kit, surround the text to be spoken with this tag <speak> This is what Alexa sounds like without any SSML. </speak> audio Lets you provide the URL for an MP3 file that the Alexa service can play while rendering a response. <speak> Welcome to Car-Fu. <audio src="https://carfu.com/audio/carfu-welcome.mp3" /> You can order a ride, or request a fare estimate. Which will it be? </speak> break Represents a pause in the speech. Set the length of the pause with the strength or time attributes. <speak> There is a three second pause here <break time="3s"/> then the speech continues. </speak> p Represents a paragraph. This tag provides extra-strong breaks before and after the tag. <speak> <p>This is the first paragraph. There should be a pause after this text is spoken.</p> <p>This is the second paragraph.</p> </speak> phoneme s Represents a sentence. This tag provides strong breaks before and after the tag. This is equivalent to: - Ending a sentence with a period (.). - Specifying a pause with <break strength="strong"/>. <speak> <s>This is a sentence</s> <s>There should be a short pause before this second sentence</s> This sentence ends with a period and should have the same pause. </speak>
  54. 54. SSML - Speech Synthesis Markup Language Tags Description Usage say-as Describes how the text should be interpreted. This lets you provide additional context to the text and eliminate any ambiguity on how Alexa should render the text. Indicate how Alexa should interpret the text with the interpret-as attribute. • characters, spell-out: Spell out each letter. • cardinal, number: Interpret the value as a cardinal number. • ordinal: Interpret the value as an ordinal number. • digits: Spell each digit separately . • fraction: Interpret the value as a fraction. This works for both common fractions (such as 3/20) and mixed fractions (such as 1+1/2). • unit: Interpret a value as a measurement. The value should be either a number or fraction followed by a unit (with no space in between) or just a unit. • date: Interpret the value as a date. Specify the format with the format attribute. • time: Interpret a value such as 1'21" as duration in minutes and seconds. • telephone: Interpret a value as a 7-digit or 10-digit telephone number. This can also handle extensions (for example, 2025551212x345). • address: Interpret a value as part of street address. w Similar to <say-as>, this tag customizes the pronunciation of words by specifying the word’s part of speech. https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/speech-synthesis-markup-language-ssml-reference
  55. 55. Response – Graphic Card • Interactions between a user and an Alexa device can include home cards displayed in the Amazon Alexa App, the companion app available for Fire OS, Android, iOS, and desktop web browsers. • These are graphical cards that describe or enhance the voice interaction. A custom skill can include these cards in its responses
  56. 56. Response – Graphic Card • Simple Card - Displays plain text. You provide text for the card title and content. • Standard Card - Also displays plain text, but can include an image. You provide the text for the title and content, and the URL for the image to display. • LinkAccount Card - Special card type only used with account linking. This card lets users start the account linking process.
  57. 57. Type of Intents • Get the time • Get weather update • Get traffic update • Play music • Get the news briefing • Get account balance, get last transactions, get credit card bill (CapitalOne) • Track order status (Dominos) • Get nearest distributors (SE) • Check the shipment status (FedEx) • Set the timer • Send a meeting request • Send an email • Make a reservation for dinner • Buy something from Amazon • Book a ride (Uber) • Pay last credit card bill (CapitalOne) • Order a pizza (Dominos) ASKING DOING

×