Skip to content

Latest commit

 

History

History
executable file
·
115 lines (70 loc) · 9.72 KB

1-voice-user-interface.md

File metadata and controls

executable file
·
115 lines (70 loc) · 9.72 KB

Build An Alexa Trivia Skill

Voice User InterfaceLambda FunctionConnect VUI to CodeTesting

Setting up Your Alexa Skill in the Developer Portal

There are two parts to an Alexa skill. The first part is the Voice User Interface (VUI). This is where we define how we will handle a user's voice input, and which code should be executed when specific commands are uttered. The second part is the actual code logic for our skill, and we will handle that on page #2 of this step-by-step guide.

  1. Go to the Amazon Developer Portal. In the top-right corner of the screen, click the "Sign In" button.
    (If you don't already have an account, you will be able to create a new one for free.)

  2. Once you have signed in, click the Alexa button at the top of the screen.

  3. On the Alexa page, choose the "Get Started" button for the Alexa Skills Kit.

  4. Select "Add A New Skill." This will get you to the first page of your new Alexa skill.

  5. Fill out the Skill Information screen. Make sure to review the tips we provide below the screenshot.

    Skill Information Tips

    1. Skill Type For this skill, we are creating a skill using the Custom Interaction Model. This is the default choice.

    2. Language Choose the first language you want to support. You can add additional languages in the future, but we need to start with one. (This guide is using U.S. English to start.)

    3. Name This is the name that will be shown in the Alexa Skills Store, and the name your users will refer to.

    4. Invocation Name This is the name that your users will need to say to start your skill. We have provided some common issues developers encounter in the list below, but you should also review the entire Invocation Name Requirements.

      Invocation Name Requirements Examples of incorrect invocation names
      The skill invocation name must not infringe upon the intellectual property rights of an entity or person. korean air; septa check
      Invocation names should be more than one word (unless it is a brand or intellectual property), and must not be a name or place horoscope; trivia; guide; new york
      Two word invocation names are not allowed when one of the words is a definite article, indefinite article, or a preposition any poet; the bookie; the fool
      The invocation name must not contain any of the Alexa skill launch phrases and connecting words. Launch phrase examples include "launch," "ask," "tell," "load," and "begin." Connecting word examples include "to," "from," "by," "if," "and," "whether." trivia game for star wars; better with bacon
      The invocation name must not contain the wake words "Alexa," "Amazon," "Echo," or the words "skill" or "app." hackster initial skill; word skills
      The invocation name must be written in each language you choose to support. For example, the German version of your skill must have an invocation name written in German, while the English (US) version must have an invocation name written in English. kitchen stories (German skill)
    5. Audio Player For this Quiz skill, we won't be using any audio files, so you can select No for this option. If you would like to learn more about adding audio to your skills, please check out our Audio Player Guide.

  6. Click the Next button to move to the Interaction Model.

  7. Click on the Launch Skill Builder (Beta) button. This will launch the new Skill Builder Dashboard.

    Launch Skill Builder

  8. Click on the "Add+" button near Intents on the top left corner of the dashboard.

    Add Intent Button

    OPTIONAL: You can choose to upload a file to fill out your interaction model. To do that for this sample click on the </> Code Editor tab and drag the JSON file, IntentSchema.json, from the speechAssets folder of the sample code to the cloud upload icon. Once you're done, click Apply Changes. You can follow along with the rest of steps to see how things work or move onto step 9.

  9. Select Use an existing intent from the built-in library. In the textbox provided enter AMAZON.StartOverIntent or select that intent from the list of matching intents as they appear, then click the Add Intent button.

  10. Repeat the above adding and add the AMAZON.RepeatIntent.

  11. Next we will create a custom intent that will allow users to answer questions. Click on the "Add+" button near Intents on the top left corner of the dashboard. Select Create a new custom intent and enter AnswerIntent in the textbox.

  12. Add some sample utterances for the intent. These are the things a user might say to answer a multiple choice question. The word {Answer} within the {} will be mapped to the number of the multiple choice question. Enter the following:

    • it is {Answer}

    • my answer is {Answer}

    • the answer is {Answer}

    • {Answer} is my answer

    • {Answer}

      As you type the utterances you notice that words within the {} are automatically converted into "slots" (right hand panel). When we have completed entering the utterances we will configure the slots so that they can be used in our code.

  1. Define the Slot Type for newly created Slot. In the right hand panel select the slot called Answer and click on its Edit icon. From the Slot Type dropdown select the predefined slot type AMAZON.NUMBER.

  2. Now we must define the range of "numbers" supported by the Answer slot of type AMAZON.NUMBER. Select the Answer Slot from the Slot Types panel in the lower left of the screen and enter the following numbers into the Slot Values field:

    • 1
    • 2
    • 3
    • 4

  3. Next we will add a Custom intent to allow users to skip a question or answer that they "don't know". Click on the "Add+" intent button and select Create a new custom intent then enter DontKnowIntent in the textbox. Add the following to the Sample Utterances:

    • I don't know that one
    • I don't know that
    • don't know the answer
    • who knows
    • skip
    • don't know
  4. Finally Click on the Save Model button, and then click on the Build Model button.

If you get an error from your interaction model, check through this list:

  • Did you copy & paste the provided code into the appropriate boxes?
  • Did you accidentally add any characters to the Interaction Model or Sample Utterances?

In the next step of this guide, we will create our Lambda function in the AWS developer console, but keep this browser tab open, because we will be returning here on Page #3: Connect VUI to Code.