Skip to content

Conversation

@Ashutosh0x
Copy link

@Ashutosh0x Ashutosh0x commented Jan 7, 2026

Summary

This PR adds tool_runner and stream method aliases to both Messages and AsyncMessages classes in the Bedrock beta module.

Motivation

Fixes #1106
Fixes #1120

The tool_runner API (client.beta.messages.tool_runner()) was not available on the AnthropicBedrock or AsyncAnthropicBedrock clients. This creates feature parity for enterprise AWS Bedrock users.

Changes

Added method aliases to src/anthropic/lib/bedrock/_beta_messages.py:

  • tool_runner - Automatic tool execution loop
  • stream - Streaming message helpers

Note: parse was intentionally excluded as Bedrock doesn't currently support the structured output beta header.

Checklist

  • Changes follow existing code patterns
  • No breaking changes
  • Commit follows conventional format

@Ashutosh0x Ashutosh0x requested a review from a team as a code owner January 7, 2026 20:50
@karpetrosyan
Copy link
Collaborator

I believe Bedrock doesn’t support structured outputs at the moment.
I tried locally and got an error saying the structured output beta header isn’t supported.

@cppntn
Copy link

cppntn commented Jan 21, 2026

What's the ETA on this? At least the stream part

@Ashutosh0x
Copy link
Author

@karpetrosyan good catch! you're right, I'll remove parse and keep only stream + ool_runner which don't need that header. updating the PR now

@Ashutosh0x
Copy link
Author

@cppntn working on it now! removing the unsupported parse method and keeping stream + ool_runner. should be ready for review shortly

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
@Ashutosh0x Ashutosh0x force-pushed the feat/bedrock-tool-runner branch from 22db1bc to 9833cbc Compare January 21, 2026 16:05
@Ashutosh0x
Copy link
Author

updated! removed parse method, now only stream and ool_runner are included. ready for review

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.

Feature Request: Add stream helper to AnthropicBedrock.beta.messages Feature Request: Add tool_runner support for AnthropicBedrock client

3 participants