How to set Max number of replies in lambda elicitSlot

0

HI

I created a lex bot in which i ask the user to enter a 9 digit ID as a slot. I use lambda to validate that slot and if the user has entered invalid number of digits (say 7 digit number) , I return an elicitslot from my lambda function with a message "ID should be 9 digit" and the slotToElicit as ID.

All that works well , however the issue is that though the max no of retries for the ID slot is set to 2 , when the validation is being done through lambda , it does not stop at 2 retries , it keeps asking the same question again and again if the user keeps send invalid value.

How can we stop that from happening.

demandé il y a 5 ans796 vues
2 réponses
0

Hi,

Thank you for your interest in Lex. If the lambda function gives a particular dialog action, Lex honors it regardless of the default max retries set in the bot.

One way to workaround this issue would be to maintain a counter in the session attributes that is incremented in lambda every time the user enters invalid input and then on the nth turn (n being the maximum retry attempts), lambda should give a dialog action such as Close to finish up a conversation.

Please let us know if there's anything else we can help you with.

Regards,
Nikhil

AWS
répondu il y a 5 ans
0

Hi Team I too had same requirement, Could you show any sample reference to add in session attributes, as i am new to lex v2 , I need to implement this logic in java language.

Thanks in Advance

répondu il y a 2 ans

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