Skip to content

Bugfix for throttlingException when calling the InvokeAgent operation#66

Open
johntelforduk wants to merge 2 commits intoawslabs:mainfrom
johntelforduk:bugfix-invokeagent-throttlingexception
Open

Bugfix for throttlingException when calling the InvokeAgent operation#66
johntelforduk wants to merge 2 commits intoawslabs:mainfrom
johntelforduk:bugfix-invokeagent-throttlingexception

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.

3 participants