-
Notifications
You must be signed in to change notification settings - Fork 421
Open
Description
Summary
The tool_runner API (client.beta.messages.tool_runner()) is not available on the AnthropicBedrock and AsyncAnthropicBedrock clients, despite the documentation stating "the rest of the API is the same" for Bedrock.
Current Behavior
from anthropic import AsyncAnthropic, AsyncAnthropicBedrock
# Direct Anthropic API - works ✅
client = AsyncAnthropic(api_key='...')
print(type(client.beta.messages))
# <class 'anthropic.resources.beta.messages.messages.AsyncMessages'>
print(hasattr(client.beta.messages, 'tool_runner')) # True ✅
# Bedrock API - missing tool_runner ❌
bedrock_client = AsyncAnthropicBedrock(aws_region='us-west-2')
print(type(bedrock_client.beta.messages))
# <class 'anthropic.lib.bedrock._beta_messages.AsyncMessages'>
print(hasattr(bedrock_client.beta.messages, 'tool_runner')) # False ❌Attempting to use tool_runner on Bedrock results in:
AttributeError: 'AsyncMessages' object has no attribute 'tool_runner'
Expected Behavior
The tool_runner API should be available on AnthropicBedrock and AsyncAnthropicBedrock clients, enabling:
- Automatic tool execution loop
- Client-side compaction control (
compaction_controlparameter) - Consistent API surface across direct and Bedrock clients
Available Methods Comparison
| Method | AsyncAnthropic |
AsyncAnthropicBedrock |
|---|---|---|
create |
✅ | ✅ |
with_raw_response |
✅ | ✅ |
with_streaming_response |
✅ | ✅ |
tool_runner |
✅ | ❌ Missing |
Use Case
We're building agentic applications that need:
- Automatic tool execution loops (what
tool_runnerprovides) - Client-side compaction control for long-running agent sessions
- AWS Bedrock for enterprise deployment (compliance, VPC, etc.)
Currently, we must choose between Bedrock (enterprise requirements) OR tool_runner features - we cannot have both.
Environment
- Python SDK version: 0.75.0
- Python version: 3.11
Workaround
Currently using direct Anthropic API (AsyncAnthropic) instead of Bedrock, but this doesn't meet enterprise deployment requirements.
Related
This is similar to other Bedrock feature gaps:
- Count Tokens for Bedrock #353 -
count_tokensnot available on Bedrock - PDF Support for AnthropicBedrock #921 - PDF/document support differences on Bedrock
Metadata
Metadata
Assignees
Labels
No labels