Skip to content

fix(bedrock): accept size positional argument #488

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

Merged
merged 1 commit into from
Jul 17, 2025

Conversation

gustavocidornelas
Copy link
Contributor

Pull Request

Summary

The Bedrock tracer was causing a runtime error when customers tried to read the response body after a model invocation.

Updated the mock read() method to accept the optional size parameter: lambda size=-1: response_bytes[:size] if size > 0 else response_bytes, making it compatible with boto3's StreamingBody.read() signature.

This ensures the traced response behaves identically to the original boto3 response for downstream code.

@whoseoyster whoseoyster changed the base branch from main to next July 17, 2025 14:27
@whoseoyster whoseoyster merged commit 94366df into next Jul 17, 2025
5 checks passed
@whoseoyster whoseoyster deleted the cid/bedrock-positional branch July 17, 2025 14:27
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