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 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南