From 9833cbcbc13e5e135e19b9ae2a43d7ad6cb71169 Mon Sep 17 00:00:00 2001 From: ashutosh0x Date: Thu, 8 Jan 2026 02:19:47 +0530 Subject: [PATCH] feat(bedrock): add tool_runner and stream methods to beta messages Adds method aliases for tool_runner and stream to both Messages and AsyncMessages classes in the Bedrock beta module. This provides feature parity between the first-party Anthropic client and the AnthropicBedrock client, enabling enterprise AWS Bedrock users to use: - Automatic tool execution loops (tool_runner) - Streaming message helpers (stream) Note: parse method excluded as Bedrock doesn't support the structured output beta header required by it. Fixes anthropics#1106 --- src/anthropic/lib/bedrock/_beta_messages.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/anthropic/lib/bedrock/_beta_messages.py b/src/anthropic/lib/bedrock/_beta_messages.py index 332f6fba..5f986b14 100644 --- a/src/anthropic/lib/bedrock/_beta_messages.py +++ b/src/anthropic/lib/bedrock/_beta_messages.py @@ -13,6 +13,8 @@ class Messages(SyncAPIResource): create = FirstPartyMessagesAPI.create + tool_runner = FirstPartyMessagesAPI.tool_runner + stream = FirstPartyMessagesAPI.stream @cached_property def with_raw_response(self) -> MessagesWithRawResponse: @@ -36,6 +38,8 @@ def with_streaming_response(self) -> MessagesWithStreamingResponse: class AsyncMessages(AsyncAPIResource): create = FirstPartyAsyncMessagesAPI.create + tool_runner = FirstPartyAsyncMessagesAPI.tool_runner + stream = FirstPartyAsyncMessagesAPI.stream @cached_property def with_raw_response(self) -> AsyncMessagesWithRawResponse: