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
질문됨 일 년 전818회 조회
2개 답변
0
수락된 답변

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
답변함 일 년 전
profile picture
전문가
검토됨 한 달 전
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
답변함 일 년 전
  • 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?

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

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

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

관련 콘텐츠