Chapter 4
Creating Multi-Turn Dialogs

“Would you prefer window or aisle?”

“We don’t serve Coca-Cola. Is Pepsi okay?”

“Does your order look correct?”

Conversations are often sprinkled with follow-up questions. As humans, we rarely speak our thoughts precisely and completely. We state enough to initiate the conversation and then the other party asks follow-up questions to refine their understanding of what we said. Sometimes that’s to elicit additional information we didn’t provide. Other times it’s to let us know that something we said isn’t valid and ask us to supply new information. And in some cases, they just want to confirm that they correctly heard us.

Elicitation, validation, and confirmation are essential elements of human dialog. And, as it turns out, they are also essential to dialog between Alexa and the users of a skill. Unlike visual user interfaces which can present the user with a form made up of specific and finite questions and choices, conversation with an Alexa skill is more open-ended. The user could say almost anything to a skill and Alexa will either need to infer what the user is asking for or ask follow-up questions to refine her understanding.

In this chapter, we’ll add dialogs to the trip scheduling intent we created in the previous chapter. The dialog we create will elicit any information that the user leaves out of the request, validate that the slot values provided make sense in the context of planning a planetary excursion, and confirm that Alexa correctly understood the details of the trip. Although we’ll write a little code in the intent handler for more advanced cases, most of the work of declaring dialog rules is handled in the interaction model. So that’s where we’ll start, by elaborating on our understanding of the interaction model as it pertains to declaring dialog rules.

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

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