The presentation gives a quick overview of Amazon Alexa, the devices and how to write your first custom skill. The presentation contains sample code on how to write an Alexa skill that provides a random quote or a quote of a specific person. The code sample makes use of the Amazon Node.js alexa-sdk.
2. Overview
Learning to code an
Alexa Skill in less than an
hour.
• Amazon Alexa
• Amazon Echo & Dot
• Amazon Alexa Commands
• Alexa Skills Kit
• Utterances, Slots & Intents
• Events
• Demo: Mister Quote
• Questions
3. Amazon Alexa
• Intelligent Personal Assistant
• Amazon’s Cloud-based Voice Service
• Provide Capabilities / Skills
– Play Music
– Answer General Questions
– Set Alarm / Timer
– Read the news
– Play Audible Books
4. Amazon Echo & Dot
• Always on, always connected, hands free device.
• Connects to Amazon Alexa.
• Continually learns and adapts to your speech
patterns.
• Echo has 7 microphones & beam forming tech.
• Can hear you across a room.
• Just say wake up word: “Alexa”.
5. Amazon Alexa Commands
Amazon Commands:
• Alexa, what is the weather in London?
• Alexa, who is Steve Jobs?
• Alexa, set time for 3 seconds.
Custom Skills:
• Alexa, ask AllRecipes for a chicken recipe.
• Alexa, open Capital One.
6. Alexa Skills Kit (ASK)
• Used to Build & Publish 3rd party skills
• Collection of
– Self-Service API’s
– Tools
– Documentation
– Tutorials & Samples
• Use the “Smart Home Skill API” for
– Cloud controlled lighting& thermostat devices
7. Alexa Skills
Image: Big Nerd Ranch
https://developer.amazon.com/alexa-skills-kit/big-nerd-ranch/alexa-architecture-and-configuration
9. Skill Interface: Utterances
• Map phrases user speak to intents
• Lines in a plain text file
• Format
– {IntentName} sample utterance
– {IntentName} sample utterance {SlotName}
10. Skill Interface: Slots Types
Standard Slot Types:
• Alexa Skills Kit defines several slot types.
• Numbers, Dates & Times
• List of Items
Custom Slot Types:
• Defines a list of possible values.
• Text File
12. Skill Interface: Intents
• You define
interactions for
your skill through
Intents
• Intents are
defined in JSON
structure
13. Standard Built-in Intents
Standard Built-in Intents Common Utterances
AMAZON.RepeatIntent Repeat, Say that again
AMAZON.HelpIntent Help, Help me, Can you help me
AMAZON.StopIntent Stop, off, Shut up
AMAZON.CancelIntent Cancel, Never mind, Forget it
AMAZON.YesIntent Yes, Yes please, Sure
AMAZON.NoIntent No, No thanks
• Standard Intents used for common actions
• These intents do not use slots
14. Hosted Service
Amazon Alexa Service post events:
• LaunchRequest
– Occurs when user launches skill without
specifying what they want.
• IntentRequest
– Occurs when the user specifies an intent.
• SessionEndedRequest
– Occurs when the user ends the session.
16. Mister Quote
• Skill providing quotes of famous people.
Alexa, ask Mister Quote to give a quote of Nelson Mandela.
We can't afford to be
killing one another.
Source Code: https://github.com/Code2Bits/Alexa-Skills-Samples/
17. Mister Quote - Interface
• Sample Utterances
– Ask for a random quote
– Ask for a quote of famous person
• Custom Slot: famousPerson
Source Code: https://github.com/Code2Bits/Alexa-Skills-Samples/
18. Mister Quote – Custom Slot
• Custom Slot List
– Text file containing list of valid values
Source Code: https://github.com/Code2Bits/Alexa-Skills-Samples/
19. Mister Quote – Intent
• JSON structure defining interactions
– Random Quote
– Specific Quote of Famous Person
– Amazon Built-in Interactions
Source Code: https://github.com/Code2Bits/Alexa-Skills-Samples/
20. Mister Quote – Service
• Uses the Alexa-SDK
Source Code: https://github.com/Code2Bits/Alexa-Skills-Samples/
21. Mister Quote – Service
• Constants File containing Application ID
Source Code: https://github.com/Code2Bits/Alexa-Skills-Samples/
22. Mister Quote – Service
• Quote File containing functions and quotes
Source Code: https://github.com/Code2Bits/Alexa-Skills-Samples/
23. Mister Quote – Service
• Handler file contains all Intent Handlers
Source Code: https://github.com/Code2Bits/Alexa-Skills-Samples/
25. Mister Quote – Run
Source Code: https://github.com/Code2Bits/Alexa-Skills-Samples/
Alexa, ask Mister Quote to give a quote of Nelson Mandela.
We can't afford to be
killing one another.