Skip to content

fix(bedrock): accept size positional argument#488

Merged
whoseoyster merged 1 commit intonextfrom
cid/bedrock-positional
Jul 17, 2025
Merged

fix(bedrock): accept size positional argument#488
whoseoyster merged 1 commit intonextfrom
cid/bedrock-positional

Conversation

@gustavocidornelas
Copy link
Copy Markdown
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