Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The reply of the qna bot is sometimes null/blank (intermittent) #759

Open
dangollayan opened this issue Aug 12, 2024 · 8 comments
Open

The reply of the qna bot is sometimes null/blank (intermittent) #759

dangollayan opened this issue Aug 12, 2024 · 8 comments
Assignees
Labels

Comments

@dangollayan
Copy link

Describe the bug
The qna bot sometimes replies a blank reply/ null when using lambda hook.
image

To Reproduce
Create an agent with knowledgebase/action group as a lambda hook then attached it to no hits intent
image

Expected behavior
The bot should be able to reply with what the lambdah hook returned

Please complete the following information about the solution:

  • [v6.0.2 ]
  • [ us-east-1]
  • [ no] Was the solution modified from the version published on this repository?
  • [no ] If the answer to the previous question was yes, are the changes available on GitHub?
  • [yes] Have you checked your service quotas for the services this solution uses?
  • [ no] Were there any errors in the CloudWatch Logs?

Screenshots
no errors in fulfillment lambda as well
image

@dangollayan
Copy link
Author

Hi, I've just finished troubleshooting and noticed that if the Lambda hook process exceeds 30 seconds, it returns a blank reply. Can anyone help with this issue?

@bobpskier
Copy link
Contributor

@dangollayan If I'm not mistaken, LexV2 has a 30 second timeout on RecognizeText fulfillment. If the QnABot fulfillment processing exceeds this time (including lambda hook) then LexV2 will timeout the request. I believe there are some default messages that can be configured for this case in LexV2. Also, depending on your lexv2 client, the calls to LexV2 might be able to send in a streaming based request although I'm not sure how QnABot would handle this. I think the default for a timeout can be longer using streaming. I've never experimented with streaming for example from the LexWebUi AWS sample to QnABot but perhaps this would give you a chance to stream some messages while the processing is taking place on the back end lambda hook.

@dangollayan
Copy link
Author

@dangollayan If I'm not mistaken, LexV2 has a 30 second timeout on RecognizeText fulfillment. If the QnABot fulfillment processing exceeds this time (including lambda hook) then LexV2 will timeout the request. I believe there are some default messages that can be configured for this case in LexV2. Also, depending on your lexv2 client, the calls to LexV2 might be able to send in a streaming based request although I'm not sure how QnABot would handle this. I think the default for a timeout can be longer using streaming. I've never experimented with streaming for example from the LexWebUi AWS sample to QnABot but perhaps this would give you a chance to stream some messages while the processing is taking place on the back end lambda hook.

thanks for your thoughts @bobpskier!

@fhoueto-amz
Copy link
Member

Hi @dangollayan
Here is the link to the documentation of the timeout limit https://docs.aws.amazon.com/lexv2/latest/APIReference/API_runtime_RecognizeText.html.
We will clarify in our documentation

@fhoueto-amz fhoueto-amz self-assigned this Aug 15, 2024
@dangollayan
Copy link
Author

dangollayan commented Aug 15, 2024

Hi @dangollayan Here is the link to the documentation of the timeout limit https://docs.aws.amazon.com/lexv2/latest/APIReference/API_runtime_RecognizeText.html. We will clarify in our documentation

hi @fhoueto-amz, can you elaborate how can we configure the time out to QNA bot setup?

As per checking the document, it has this
image

@michaelin-96
Copy link
Member

@dangollayan

I would start here for the Lex API reference docs: https://docs.aws.amazon.com/lexv2/latest/dg/streaming-progress.html#progress-updates. Seems like you can specify a timeout length of up to 15 minutes (900 seconds)

@dangollayan
Copy link
Author

@dangollayan

I would start here for the Lex API reference docs: https://docs.aws.amazon.com/lexv2/latest/dg/streaming-progress.html#progress-updates. Seems like you can specify a timeout length of up to 15 minutes (900 seconds)

Doesn't work with the solution

@abhirpat
Copy link
Member

abhirpat commented Sep 11, 2024

Hi @dangollayan ,

To answer your questions, I'd suggest to try post-processing lambda hook and examine the input event to the lambda. In that input event, you can modify sessionState as needed to set timeToLive. Before implementing this solution, you will want to evaluate if there is negative impact of this change in terms of concurrency and lambda 15 min timeout .

For more information on post-processing lambda hooks, please see Lambda Hooks

Best,
Abhishek

@abhirpat abhirpat assigned abhirpat and unassigned michaelin-96 Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants