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개 답변
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
답변함 2년 전
  • Can you tell me where is the lambda code? The links you have shared, have no lambda coding that can help me.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠