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년 전796회 조회
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년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠