Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lex slot validation using lambda code hook in lex v2 console #699

Closed
dangollayan opened this issue Mar 11, 2024 · 4 comments
Closed

Lex slot validation using lambda code hook in lex v2 console #699

dangollayan opened this issue Mar 11, 2024 · 4 comments
Assignees

Comments

@dangollayan
Copy link

dangollayan commented Mar 11, 2024

I'm currently exploring the capabilities of Amazon Lex V2 and I have a question regarding slot validation using Lambda code hook.

In the Lex V2 console, I see that we can define slot validation rules using Lambda code hooks to validate user input before it's passed to the intent. However, I'm curious if this feature is available when using the generated dedicated bot in the QnABot AWS solution.

Can anyone confirm if we can utilize Lex slot validation using Lambda code hooks in the QnABot AWS solution?
Can we enable this?
image
If not, are there any alternative methods for slot validation in this context? Additionally, if you have experience with handling slot validation in QnABot or know of any alternative solutions, please feel free to share.

Any insights or experiences shared would be greatly appreciated! Thank you.

Example:

Using IntentSlotMatching.Example.Q1,

image
Let's say there's a slot named CarType. I'm interested in configuring the slot prompt to handle invalid slot values.

Here's an example scenario:
Bot: "What type of car would you like to rent? Our most popular options are economy, midsize, and luxury."
User: "sports car"
Bot: "I'm sorry, but 'sports car' is not a valid car type. Please choose from our available options: economy, midsize, or luxury."

Current experience:
image

@dougtoppin
Copy link

@dangollayan thanks for your interest, we will get back to you

@dangollayan
Copy link
Author

thanks @dougtoppin !!

@fhoueto-amz
Copy link
Member

fhoueto-amz commented Mar 13, 2024

@dangollayan - I will refer you to the implementation guide of QnA available at https://docs.aws.amazon.com/solutions/latest/qnabot-on-aws/welcome.html, and more specifically the following two sections:
https://docs.aws.amazon.com/solutions/latest/qnabot-on-aws/architecture-details.html#amazon-lex-web-client
and
https://docs.aws.amazon.com/solutions/latest/qnabot-on-aws/configure-intent-and-slot-matching.html
this has in fact and example similar to your case and in addition, the notes and consideration explains that
"To take advantage of the additional features supported by Amazon Lex, such as confirmation prompts and regular expression to validate the value of a slot, you can also create the Amazon Lex intents and slot types in the QnABot Lex bot using the Amazon Lex console. For more information, refer to Adding intents in the Amazon Lex V2 Developer Guide.

Even if the Amazon Lex intents and slot types are created in the Amazon Lex console (created outside of the QnABot designer), you can reference any SlotType defined in the bot in a QnABot Item ID, and also map a QID to a manually created Amazon Lex intent in QnABot on AWS."
I hope this helps.
Fabien

@fhoueto-amz fhoueto-amz self-assigned this Mar 13, 2024
@fhoueto-amz
Copy link
Member

I am closing this as the answer was provided above. Please re-open if needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants