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.

已提问 5 年前802 查看次数
2 回答
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
已回答 5 年前
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

已回答 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则