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

Bugfix for throttlingException when calling the InvokeAgent operation #66

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

johntelforduk
Copy link
Contributor

Issue #64: throttlingException when calling the InvokeAgent operation

Description of changes:

In Bedrock Agent target.py program. Try/Except and exponential backoff logic implemented to overcome the Bedrock Agent throttling problem.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

back_off = 0.01 # In seconds.
done = False
while not done:
try:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the try/except should be applied only when iterating through the completion EventStream. Throttling exceptions from invoke_agent should already be handled using adaptive retry.

)
done = True

except ClientError as exception_obj:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move the retry functionality to another module and add some unit tests?

@tonykchen
Copy link
Contributor

Some linting errors in CI also need to be addressed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants