Amazon Echo Documentaion

Setting up an Orbital skill  with Amazon

How to set up the Orbita voice and configure Amazon Alexa Skill

Intents and Slots

Understanding Intents and slots

Voice Nodes

Understanding the voice nodes

 

To edit or create a configuration, double clicking on the Launch Voice Node, or the Intent Node

 

Orbita Skill Configuration

Double click on either the Launch Node or an Intent Node.

 

alexaskillconfig

 

Setup Tab

Skill Name the name of the skill, note you can be managing more than one skill. The Delete Button lets you delete the sill that is named in the Skill Name text box,

 

Intents An array of intents

 
[
 {
 "name": "NumberIntent",
 "options": {
 "slots": {
 "integerPart": "NUMBER",
 "fractionPart": "NUMBER"
 },
 "utterances": [
 "{-|integerPart} point {-|fractionPart} {pounds |percent |}",
 "{-|integerPart} point {-|fractionPart} hours",
 "{-|integerPart} {pounds |percent|hours|percent |feet |steps |}",
 "{-|integerPart} over {-|fractionPart}", 
 "{-|integerPart} {feet |feet and |hours |hours and} {-|fractionPart} {inches |minutes |}"
 ]
 }
 },
 {
 "name": "DateIntent",
 "options": {
 "slots": {
 "date": "DATE"
 },
 "utterances": [
 "{I was born |}{-|date}"
 ]
 }
 },
 {
 "name": "AMAZON.YesIntent"
 },
 {
 "name": "AMAZON.NoIntent"
 },
 {
 "name": "AMAZON.PreviousIntent"
 },
 {
 "name": "AMAZON.RepeatIntent"
 },
 {
 "name": "AMAZON.CancelIntent"
 },
 {
 "name": "AMAZON.StopIntent",
 "options": {
 "utterances": [
 "Good bye",
 "quit",
 "bye bye"
 ]
 }
 },
 {
 "name": "AMAZON.HelpIntent"
 },
 {
 "name": "Survey",
 "options": {
 "slots": {
 "SurveyName": "List_Of_Surveys"
 },
 "utterances": [
 "survey {-|SurveyName}",
 "{-|SurveyName} survey"
 ]
 }
 },
 {
 "name": "GetTasks",
 "options": {
 "utterances": [
 "what are my tasks {for today |}",
 "tell me my tasks {for today |}",
 "what tasks do I have {today |}",
 "what tasks do i need to do {today |}",
 "my tasks {today |}",
 "tasks {today |}"
 ]
 }
 },
 {
 "name": "GetContent",
 "options": {
 "utterances": [
 "get content",
 "content to voice"
 ]
 }
 },
 {
 "name": "GetWebContent",
 "options": {
 "utterances": [
 "Orbita web site",
 "get web content"
 ]
 }
 },
 {
 "name": "Weather",
 "options": {
 "utterances": [
 "the weather is",
 "get the weather"
 ]
 }
 },
 {
 "name": "MessageIntent",
 "options": {
 "slots": {
 "Message": "List_Message_Values"
 },
 "utterances": [
 "post {-|Message}",
 "message {-|Message}",
 "{-|Message}"
 ]
 }
 },
 {
 "name": "LogHealthData",
 "options": {
 "slots": {
 "integerPart": "NUMBER",
 "fractionPart": "NUMBER",
 "measurementType": "LIST_OF_MEASUREMENT_VALUES"
 },
 "utterances": [

 "my {-|measurementType} is {-|integerPart} point {-|fractionPart} {pounds |percent |}",
 "my {-|measurementType} is {-|integerPart} {pounds |percent|hours|percent |feet |steps |}",
 "my {-|measurementType} is {-|integerPart} {feet |feet and |hours |hours and} {-|fractionPart} {inches |minutes |}",
 "my {-|measurementType} is {-|integerPart} over {-|fractionPart}",
 "i have {took |taken |drank} my {-|measurementType}"
 ]
 }
 },
 {
 "name": "ReadHealthData",
 "options": {
 "slots": {
 "measurementType": "LIST_OF_MEASUREMENT_VALUES"
 },
 "utterances": [
 "what is my {-|measurementType} {count |}",
 "tell me my {-|measurementType} {count |}",
 "how much do I {-|measurementType}",
 "how much did I {-|measurementType}",
 "how many {-|measurementType}",
 "{When |} did I take my {-|measurementType}"
 ]
 }
 }
]

Example – Custom Slot Types

customslots

 

Type – LIST_OF_MEASUREMENTS_VALUES,VALUES bfp, glucose, height, heart rate, oximetry,…

{
  "name": "LogBodyMesurement",
  "options": {
    "slots": {
      "integerPart": "NUMBER",
      "fractionPart": "NUMBER",
      "measurementType": "LIST_OF_MEASUREMENT_VALUES"
    },
   "utterances": [
      "my {-|measurementType} is {-|integerPart} point {-|fractionPart}",
      "my {-|measurementType} is {-|integerPart}",
      "my {-|measurementType} is {-|integerPart} hours {-|fractionPart}",
      "my {-|measurementType} is {-|integerPart} feet {-|fractionPart} inches"
    ]
  }
}

 

Utterances

 

The utterances syntax allows you to generate many of sample utterances using just a few samples that get auto-expanded. Any number of sample utterances may be passed in the utterances array. Below are some sample utterances macros and what they will be expanded to.

 

Multiple Options Mapped To A Slot

      "my favorite color is {red|green|blue|NAME}"
      =>
      "my favorite color is {red|NAME}"
      "my favorite color is {green|NAME}"
      "my favorite color is {blue|NAME}"

 

Generate Multiple Versions Of Static Text

This lets you define multiple ways to say a phrase, but combined into a single sample utterance

      "{what is the|what's the|check the} status"
      =>
      "what is the status"
      "what's the status"
      "check the status"

 

Auto-Generated Number Ranges

When capturing a numeric slot value, it’s helpful to generate many sample utterances with different number values

      "buy {2-5|NUMBER} items"
      =>
      "buy {two|NUMBER} items"
      "buy {three|NUMBER} items"
      "buy {four|NUMBER} items"
      "buy {five|NUMBER} items"

 

Number ranges can also increment in steps

      "buy {5-20 by 5|NUMBER} items"
      =>
      "buy {five|NUMBER} items"
      "buy {ten|NUMBER} items"
      "buy {fifteen|NUMBER} items"
      "buy {twenty|NUMBER} items"

 

Optional Words

      "what is your {favorite |}color"
      =>
      "what is your color"
      "what is your favorite color"

 

Start page

Typical launch flow

Launch Node

This node receives a Launch Request when the user invokes the skill with the invocation name (“Heather”), but does not provide any command mapping to an intent.

 

The node will create
msg.payload.session.user.firstName
msg.payload.session.user.lastName
msg.payload.session.user.currentUserId

 

Say Node

 

 

Say, Text field is converted to voice, it can contain Mustache {{tag}} template

Mustache {{tag}} template is applied to the data from msg.payload

Example Say: Hi {{session.user.firstName}} you have a message, {{session.attributes.LastSlots.Message.value}}

Example Say: You said your blood pressure is {{request.intent.slots.Systolic.value}} over {{request.intent.slots.Diastolic.value}}

Using the The Function Node, you can append data to msg.payload

var weather = {temperature:”70″, condition:”raining”}
msg.payload.weather = weather;

 

Example Say: 

Hi {{session.user.firstName}} the temperature is {{weather.temperature}} and it is {{weather.condition}}

Re-Prompt text field is used when no utterance is spoken, after about 8 seconds the Re-Prompt text is spoken, it can contain Mustache {{tag}} template

End Session Check box, if checked, The Echo session will end, i.e. the blue light will go out when the Alexa Response is sent

 

Speech Synthesis Markup Language (SSML)

Supports Speech Synthesis Markup Language (SSML) See Doc

The Intent Request Node

 

This node is executed when a user speaks an utterance to the Amazon Echo that matches this node’s Skill Select, the Intent Select and State Select (if one is selected).

The Request object sent to your service includes the specific intent and any defined slot values
msg.payload.request.intent.slots.SlotName.value
The Request object includes the previous intent slot values
msg.payload.session.attributes.LastSlots.SlotName.value

Drop down Skilll must match the skill selected in the Launch node

Drop down Intent select one of the intents, these come from the configuration array of Intents. This node is executed if the Intent is matched and Last Intent is not selected or it matches the last Intent

Drop down Last Intent is optional, it can be used when you want this itent to executed only if the last intent was the previous state

 

Forcing the Sate using Function Node

msg.alexaResponse.session(“LastIntent”, “pain”);
return msg;

Example: The Launch Intent, using the Say node, What is your pain level from 1 to 10.  User response 7,   You need to know that number was associated with a pain intent.

Alexa Card Node

Adds a card to the users Alexa app

Example:

{
“type”: “Simple”,
“title”: “Blood Pressure Logged”,
“content”: “Your blood pressure is {{session.attributes.LastSlots.Systolic.value}} over {{session.attributes.LastSlots.Diastolic.value}}. Thanks you”
}

Mustache {{tag}} template is applied to the data from msg.payload

For Object definition see developer.amazon.com

Session End Request

Your service receives a SessionEndedRequest when a currently open session is closed

Possible reasons for closure:

  1. The user says “exit”
  2. An error occurs

Avoiding:  The requested skill took too long to respond

When Amazon echo waits for a response and the user says something that does not match one of the utterance, Amazon will assign it to the Intent that it thinks is the closest.  Often one Intent becomes the go to Intent.  For example if you say something like “Canada”,  It might call an Intent like BloodPressure, but the slots will be empty.  In that case you want to add validation to the intents and respond with something like “I did not understand”.

  1. Avoid having intents with utterances that are not used.  If it defaults to one of these intents nothing handles it.
  2. Use the developer.amazon.com,  Alexa –> Skill–>YourSkill   and go to the Tab Test, type in things that do not match any utterance and see what intent gets called.

I am text block. Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.