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
demandé il y a un an818 vues
2 réponses
0
Réponse acceptée

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
répondu il y a un an
profile picture
EXPERT
vérifié il y a un mois
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
répondu il y a un an
  • 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?

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