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.

已提問 2 年前檢視次數 781 次
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.

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南