How can we validate date in Amazon Lex?

0

I have created a Hotel Management lex bot that makes a reservation for hotel rooms. I am using slots (Check-in Date and Check-out Date). I am using a built-in slot that is Amazon.Date.

Problem

I want to restrict customers at this stage so that customers can only enter date that matches with the current date or after the current date. Currently, these slots are accepting all dates including previous dates.

How I can validate these slots? (Can we solve our problem with RegEx while using Amazon.Alphanumeric type)

What are the possible solutions?

Should we handle this in Lambda? (If yes, kindly describe how I can get the Elicitation value of a slot in Lambda (Python)).

What would you prefer me to resolve or achieve this?

Any help would be greatly appreciated and thanks in advance.

1 réponse
1

Yes you are correct, you would need a Lambda handler for the custom validation. This example is very similar to your use case.

https://docs.aws.amazon.com/lex/latest/dg/ex1-sch-appt.html https://docs.aws.amazon.com/lex/latest/dg/lex-lambda-blueprints.html

You should be able to reuse most of the code in these examples and just have to make some minor customisations.

Hope this helps.

Kishan
répondu il y a 2 ans
  • Can you tell me where is the lambda code? The links you have shared, have no lambda coding that can help me.

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions