Skip to content
This repository has been archived by the owner on Sep 18, 2023. It is now read-only.

slalom/alexa-skill

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Introduction:

Build the Alexa Interaction Model (the front-end) and point it to the back-end lambda function.

Before you Begin

You will need an account with developer.amazon.com.

Go to developer.amazon.com and sign in with the same email address that you’ve registered your Amazon Echo with.

Create a New Skill

  1. Go to developer.amazon.com/alexa.
  2. Click Create Alexa Skills and then click Console. This opens the developer console and displays any skills you have already created.
  3. Click Create Skill.
  4. Enter the Skill name "MyTravelSkill".
    • Skill name: This is the name customers will see when you publish the skill. You can edit this name later on the Distribution page.
    • Default language: You can add additional languages to the skill later.
  5. Click the Custom model. Click here for more details about different models.
  6. Select Alexa-Hosted(Node.js) to host your backend code to the AWS.
  7. Click Create skill.

  1. Select Start from Scratch and then click Continue with template.

You should be landed to the Build page.

Add Invocation Name

Users say a skill's invocation name to begin an interaction with a particular custom skill.

  1. From the left navigator, Click Invocations and then Skill Invocation Name
  2. Change to Skill Invocation Name to mytravelskill

Add Intents, Slots, and Utterances

An intent represents an action that fulfills a user's spoken request. Intents can optionally have arguments called Slots. The utterances specify the words and phrases users can say to invoke your intents.

  1. From the checklist, click the second bullet Intents, Samples, and Slots
  2. Enter the name of the new intent PlanMyTrip and click Create custom intent. This adds a new intent and opens its detail page, displaying the intent's sample utterances and slots.
  3. Click Create custom intent

  1. In the Intents Slots section, create below slots.

  1. Enter below sample utterances:
  • i am going on a trip on friday
  • i want to visit portland
  • i want to travel from seattle to portland next friday

Once you have written a few utterances, note the words or phrases that represent variable information. These will become the intent's slots. For example, in the utterances identified above, the variables that are highlighted next friday, seattle, and portland.

  1. In an utterance, highlight the word or phrase representing the slot value.
  2. In the drop-down that appears, select the slot. This will replace the original value in the utterance with the slot name in curly brackets ({ }).

  1. Click Save Model

  2. Click Build Model.

By creating this intent, if user says: "Alexa, ask Plan My Trip i want to travel from seattle to portland next friday."

The Alexa service sends the Plan My Trip service a PlanMyTrip intent with the value "Seattle" in the fromCity slot, "Portland" in the toCity slot and the date for the next upcoming Friday travelDate slot. The service can then save this information and send back text to convert to speech.

Slots are defined with different types. The travelDate slot in the above example uses Amazon's built-in AMAZON.DATE type to convert words that indicate dates (such as "today" and "next friday") into a date format, while both fromCity and toCity use the built-in AMAZON.US_CITY slot.

Develop/Deploy Alexa's AWS Lambda code:

  1. Click Code on the top menu.
  2. Open index.js file.
  3. Replace all code with the code here.
  4. Click Save.
  5. Click Deploy.

Test you skill

Use the simulator provided on the Test page in the developer console. This gives you access to most Alexa Skills Kit features without a device. You can interact with Alexa using either voice or text.

  1. Click Test from top menu
  2. You might get below pop-up. Click Allow to be able to use your microphone.

  1. Select Development from dropdown on top of the page
  2. In the Alexa Simulator tab, you can type or hold the mic icon to talk.
  3. Say below sentences and see the response from Alexa,
  • ask mytravelskill i am going on a trip on friday
  • ask mytravelskill i want to visit portland
  • ask mytravelskill i want to travel from seattle to portland next friday

Endpoint

The Interaction Model is connected to a Lambda Function via Endpoints. Depending on the Intent detected, Lambda Function running on AWS executes a task () and the result is returned to the Interaction Model.

The Endpoint will receive POST requests when a user interacts with your Alexa Skill. You can link your Skill with Lambda (Recommended) or you can host your endpoint using an HTTPS web service that you manage.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published