fix(bedrock): add missing stream() method to beta.messages#1246
Open
passionworkeer wants to merge 3 commits intoanthropics:mainfrom
Open
fix(bedrock): add missing stream() method to beta.messages#1246passionworkeer wants to merge 3 commits intoanthropics:mainfrom
passionworkeer wants to merge 3 commits intoanthropics:mainfrom
Conversation
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
There was a problem hiding this comment.
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.streamby aliasingFirstPartyMessagesAPI.streamin the Bedrock beta messages resource. - Expose
AsyncMessages.streamby aliasingFirstPartyAsyncMessagesAPI.streamin 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 |
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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