Skip to content

fix(bedrock): add missing stream() method to beta.messages#1246

Open
passionworkeer wants to merge 3 commits intoanthropics:mainfrom
passionworkeer:fix/bedrock-beta-messages-stream
Open

fix(bedrock): add missing stream() method to beta.messages#1246
passionworkeer wants to merge 3 commits intoanthropics:mainfrom
passionworkeer:fix/bedrock-beta-messages-stream

Conversation

@passionworkeer
Copy link

The Bedrock Messages class was missing the stream() method that exists in the first-party Messages class. This causes code using client.beta.messages.stream() to break when switching from Anthropic() to AnthropicBedrock().

Added stream = FirstPartyMessagesAPI.stream to both Messages and AsyncMessages classes.

Closes #1210

The Bedrock Messages class was missing the stream() method that exists in the
first-party Messages class. This causes code using client.beta.messages.stream()
to break when switching from Anthropic() to AnthropicBedrock().

Added stream = FirstPartyMessagesAPI.stream to both Messages and AsyncMessages classes.

Closes anthropics#1210
@passionworkeer passionworkeer requested a review from a team as a code owner March 14, 2026 17:58
Copilot AI review requested due to automatic review settings March 14, 2026 17:58
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds the missing stream() convenience method to the Bedrock beta messages resource to match the first-party SDK surface area and prevent breakage when switching from Anthropic() to AnthropicBedrock().

Changes:

  • Expose Messages.stream by aliasing FirstPartyMessagesAPI.stream in the Bedrock beta messages resource.
  • Expose AsyncMessages.stream by aliasing FirstPartyAsyncMessagesAPI.stream in the Bedrock beta messages resource.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


class Messages(SyncAPIResource):
create = FirstPartyMessagesAPI.create
stream = FirstPartyMessagesAPI.stream
TRIX and others added 2 commits March 21, 2026 15:31
Add a parametrized test that verifies beta.messages.stream exists and has
the same signature as beta.messages.create for both sync and async clients.

This ensures code using client.beta.messages.stream() works when switching
from Anthropic() to AnthropicBedrock(), addressing Copilot review feedback.

Closes anthropics#1210
Add test_bedrock_beta_messages_stream_exists() to ensure
AnthropicBedrock().beta.messages.stream (and async) exists and is callable.

This prevents regression of the missing stream() method on Bedrock
beta messages resource.

Co-authored-by: TRIX <trix@openclaw>
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.

Bedrock beta.messages missing .stream() method

2 participants