SlideShare une entreprise Scribd logo
1  sur  22
Télécharger pour lire hors ligne
RICK WARGO - FEB 2017
BUILD AN ALEXA SKILL
1
BUILD AN ALEXA SKILL
WHY BUILD AN ALEXA SKILL?
▸ Alexa Fund (voice technology innovation) - $100M VC Fund
▸ Alexa Prize (must be a full-time university student)
▸ Free Hoodie (just for submitting an approved skill)
▸ Opportunity! (only 10k skills as of Feb 24, 2017)
▸ It’s Fun!
2
BUILD AN ALEXA SKILL
ECHO IS EVERYWHERE
▸ Slide from April 2016 Talk
at Hardwired NYC (a
monthly event hosted by
FirstMark in New York
covering the intersection of
hardware and software) by
Donn Morrill, Sr. Manager
of Solution Architecture for
Amazon’s Alexa.
https://www.slideshare.net/firstmarkcap/amazons-echo-the-present-and-future-of-alexa-donn-morrill-amazon-firstmarks-hardwired-nyc
3
BUILD AN ALEXA SKILL
WHAT CAN YOU BUILD FOR THE ECHO?
▸ The platform that drives the Echo ecosystem is the Alexa Skills Kit.
▸ Custom Skills - transactional, conversational, audio player
▸ Smart Home Skills - control cloud-connected devices
▸ Flash Briefing Skills - daily content feed for pre-recorded audio clips and
text-to-speech updates
▸ There is also the Alexa Voice Service to bring voice capabilities to IoT.
4
BUILD AN ALEXA SKILL
HOW CAN YOU BUILD AN ALEXA SKILL?
▸ Node.js, Python, Ruby, C#, Java
▸ AWS Lambda, Self-Hosted
▸ Various Frameworks
▸ alexa-app
▸ flask-ask
▸ AlexaSkillsKit.NET
▸ Other Tools
▸ PullString
▸ Conversable
▸ Bespoken Tools
5
BUILD AN ALEXA SKILL
SO…
▸ It is (relatively) easy to create a new basic skill.
▸ It requires lots of diligence to get it right.
▸ AWS Lambda, Node.js, alexa-js, alexa-app-root, and this template make it
easier…
▸ by simplifying Behavior Driven Design and making it part of the process.
6
BUILD AN ALEXA SKILL
IN THIS SESSION…
▸ We’ll use:
▸ Tests
▸ Lint
▸ Promises
▸ Node.js
▸ Lambda - serverless compute service (CaaS)
7
ALEXA, ASK CODE CAMP TWEETS…
BUILD AN ALEXA SKILL
for the most popular items.
who tweeted recently?
what were the last three messages?
to tell me the last tweet from Rick.
8
BUILD AN ALEXA SKILL
AMAZON’S QUICK START TUTORIAL
▸ https://developer.amazon.com/alexa-skills-kit/alexa-skill-quick-start-tutorial
▸ Step 1: Sign in to Amazon Web Services (AWS) and create a function
▸ Step 2: Use the Amazon developer portal to configure your skill
▸ Step 3: Test your Alexa skill
Let’s Do This!
‣ Pluralsight has C#/Azure Alexa Training: Developing Alexa Skills for Amazon Echo
9
BUILD AN ALEXA SKILL
DEVELOPMENT RESOURCES
AWS Management Console
▸ AWS Lambda - Server-less compute platform that runs a function as a response to a request. Easy
to create JavaScript, Python, Java, C# functions.
▸ CloudWatch - Check logs to see what went wrong (if anything). Also see metrics of skill
performing in real time
Amazon Developer Portal
▸ Alexa Skills Kit
Test
▸ Echo Simulator Community Edition (echosim.io)
10
BUILD AN ALEXA SKILL
ALEXA SKILLS KIT - CONCEPTS
▸ Intent Schema - JSON structure defining interactions
▸ Custom Slot Types - lists of specific items (akin to a variable)
▸ Standard Slot Types - growing list of slot types you can use in your skills. Ex:
▸ DATE, DURATION, NUMBER, TIME
▸ Animal, Book, Color, Dessert, Event Type, Festival, Game, Movie, Sport
▸ Sample Utterances - connects intents to likely spoken phrases (be verbose)
▸ alexa-utterances makes it easy to be verbose through alternation (in alexa-js)
11
Twitter API
User
Voice Request Audio Stream
Code-Camp-Tweets
Skill
Lambda
JSON Request
Node.js
JSON Response
(SSML+Card)
Response (Audio)
Response (Text/Graphics)
Audio Response
App/Web
JSON Response
(statuses)
GET search/tweets
BUILD AN ALEXA SKILL
USER INTERACTION FLOW
12
BUILD AN ALEXA SKILL
BRAINSTORMING - PRE-VISUALIZE YOUR SKILL
▸ Q: What's the latest news?
▸ A: The last 1 tweet was: Rick Wargo tweeted: Join me this Sat at 11:30am - we'll build an Alexa skill that interfaces with Twitter at #PhillyCode @PhillyDotNet.
▸ Q: What's the latest popular tweet?
▸ A: There were no matching tweets.
▸ Q: What is the last 5 tweets?
▸ A: The last 5 tweets were: Rick Wargo tweeted: Join me this Sat at 11:30am - we'll build an Alexa skill that interfaces with Twitter at #PhillyCode
@PhillyDotNet. Alina retweeted Stratisplatform's tweet: #Stratis are gold sponsors @PhillyDotNet on 24th-25th February explaining our #blockchain t…
▸ Q: What is the last tweet from Rick?
▸ A: The last 1 tweet was: Rick Wargo tweeted: Join me this Sat at 11:30am - we'll build an Alexa skill that interfaces with Twitter at #PhillyCode @PhillyDotNet.
▸ Q: Who tweeted?
▸ A: Recent tweets were from: Rick Wargo, Kucilo Oro, Alina, XTexplorer, and Mohammad Khalid.
▸ Q: Who shared?
▸ A: Recent tweets were from: Rick Wargo, Kucilo Oro, Alina, XTexplorer, and Mohammad Khalid.
13
BUILD AN ALEXA SKILL
CONFIGURE YOUR ENVIRONMENT
‣ Need to configure environment for keys for access to the Twitter API
# Keys for code-camp-tweets skill
export TWITTER_CONSUMER_KEY=hSYvOtda3Ri74PkyuTOHrLMdf
export TWITTER_CONSUMER_SECRET=LXHvTRShADq0s8lOlHCPodPw1smNeJ5p6E8GyOlY9cM0Ti5QSX
export TWITTER_ACCESS_TOKEN_KEY=WVUXxMzZPrszP2AO3eQIogJNFIA2vqkO5bmRkCiO1zCdr7KSt6
export TWITTER_ACCESS_TOKEN_SECRET=tMOuVnb3nrlwtNgUtr9qCZTdEqj6SpqbJrt7uysGuf5oU
Not my real keys :)
14
BUILD AN ALEXA SKILL
AWS CREDENTIALS
‣ Need to configure access to AWS for command line usage.
$ cat ~/.aws/credentials
[default]
aws_access_key_id = OATLIM5W7KKX1V6PQ792
aws_secret_access_key = I2WiUyTkPI7b36PQnin11oUqgZVX575tSUAB1FOm
Not my real credentials :)
15
BUILD AN ALEXA SKILL
THE INTERACTION MODEL
▸ Build the Intent Schema
▸ LatestTweets
▸ WhoTweeted
▸ Build the Sample Utterances
▸ Understanding How Users Invoke Custom Skills
▸ Alexa Skills Kit Voice Design Handbook
▸ Alexa Skills Kit Voice Design Best Practices
▸ Build the Custom Slots
▸ Tweet Category (latest, popular)
▸ Test Schema, Custom Slot Types, and Utterances
16
BUILD AN ALEXA SKILL
HANDLE THE REQUEST
app.intent('WhoTweeted',

{

utterances: [

'Who {tweeted|shared} {recently|}',

'Who recently {tweeted|shared}'

]

},

function (request, response) {

return Twitter.get('search/tweets', TwitterParams)

.then(function (tweets) {

var users = uniqueTwitterers(tweets.statuses, Constants.MAX_USERS);

var msg = Text.recentTweetsFrom(users);



response.say(msg);

});

});

▸ Create new Twitter App
▸ Get Keys and Access Tokens and Save to Environment
17
BUILD AN ALEXA SKILL
TEST THE INTENT
1. Start the server
2. Go to http://localhost:8003/test
3. Select app
4. Select Intent
5. Submit
18
BUILD AN ALEXA SKILL
BUILD TESTS
▸ Basic tests and structure already defined
▸ Create BDD-style test(s) for each intent and specific way to invoke it
▸ Same test can run against mock server, local server, remote (Lambda)
▸ gulp test-mock
▸ Sample test:
describe('against the Twitter API', function () {

describe('#LatestTweets', function () {

describe('response', function () {

it('contains the latest tweets', function () {

var result = request.intentRequest({name: 'LatestTweets'});

return result.should.eventually.match(/<speak>The last [1-9]/);

});

});

});

});
19
BUILD AN ALEXA SKILL
PUSH TO LAMBDA
▸ Configure package.json, config/app-config.js, config/aws-config.js
▸ gulp push
▸ lint
▸ test-mock
▸ test-local
▸ build-zip
▸ javascript (lib, config, vendor); images; node_modules; assets (schema, custom slot types, utterances)
▸ upload
▸ test-lambda
20
BUILD AN ALEXA SKILL
MOVE IT FORWARD
▸ Use this to write your own Twitter-based skill!
▸ Would need to cache tweets due to Twitter API throttling
▸ Cache would get around seven day tweet archive limitation
▸ Could also authenticate user’s Twitter account and interface directly
▸ Or keep it private and add more personal functionality
▸ https://github.com/rickwargo/code-camp-tweets
▸ https://github.com/rickwargo/alexa-app-root
21
BUILD AN ALEXA SKILL
CONTACT ME
▸ https://www.rickwargo.com/
▸ https://github.com/rickwargo
▸ https://linkedin.com/in/rickwargo
▸ contact@epicminds.com
▸ @rickwargo
▸ https://github.com/rickwargo/code-camp-tweets
▸ https://github.com/rickwargo/alexa-app-root
22

Contenu connexe

En vedette

Prospectus Phoenix_English
Prospectus Phoenix_EnglishProspectus Phoenix_English
Prospectus Phoenix_EnglishWalid Bessrour
 
III ENGENHARIA - Hiperlink i - Slides de Aulas
III ENGENHARIA - Hiperlink i - Slides de AulasIII ENGENHARIA - Hiperlink i - Slides de Aulas
III ENGENHARIA - Hiperlink i - Slides de AulasThays J. Perassoli Boiko
 
The Relationship of Cross-Cultural Social Network Usage Patterns to Brand Bus...
The Relationship of Cross-Cultural Social Network Usage Patterns to Brand Bus...The Relationship of Cross-Cultural Social Network Usage Patterns to Brand Bus...
The Relationship of Cross-Cultural Social Network Usage Patterns to Brand Bus...Russ Merz, Ph.D.
 
Writing Alexa Voice Skills with NodeJS- David Janes
Writing Alexa Voice Skills with NodeJS- David JanesWriting Alexa Voice Skills with NodeJS- David Janes
Writing Alexa Voice Skills with NodeJS- David JanesWithTheBest
 
Voice enable all the things with Alexa
Voice enable all the things with AlexaVoice enable all the things with Alexa
Voice enable all the things with AlexaMark Bate
 
Use Cases for Voice User Interface
Use Cases for Voice User InterfaceUse Cases for Voice User Interface
Use Cases for Voice User InterfaceStefan Ostwald
 
AWS re:Invent 2016: State of the Union: Amazon Alexa and Recent Advances in C...
AWS re:Invent 2016: State of the Union: Amazon Alexa and Recent Advances in C...AWS re:Invent 2016: State of the Union: Amazon Alexa and Recent Advances in C...
AWS re:Invent 2016: State of the Union: Amazon Alexa and Recent Advances in C...Amazon Web Services
 
Stránky z devitka 02 2016-nahled
Stránky z devitka 02 2016-nahledStránky z devitka 02 2016-nahled
Stránky z devitka 02 2016-nahledeftihia67
 
Opportunities with IOT for developers, designers & entrepreneurs
Opportunities with IOT for developers, designers & entrepreneurs Opportunities with IOT for developers, designers & entrepreneurs
Opportunities with IOT for developers, designers & entrepreneurs prashant.sachdev
 
Using Alexa, IFTTT and Watson IoT Platform to control ble devices
Using Alexa, IFTTT and Watson IoT Platform to control ble devicesUsing Alexa, IFTTT and Watson IoT Platform to control ble devices
Using Alexa, IFTTT and Watson IoT Platform to control ble devicesMarkus Van Kempen
 
Christmas Cards Portugal
Christmas Cards PortugalChristmas Cards Portugal
Christmas Cards PortugalYeh Portugal
 
Trip to Romania - Portugal
Trip to Romania - PortugalTrip to Romania - Portugal
Trip to Romania - PortugalYeh Portugal
 

En vedette (14)

Prospectus Phoenix_English
Prospectus Phoenix_EnglishProspectus Phoenix_English
Prospectus Phoenix_English
 
III ENGENHARIA - Hiperlink i - Slides de Aulas
III ENGENHARIA - Hiperlink i - Slides de AulasIII ENGENHARIA - Hiperlink i - Slides de Aulas
III ENGENHARIA - Hiperlink i - Slides de Aulas
 
The Relationship of Cross-Cultural Social Network Usage Patterns to Brand Bus...
The Relationship of Cross-Cultural Social Network Usage Patterns to Brand Bus...The Relationship of Cross-Cultural Social Network Usage Patterns to Brand Bus...
The Relationship of Cross-Cultural Social Network Usage Patterns to Brand Bus...
 
Writing Alexa Voice Skills with NodeJS- David Janes
Writing Alexa Voice Skills with NodeJS- David JanesWriting Alexa Voice Skills with NodeJS- David Janes
Writing Alexa Voice Skills with NodeJS- David Janes
 
Voice enable all the things with Alexa
Voice enable all the things with AlexaVoice enable all the things with Alexa
Voice enable all the things with Alexa
 
(2016 03-01)tos crónica(ppt)
(2016 03-01)tos crónica(ppt)(2016 03-01)tos crónica(ppt)
(2016 03-01)tos crónica(ppt)
 
Getting Started with AWS IoT
Getting Started with AWS IoTGetting Started with AWS IoT
Getting Started with AWS IoT
 
Use Cases for Voice User Interface
Use Cases for Voice User InterfaceUse Cases for Voice User Interface
Use Cases for Voice User Interface
 
AWS re:Invent 2016: State of the Union: Amazon Alexa and Recent Advances in C...
AWS re:Invent 2016: State of the Union: Amazon Alexa and Recent Advances in C...AWS re:Invent 2016: State of the Union: Amazon Alexa and Recent Advances in C...
AWS re:Invent 2016: State of the Union: Amazon Alexa and Recent Advances in C...
 
Stránky z devitka 02 2016-nahled
Stránky z devitka 02 2016-nahledStránky z devitka 02 2016-nahled
Stránky z devitka 02 2016-nahled
 
Opportunities with IOT for developers, designers & entrepreneurs
Opportunities with IOT for developers, designers & entrepreneurs Opportunities with IOT for developers, designers & entrepreneurs
Opportunities with IOT for developers, designers & entrepreneurs
 
Using Alexa, IFTTT and Watson IoT Platform to control ble devices
Using Alexa, IFTTT and Watson IoT Platform to control ble devicesUsing Alexa, IFTTT and Watson IoT Platform to control ble devices
Using Alexa, IFTTT and Watson IoT Platform to control ble devices
 
Christmas Cards Portugal
Christmas Cards PortugalChristmas Cards Portugal
Christmas Cards Portugal
 
Trip to Romania - Portugal
Trip to Romania - PortugalTrip to Romania - Portugal
Trip to Romania - Portugal
 

Dernier

The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 

Dernier (20)

The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 

How to Build An Alexa Skill

  • 1. RICK WARGO - FEB 2017 BUILD AN ALEXA SKILL 1
  • 2. BUILD AN ALEXA SKILL WHY BUILD AN ALEXA SKILL? ▸ Alexa Fund (voice technology innovation) - $100M VC Fund ▸ Alexa Prize (must be a full-time university student) ▸ Free Hoodie (just for submitting an approved skill) ▸ Opportunity! (only 10k skills as of Feb 24, 2017) ▸ It’s Fun! 2
  • 3. BUILD AN ALEXA SKILL ECHO IS EVERYWHERE ▸ Slide from April 2016 Talk at Hardwired NYC (a monthly event hosted by FirstMark in New York covering the intersection of hardware and software) by Donn Morrill, Sr. Manager of Solution Architecture for Amazon’s Alexa. https://www.slideshare.net/firstmarkcap/amazons-echo-the-present-and-future-of-alexa-donn-morrill-amazon-firstmarks-hardwired-nyc 3
  • 4. BUILD AN ALEXA SKILL WHAT CAN YOU BUILD FOR THE ECHO? ▸ The platform that drives the Echo ecosystem is the Alexa Skills Kit. ▸ Custom Skills - transactional, conversational, audio player ▸ Smart Home Skills - control cloud-connected devices ▸ Flash Briefing Skills - daily content feed for pre-recorded audio clips and text-to-speech updates ▸ There is also the Alexa Voice Service to bring voice capabilities to IoT. 4
  • 5. BUILD AN ALEXA SKILL HOW CAN YOU BUILD AN ALEXA SKILL? ▸ Node.js, Python, Ruby, C#, Java ▸ AWS Lambda, Self-Hosted ▸ Various Frameworks ▸ alexa-app ▸ flask-ask ▸ AlexaSkillsKit.NET ▸ Other Tools ▸ PullString ▸ Conversable ▸ Bespoken Tools 5
  • 6. BUILD AN ALEXA SKILL SO… ▸ It is (relatively) easy to create a new basic skill. ▸ It requires lots of diligence to get it right. ▸ AWS Lambda, Node.js, alexa-js, alexa-app-root, and this template make it easier… ▸ by simplifying Behavior Driven Design and making it part of the process. 6
  • 7. BUILD AN ALEXA SKILL IN THIS SESSION… ▸ We’ll use: ▸ Tests ▸ Lint ▸ Promises ▸ Node.js ▸ Lambda - serverless compute service (CaaS) 7
  • 8. ALEXA, ASK CODE CAMP TWEETS… BUILD AN ALEXA SKILL for the most popular items. who tweeted recently? what were the last three messages? to tell me the last tweet from Rick. 8
  • 9. BUILD AN ALEXA SKILL AMAZON’S QUICK START TUTORIAL ▸ https://developer.amazon.com/alexa-skills-kit/alexa-skill-quick-start-tutorial ▸ Step 1: Sign in to Amazon Web Services (AWS) and create a function ▸ Step 2: Use the Amazon developer portal to configure your skill ▸ Step 3: Test your Alexa skill Let’s Do This! ‣ Pluralsight has C#/Azure Alexa Training: Developing Alexa Skills for Amazon Echo 9
  • 10. BUILD AN ALEXA SKILL DEVELOPMENT RESOURCES AWS Management Console ▸ AWS Lambda - Server-less compute platform that runs a function as a response to a request. Easy to create JavaScript, Python, Java, C# functions. ▸ CloudWatch - Check logs to see what went wrong (if anything). Also see metrics of skill performing in real time Amazon Developer Portal ▸ Alexa Skills Kit Test ▸ Echo Simulator Community Edition (echosim.io) 10
  • 11. BUILD AN ALEXA SKILL ALEXA SKILLS KIT - CONCEPTS ▸ Intent Schema - JSON structure defining interactions ▸ Custom Slot Types - lists of specific items (akin to a variable) ▸ Standard Slot Types - growing list of slot types you can use in your skills. Ex: ▸ DATE, DURATION, NUMBER, TIME ▸ Animal, Book, Color, Dessert, Event Type, Festival, Game, Movie, Sport ▸ Sample Utterances - connects intents to likely spoken phrases (be verbose) ▸ alexa-utterances makes it easy to be verbose through alternation (in alexa-js) 11
  • 12. Twitter API User Voice Request Audio Stream Code-Camp-Tweets Skill Lambda JSON Request Node.js JSON Response (SSML+Card) Response (Audio) Response (Text/Graphics) Audio Response App/Web JSON Response (statuses) GET search/tweets BUILD AN ALEXA SKILL USER INTERACTION FLOW 12
  • 13. BUILD AN ALEXA SKILL BRAINSTORMING - PRE-VISUALIZE YOUR SKILL ▸ Q: What's the latest news? ▸ A: The last 1 tweet was: Rick Wargo tweeted: Join me this Sat at 11:30am - we'll build an Alexa skill that interfaces with Twitter at #PhillyCode @PhillyDotNet. ▸ Q: What's the latest popular tweet? ▸ A: There were no matching tweets. ▸ Q: What is the last 5 tweets? ▸ A: The last 5 tweets were: Rick Wargo tweeted: Join me this Sat at 11:30am - we'll build an Alexa skill that interfaces with Twitter at #PhillyCode @PhillyDotNet. Alina retweeted Stratisplatform's tweet: #Stratis are gold sponsors @PhillyDotNet on 24th-25th February explaining our #blockchain t… ▸ Q: What is the last tweet from Rick? ▸ A: The last 1 tweet was: Rick Wargo tweeted: Join me this Sat at 11:30am - we'll build an Alexa skill that interfaces with Twitter at #PhillyCode @PhillyDotNet. ▸ Q: Who tweeted? ▸ A: Recent tweets were from: Rick Wargo, Kucilo Oro, Alina, XTexplorer, and Mohammad Khalid. ▸ Q: Who shared? ▸ A: Recent tweets were from: Rick Wargo, Kucilo Oro, Alina, XTexplorer, and Mohammad Khalid. 13
  • 14. BUILD AN ALEXA SKILL CONFIGURE YOUR ENVIRONMENT ‣ Need to configure environment for keys for access to the Twitter API # Keys for code-camp-tweets skill export TWITTER_CONSUMER_KEY=hSYvOtda3Ri74PkyuTOHrLMdf export TWITTER_CONSUMER_SECRET=LXHvTRShADq0s8lOlHCPodPw1smNeJ5p6E8GyOlY9cM0Ti5QSX export TWITTER_ACCESS_TOKEN_KEY=WVUXxMzZPrszP2AO3eQIogJNFIA2vqkO5bmRkCiO1zCdr7KSt6 export TWITTER_ACCESS_TOKEN_SECRET=tMOuVnb3nrlwtNgUtr9qCZTdEqj6SpqbJrt7uysGuf5oU Not my real keys :) 14
  • 15. BUILD AN ALEXA SKILL AWS CREDENTIALS ‣ Need to configure access to AWS for command line usage. $ cat ~/.aws/credentials [default] aws_access_key_id = OATLIM5W7KKX1V6PQ792 aws_secret_access_key = I2WiUyTkPI7b36PQnin11oUqgZVX575tSUAB1FOm Not my real credentials :) 15
  • 16. BUILD AN ALEXA SKILL THE INTERACTION MODEL ▸ Build the Intent Schema ▸ LatestTweets ▸ WhoTweeted ▸ Build the Sample Utterances ▸ Understanding How Users Invoke Custom Skills ▸ Alexa Skills Kit Voice Design Handbook ▸ Alexa Skills Kit Voice Design Best Practices ▸ Build the Custom Slots ▸ Tweet Category (latest, popular) ▸ Test Schema, Custom Slot Types, and Utterances 16
  • 17. BUILD AN ALEXA SKILL HANDLE THE REQUEST app.intent('WhoTweeted',
 {
 utterances: [
 'Who {tweeted|shared} {recently|}',
 'Who recently {tweeted|shared}'
 ]
 },
 function (request, response) {
 return Twitter.get('search/tweets', TwitterParams)
 .then(function (tweets) {
 var users = uniqueTwitterers(tweets.statuses, Constants.MAX_USERS);
 var msg = Text.recentTweetsFrom(users);
 
 response.say(msg);
 });
 });
 ▸ Create new Twitter App ▸ Get Keys and Access Tokens and Save to Environment 17
  • 18. BUILD AN ALEXA SKILL TEST THE INTENT 1. Start the server 2. Go to http://localhost:8003/test 3. Select app 4. Select Intent 5. Submit 18
  • 19. BUILD AN ALEXA SKILL BUILD TESTS ▸ Basic tests and structure already defined ▸ Create BDD-style test(s) for each intent and specific way to invoke it ▸ Same test can run against mock server, local server, remote (Lambda) ▸ gulp test-mock ▸ Sample test: describe('against the Twitter API', function () {
 describe('#LatestTweets', function () {
 describe('response', function () {
 it('contains the latest tweets', function () {
 var result = request.intentRequest({name: 'LatestTweets'});
 return result.should.eventually.match(/<speak>The last [1-9]/);
 });
 });
 });
 }); 19
  • 20. BUILD AN ALEXA SKILL PUSH TO LAMBDA ▸ Configure package.json, config/app-config.js, config/aws-config.js ▸ gulp push ▸ lint ▸ test-mock ▸ test-local ▸ build-zip ▸ javascript (lib, config, vendor); images; node_modules; assets (schema, custom slot types, utterances) ▸ upload ▸ test-lambda 20
  • 21. BUILD AN ALEXA SKILL MOVE IT FORWARD ▸ Use this to write your own Twitter-based skill! ▸ Would need to cache tweets due to Twitter API throttling ▸ Cache would get around seven day tweet archive limitation ▸ Could also authenticate user’s Twitter account and interface directly ▸ Or keep it private and add more personal functionality ▸ https://github.com/rickwargo/code-camp-tweets ▸ https://github.com/rickwargo/alexa-app-root 21
  • 22. BUILD AN ALEXA SKILL CONTACT ME ▸ https://www.rickwargo.com/ ▸ https://github.com/rickwargo ▸ https://linkedin.com/in/rickwargo ▸ contact@epicminds.com ▸ @rickwargo ▸ https://github.com/rickwargo/code-camp-tweets ▸ https://github.com/rickwargo/alexa-app-root 22