User Tools

Site Tools


using_alexa_skills_kit

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
using_alexa_skills_kit [2016/12/29 17:40] tbrodeurusing_alexa_skills_kit [2017/05/30 16:42] (current) tbrodeur
Line 1: Line 1:
-<fc #008000><fs x-large>Creating the Skill with Amazon Skills Kit</fs></fc>+<fc #008000><fs x-large>Creating the Skill with Alexa Skills Kit</fs></fc>
  
 <color #22b14c>----------------------------------------------------------------------------------------------------------------------------- <color #22b14c>-----------------------------------------------------------------------------------------------------------------------------
Line 78: Line 78:
 -In the Alexa architecture, Intents can be thought of as distinct functions that a Skill can perform. The Alexa platform uses an “Intent Schema”, expressed in JSON, to communicate which function the code for a Custom Skill should execute to fulfill a given request. Intents can also take arguments which are known here as Slots. -In the Alexa architecture, Intents can be thought of as distinct functions that a Skill can perform. The Alexa platform uses an “Intent Schema”, expressed in JSON, to communicate which function the code for a Custom Skill should execute to fulfill a given request. Intents can also take arguments which are known here as Slots.
  
-//-For our "Hello World" example, we’ll want to be able to ask Alexa to say "Hello World" to the user when requested.For this, we'll use an intent titled "Hello".//+<fc #4682b4>//-For our "Hello World" example, we’ll want to be able to ask Alexa to say "Hello World" to the user when requested.For this, we'll use an intent titled "Hello".//</fc>
  
 -Alexa has a few standard Intents that Custom Skills should implement: -Alexa has a few standard Intents that Custom Skills should implement:
Line 88: Line 88:
 - An Intent Schema defines the set of Intents used by the skill, intent parameters, known as Slots, and Utterances, phrases that the user will say to execute one of the intents defined in the Intent Schema. - An Intent Schema defines the set of Intents used by the skill, intent parameters, known as Slots, and Utterances, phrases that the user will say to execute one of the intents defined in the Intent Schema.
  
-//-For the "Hello World" example, our intent schema will look like this://+<fc #4682b4>//-For the "Hello World" example, our intent schema will look like this://</fc>
  
 <code JSON> <code JSON>
Line 108: Line 108:
 } }
 </code> </code>
 +
 +<color #22b14c>-----------------------------------------------------------------------------------------------------------------------------
 +</color>
 +
 +<fs large>**Configuring Sample Utterances**</fs>
 +
 +-“Sample Utterances” are where we define the phrases that Alexa needs to hear in order to invoke each of our Custom Skill’s Intents. This is done using a simple text list of the format:
 +
 +<code json>
 +<Intent Name>""<Phrase>
 +</code>
 +
 +-Where “” can optionally contain references to Slots (arguments). 
 +
 +<fc #4682b4>//-If you are following the "Hello World" tutorial, we’ll use the following set of Sample Utterances here://</fc>
 +
 +<code json>
 +Hello say hello
 +Hello speak hello
 +Hello hello
 +</code>
 +
 +-Note also that we don’t need to provide sample utterances for the stop, cancel, and help intents. Alexa understands appropriate phrases to invoke each of these out of the box.
 +
 +-Once the interaction model is complete, click next and continue on to the configuration tab to link your skill with your function.
 +
 +<color #22b14c>-----------------------------------------------------------------------------------------------------------------------------
 +</color>
 +
 +<fs large>**Linking with the Lambda Function**</fs>
 +
 +
 +{{:screen_shot_2016-12-31_at_1.50.57_pm.png|}}
 +
 +-If you are running your code with AWS Lambda, choose AWS Lambda ARN, else choose HTTPS.
 +
 +<fc #4682b4>//-If you are following the "Hello World" tutorial, we will be using AWS Lambda.//</fc>
 +
 +-Depending on the region you are in, choose either North America or Europe and insert your Amazon Resource Code (ARN) listed in the top right corner of your lambda function in your AWS console.
 +
 +{{:screen_shot_2016-12-31_at_1.58.29_pm.png|}}
 +
 +
 +-Also make sure to change the application id in your lambda function that handles the event to the id code listed under your skill name:
 +
 +{{:screen_shot_2016-12-31_at_2.14.36_pm.png|}}
 +
 +-Click "Next"
 +
 +<color #22b14c>-----------------------------------------------------------------------------------------------------------------------------
 +</color>
 +
 +<fs large>**Testing**</fs>
 +
 +
 +{{ youtube>K0gyfY5D9dM?medium }}
 +
 +
 +----
 +
 +
 +The Custom Skill can be tested using the Service Simulator within the Amazon Developer portal and without the need to use an Echo hardware device. We can type in sample sentences that the user might speak, view the JSON message that is sent to the Lambda function and its response JSON as well as listen to how the response would sound when played back on an Echo.
 +
 +Here we can see that Alexa determined that this request related to the “Hello” intent (because we used a phrase from our sample utterances that are associated with that intent).
 +
 +The Lambda function read “Hello” as the intent and called the say_hello Python function that we wrote.
 +
 +If an Echo device is associated with our Amazon developer account, we can go ahead and directly test this with that device. If not, we can hear what the response would sound like simply by pressing the “Listen” button in the Service Simulator.
 +
 +<color #22b14c>-----------------------------------------------------------------------------------------------------------------------------
 +</color>
 +
 +<fs large>**Next Steps**</fs>
 +
 +-If you are following the "Hello World" tutorial, you are now finished.
 +
 +-Using this base knowledge, go on to create custom skills such as a [[echo_stock_price|stock price skill]].
 +
 +
 +
using_alexa_skills_kit.1483062021.txt.gz · Last modified: by tbrodeur