Skip to content

Instantly share code, notes, and snippets.

@jforge
Last active June 22, 2017 15:31
Show Gist options
  • Select an option

  • Save jforge/b554afcd01175ce6de141401485fa4b0 to your computer and use it in GitHub Desktop.

Select an option

Save jforge/b554afcd01175ce6de141401485fa4b0 to your computer and use it in GitHub Desktop.
1. Check-in at http://alexa.design/hamburgskills
2. Create a free account at http://developer.amazon.com
3. Create an account at http://aws.amazon.com
Build & publish THREE skills within 30 days!
-> get a device
Alexa Resources
http://alexa.design/ask
aws.amazon.com
http:/github.com/alexa
http://alexa.design/day1
http://alexa.design/training
Creating a skil:
Alexa, open hello world
|
wakeword
|
starting phase
|
skill invocation nmae
https://github.com/alexa/alexa-cookbook/tree/master/labs/Day-1
http://alexa.design/Day1
- Project Structure (Alexa Skill consist of a frontend and a backend)
/SpeechAssets (frontend)
/IntentSchema.json
/SampleUtterances.txt
/src (backend
/index.js
- Alexa Skill Templates
-- Facts/Tip of the day
-- City Guide
-- Quiz Gamer
-- Team Lookup
-- Decision Tree
-- Calender Reader
1. simple hello world skill (see amazon cookbook on github)
-- create skill...
-- create lambda from fact skill template
-- Lambda -> create a custom role -> lambda_basic_execution
-- test: https://echosim.io/
2. Number Facts
...
3. Intent-Schemas
- each intent is a behaviour to your skill
- three built-in intent are at least required additionally for publishing:
...
{
"intent": "AMAZON.HelpIntent"
},
{
"intent": "AMAZON.StopIntent"
},
{
"intent": "AMAZON.CancelIntent"
}
]
- Lambda function handlers
- emit with :tell, :ask, :tellWithCard, :askWithCard
-- withCard emits a card to the alexa app
-- ask waits for user input until a good-bye or something ends the interaction with the user
-- tell completes the interaction
4. endpoint communication
- response body
-- outputSpeech: alexas response
-- card (optional): grpahical resource
-- reprompt (optional): reminder
-- shouldEndSession: used to end or keep session open
5. number facts from external api
http://numbersapi.com/#42
- see Day-1 Part 4 in Cookbook
- alexa has a 7sec timeout, external call should answer within 3-4 secs
-- on timeout alexa can prompt some information about timeou
6. case study: alexa skill "empfangsdame"
https://de.slideshare.net/eggertralf/casestudy-fr-alexa-skill-empfangsdame
- top-10 skill to welcome guests ;-)
- tech stack
-- alexa skills kit
-- https service end point (no aws lambda)
-- php 7
-- zend/expressive framework
-- phpunit/postman
- issues
-- signature validation
-- single-word invocation
-- response time during certification
- biggest challenges
-- slot type for german first names incomplete
-- signature validation (no problem on aws lambda)
-- setup second end point server (for testing)
- statistics
-- top 10 of activated skills a week after going live
-- 54 customer reviews so far
-- may 2017: 25000 customers, 50000 sessions, 450000 utterances
- next one by ralf eggert: skill "langeweilekillerin"
- learnings
-- test and test and test
-- don't forget the signature validation
-- do not trust the built-in slot types blindly -> test and extend them
-- build more than 1 skill
7. number facts with custom slots
Alexa, ask number facts to tell me a math fact about two
wakeword
|
starting phase
|
skill invocation name
|
utterance
| |
slot slot
8. Setting session attributes
- set content into this.attributes to store session attributes, e.g.:
httpGet(myRequest, (myResult) => {
console.log("sent : " + myRequest);
console.log("received : " + myResult);
this.attributes.lastSearch = {theNumber,factType};
this.attributes.lastSearch.lastSpeech = myResult;
this.emit(':ask', myResult );
});
- change this.emit to :ask instead of :tell (opens a session, timeout with reprompt 7 seconds, up to 45 secs overall?)
- emit a reprompt on the help intent
'AMAZON.HelpIntent': function () {
var speechOutput = HELP_MESSAGE;
var reprompt = HELP_REPROMPT;
this.emit(':ask', speechOutput, reprompt);
},
- session attributes
-- must follow object structure
-- name:value
-- values can be any type
- this.attribute["key"]=value
- ask vs. tell
-- this.emit(":tell",...)
present data to uer, ends conversation (session)
-- this.emit(":ask",...)
wait for user input, doesn't end conversation (session)
9. Getting session attributes
- add the repeat intent to 8.
"AMAZON.RepeatIntent": function() {
this.emit(":ask",this.attributes.lastSearch.lastSpeech, this.attributes.lastSearch.lastSpeech);
}
10. Custom Skill by template
https://github.com/alexa/skill-sample-nodejs-decision-tree
11. DynamoDB - persist session attributes
https://github.com/alexa/alexa-cookbook/tree/master/aws
12. publishing skills
- make example phrases (many)
- sample utterances must match the stored utterances
- grammar won't be supported
- follow the testing instructions
- before you publish
-- beta test your skills http://alexa.desgin/SkillBetaTesting
-- certification tips: http://alexa.desgin/CertTips
-- certification checklist http://alexa.desgin/CertChecklist
13. Voice Design Principles
- what we learnt helping developers and designers build skills
- 1. Design for ear, not for eye
-- what looks good on paper, may not sound good when spoken
- 2. Don't assume users know what to do
-- help with discovery of features, and things they can say
- 3. Keep it brief
-- short conversation, max. 10 seconds of overall interaction time
- 4. Clearly present the options
-- bad: would you like French fries or a salad? -> yes :-(
-- good: which side would you like: french fries or a salad? -> salad
- 5. One piece of information at a time
- 6. Don't overwhelm the user - asking
keep it simple, assume some intelligence to talk
- 7. Don't overwhelm the user - answering
- 8. Examples are better than instructions
19. Interesting APIs
- http://numbersapi.com/#42
- https://api.chucknorris.io/
- https://developer.deutschebahn.com
20. Future capabilities
- notification api (actively start to speak) -> webhook
-- create long-term interaction? (come back in <n> minutes?)
- recognize users by voice
21. TODO Review:
- Third party tools to test skills and lambda functions
- AWS CLI for lambda upload:
https://developer.amazon.com/de/blogs/post/tx1ue9w1nq0gyii/publishing-your-skill-code-to-lambda-via-the-command-line-interface
- AWS Polly (Speech Synthesis)
- AWS Lex (Speech Recognition)
- interaction without using the alexa sdk (review json contracts)
- Session Attributes, store user information in dynamodb etc.
https://github.com/alexa/alexa-cookbook/tree/master/labs/HelloWorld
- External Webservices:
https://github.com/alexa/alexa-cookbook/tree/master/external-calls/httpsGet
- built-in intents (Cancel, Help, Stop, Next, No, Repeat, StartOver, ShuffeOn, Yes-Intent)
- Invocation Name GuideLines:
https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/choosing-the-invocation-name-for-an-alexa-skill#invocation-name-requirements
- Certification Requirements:
https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/alexa-skills-kit-submission-checklist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment