Bedrock beta.messages missing .stream() method
Summary
AnthropicBedrock().beta.messages exposes .create() but not .stream(). The first-party Anthropic().beta.messages has both.
Root cause
In src/anthropic/lib/bedrock/_beta_messages.py, the Bedrock Messages class only copies create:
class Messages(SyncAPIResource):
create = FirstPartyMessagesAPI.create
# stream is missing
The first-party class in resources/beta/messages/messages.py has both create and stream.
Impact
Any code using client.beta.messages.stream(...) breaks when switching from Anthropic() to AnthropicBedrock(). Streaming itself works fine on Bedrock — create(stream=True) returns events correctly. It's just the convenience .stream() method that's missing from the class definition.
Expected fix
class Messages(SyncAPIResource):
create = FirstPartyMessagesAPI.create
stream = FirstPartyMessagesAPI.stream
(Same for AsyncMessages.)
Since this file is Stainless-generated, the fix likely needs to happen in the generator config.
SDK version
anthropic==0.80.0
Confirmed
Looking at the code:
First-party (resources/beta/messages/messages.py):
class Messages(SyncAPIResource):
def create(self, ...) -> BetaMessage: ...
@overload
def stream(self, ...) -> BetaMessageStreamManager: ...
Bedrock (lib/bedrock/_beta_messages.py):
class Messages(SyncAPIResource):
create = FirstPartyMessagesAPI.create
# stream is not aliased
The suggested fix is correct — just add the alias:
stream = FirstPartyMessagesAPI.stream
Since Bedrock's underlying create(stream=True) returns the same event types, the stream() helper should work identically. The method manager (BetaMessageStreamManager) handles the event iteration/context management, which is provider-agnostic.
Workaround until fixed:
from anthropic import AnthropicBedrock
from anthropic.resources.beta.messages import Messages as FirstPartyMessages
client = AnthropicBedrock()
# Manually bind the stream method
client.beta.messages.stream = FirstPartyMessages.stream.__get__(client.beta.messages)
(Hacky but works for parity testing.)
This is a straightforward fix! I can submit a PR to add the missing stream() method to Bedrock Messages class.
The fix is simple - just add stream = FirstPartyMessagesAPI.stream alongside the existing create assignment, both for Sync and Async classes.
A2ABench has an accepted answer for this imported thread.
- Thread: https://a2abench-api.web.app/q/cmmpnaa7q00mc1401opglb1x2
- Accepted at: 2026-03-25T18:10:58.483Z
- Accepted answer agent:
ai village - Answer preview: "No matching threads were found for this query."
Thanks, this is fixed in v0.122.0 (https://github.com/anthropics/anthropic-sdk-python/commit/6eca7bb19f968856b5652d5471e3ca9fc3fe8641). AnthropicBedrock().beta.messages now exposes stream, parse and tool_runner.