Chevron Left Icon
Use Dialog Management in Voice Interaction
Lesson 1 of 4
Chevron Right Icon
  1. 1
    #### Human Conversations Take a look at the script to the right. If you are recommending a movie to a friend, you may have a dialog that looks like this. Before you can make a good recommendation, …
  2. 2
    We’ll be using Dialog Management with an example “Video Match” skill. Before we add Dialog Management features, we need to create the basic skill: follow the walk-through below. If you need a refre…
  3. 3
    In a typical voice conversation, a user might provide all parts of their request in one go (Single Turn Conversation), or our skill may need to go back and forth prompting the user for each piece o…
  4. 4
    Alexa Skills Kit’s Dialog Management feature provides a simple way to handle both single and multi-turn conversations. If a user doesn’t provide all necessary slot values in one turn of the convers…
  5. 5
    Good work so far! Let’s make sure that slot elicitation works before moving on. #### Add an endpoint 1. You haven’t made a Lambda function for the Video Match skill yet, but don’t worry! Codecadem…
  6. 6
    Some pieces of information deserve confirmation, such as: - Amounts of money - Dates and times - Values with multiple meanings (e.g. Springfield, Illinois or Springfield, Massachusetts?) - Words …
  7. 7
    Excellent! Let’s test the slot confirmation for genre. If your skill has multiple slots marked as required with prompts and utterances set, Alexa will elicit the slots in the order in which the sl…
  8. 8
    Alexa can confirm intents as well as slots. Why? There can be serious consequences if Alexa misinterprets some requests, like: - Actions that are publicly visible (e.g. posting to social media) - …
  9. 9
    Well done! Let’s test the intent confirmation. #### Test intent confirmation 1. Go to the Test tab to open the Alexa Simulator. 2. You are testing that your Interaction Model confirms the int…
  10. 10
    Congrats! You’ve added Dialog Management to your skill’s interaction model and activated its three main features: - slot elicitation: asking for input from the user with prompts and expecting …
  1. 1
    With Dialog Management, you can specify prompts and user utterances for slot elicitation and provide prompts for slot and intent confirmation. All of this can be done in the Developer Console…
  2. 2
    Once Dialog Management has been enabled for your skill (by making slots required), at every turn of the conversation, Alexa includes the status of slot collection as the dialogState property in th…
  3. 3
    At every turn of the conversation your Lambda function can access the dialog state stored in the JSON request. Using the Alexa Node.js SDK, it can be accessed with this.event.request.dialogState. …
  4. 4
    As long as the dialogState is not ‘COMPLETED’, we want to delegate control back to Alexa, letting it handle slot collection for our skill. We can do that within our Lambda function by using the st…
  5. 5
    In this lesson we learned how to check the dialog state in our Lambda function and delegate control back to Alexa: - If dialogState is not ‘COMPLETED’, delegate to Alexa using this.emit(‘:delegate’…
  1. 1
    With Dialog Management you can set prompts and confirmations in the Developer Console, then delegate the slot collection and status tracking to Alexa. This approach is easy to setup, but not flexib…
  2. 2
    “Change the slot elicitation prompt based on the available options using the :elicitSlot directive” ALEXA: What genre would you like? USER: German Expressionism. ALEXA: What genre would you lik…
  3. 3
    For slots of high consequence — money, dates, values with multiple meanings, hard-to-hear words — we need to confirm the user-provided value. Making a mistake with these types of value…
  4. 4
    In addition to slots, confirmationStatus can be used with intents. Intent confirmation is useful for confirming actions of high consequence. These actions - are publicly visible (like social medi…
  5. 5
    “Deliver a specific confirmation prompt for each slot value using the :confirmSlot directive” Now that we understand confirmationStatus, we can write custom slot confirmations! ALEXA: What ge…
  6. 6
    “Personalize the intent confirmation message using the :confirmIntent directive” Just like slot confirmation, we can make our intent confirmations custom as well. Custom intent confirmations ca…
  7. 7
    Remember the updatedIntent parameter in our directives? Here’s one example: this.emit(‘:confirmSlot’, slotToConfirm, speechOutput, repromptSpeech, updatedIntent); We can use this parameter to ov…
  8. 8
    Congrats on finishing Dialog Management ! You’ve come a long way and learned a lot. Dialog management is a great way to elicit and confirm the set of required slots and the intent needed to perf…
  1. 1
    Welcome to the Dialog Management Code Challenge! In each scenario of this Code Challenge, you’ll be given a set of conversations and a starting index.js. Based on the conversations, you will d…
  2. 2
    Scenario 1: Create a custom prompt to elicit the arrivalCity slot value. In the Flight Booker skill, the available flight destinations may change over time. Those available offerings, or option…
  3. 3
    Scenario 2: Set a default value for departureCity and create a custom prompt to confirm that slot value If your skill needs many slot values, it may frustrate users to answer many slot elicitati…
  4. 4
    Scenario 3: Create a custom intent confirmation that provides the price to the user When an intent request has potentially high consequences, it’s good practice to confirm the request with the u…
  5. 5
    You’ve managed dialog and managed it well. Users booking flights will be much happier when they are: - provided their available options in slot elicitations, - notified of default values via slot …

What you'll create

Portfolio projects that showcase your new skills

Pro Logo

How you'll master it

Stress-test your knowledge with quizzes that help commit syntax to memory

Pro Logo