Skip to content

Bedrock beta.messages missing .stream() method #1210

@afoong-8s

Description

@afoong-8s

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions