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
質問済み 1年前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
回答済み 1年前
profile picture
エキスパート
レビュー済み 1ヶ月前
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
回答済み 1年前
  • 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?

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ