Explicitly Handling Dialog Delegation

Earlier in section Validating Slot Values, we added validation for the destination slot. But at that time, we deferred validation for the travel date slots. That’s because when it comes to travel dates, we will need to ensure that the return date falls after the departure date. And although it is possible to automatically validate dates, it’s not so easy to validate two or more slots with how they relate to each other. For that, we’ll need to write some explicit validation code that steps in to compare the two dates.

But first, let’s add some simple validation for the dates. The “isInDuration” validation rules ensures that a date slot’s value falls within a range. The following excerpt from the interaction ...

Get Build Talking Apps for Alexa now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.