Anthropic Python SDK 1.9.0: claude-sonnet-5-5, streaming tool execution, between_tools thinking
sdkAnthropic's Python SDK 1.9.0 adds claude-sonnet-5-5, a new between_tools extended-thinking type, and an option to run tool calls in parallel while the assistant reply is still streaming. Cache diagnostics on Message / MessageCreateParams are now GA, workspace rate limits gain include_inherited/source, and Managed Agents event filters get typed event values. Includes fixes to stream()/parse() diagnostics parsing.
an agent can now run tool calls concurrently while the model reply is still streaming, use claude-sonnet-5-5, emit between_tools extended thinking, and inspect cache diagnostics on Messages.
Notable additions: streaming tool execution, claude-sonnet-5-5 model id, between_tools thinking type, GA cache diagnostics, typed Managed Agents event filters.
pip install anthropic==1.9.0from anthropic import Anthropic
client = Anthropic()
# Stream a reply and let tool calls execute in parallel as they arrive
with client.messages.stream(
model="claude-sonnet-5-5",
max_tokens=1024,
tools=[{
"name": "get_weather",
"description": "Get current weather",
"input_schema": {
"type": "object",
"properties": {"city": {"type": "string"}},
"required": ["city"],
},
}],
thinking={"type": "between_tools", "budget_tokens": 2048},
messages=[{"role": "user", "content": "Weather in Paris and Tokyo?"}],
run_tools_while_streaming=True,
) as stream:
for event in stream:
print(event)
final = stream.get_final_message()
print(final.diagnostics) # GA cache diagnostics