Lex slot validation using lambda code hook in lex v2 console
Closed this issue · 4 comments
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?
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,
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."
@dangollayan thanks for your interest, we will get back to you
thanks @dougtoppin !!
@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
I am closing this as the answer was provided above. Please re-open if needed