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年前791ビュー
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年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ