Wrapping Up

It is rare in human conversation for all details to be given in a single statement. Conversation involves a lot of back and forth, often with one party giving details as the conversation progresses and the other asking for those details. Knowing that one half of an Alexa conversation is human, it’s quite likely that the human won’t give all of the details up front. This means that Alexa must initiate dialog with the user to collect and validate all slot values.

Alexa dialogs are defined by three essential activities: elicitation, validation, and confirmation. Alexa elicits any missing slot values by prompting the user until all slots are filled. As slot values become available, Alexa applies validation rules to ensure that the values given make sense. Once all slot values are available, Alexa can prompt the user one last time to confirm that she heard correctly what the user said.

For many common cases, Alexa dialogs are handled automatically by the platform, requiring no special intent-handling code in the skill. For some advanced cases, however, it is possible to write an intent handler that steps into the dialog to perform custom validation or even populate or change slot values.

Our skill gathers information for scheduling an interplanetary excursion and does a great job of pretending to schedule the trip. In reality, however, it only logs travel plans and doesn’t really schedule anything. We’ll fix that in the next chapter as we see how to integrate Alexa skills with external APIs.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset