Aws Lex V2 date validation , session attributes

0

I am creating a chatbot using Lex V2. So i want to validate the dates because it is taking also past dates for booking . How can i validate dates . And i have an another question that what are session attributes how can we use them . Means if 1st intent is for authentication it should not ask again about authentication for other intent.

swarup
asked a year ago777 views
2 Answers
0
Accepted Answer

Regarding your date validation question, you mean validate in a business specific logic or validating format?

If your are talking to implemente a business logic when receiving a date, you should use a lambda code hook to invoke in every turn https://docs.aws.amazon.com/lexv2/latest/dg/lambda.html then validate when the date slot has a value.

But if your trying to validate as correct format maybe you should use native slots like Amazon.DATE

AWS
Kike
answered a year ago
profile picture
EXPERT
reviewed 3 days ago
0

Your second question:

Right!, you can use session to set an attribute like {"authenticated": true} in sessionAttributes to check if user already passed the validation steps. If not set you can go to an authentication Intent, but if it is set you can go with the transaction. Good thing that if you use a lambda hook, the session object comes with every invocation (via sessionState)

https://docs.aws.amazon.com/lexv2/latest/dg/using-sessions.html

Switching intents

  • You can use the PutSession operation to switch from one intent to another. You can also use it to switch back to a previous intent. You can use the PutSession operation to set session attributes or slot values for the new intent.

  • Call the PutSession operation. Set the intent name to the name of the new intent and set the dialog action to Delegate. You can also set any slot values or session attributes required for the new intent.

    Amazon Lex will start a conversation with the user using the new intent.

AWS
Kike
answered a year ago
  • Actually i am not clear yet. In my scenario I have created an authentication intent . for other intent like transaction related intent if the user directly hit those transaction related intent it should ask first authentication like username , mobile and email. also i want that if the authentication happened for one time then it should not ask for other intent .

  • what is put session operation?

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions