Skip to content

Commit baf8d7a

Browse files
docs: replace retired claude-sonnet-4-5 in examples and docstring (#1070)
The langchain prompt-cache example and two `claude_agent_sdk` docstring snippets default to `claude-sonnet-4-5-20250929`, which Anthropic retires on 2026-11-30. After that date, copying the example fails with a model-not-found error. Changes: use `claude-sonnet-5`, the Sonnet alias already used in `test_anthropic.py`, in `examples/langchain/anthropic_prompt_cache.py` and the two docstring snippets in `claude_agent_sdk/__init__.py`. Recorded VCR cassettes, and the test that replays them (`langchain/test_callbacks.py`), keep the old ID because they are historical recordings. Test: no behaviour change; both files compile, and the old ID now appears only in cassette-backed tests. This change was prepared with the assistance of an AI coding tool (Claude) and reviewed before submission. Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
1 parent 1923b43 commit baf8d7a

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎examples/langchain/anthropic_prompt_cache.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
load_dotenv(ROOT / ".env")
2323

2424
PROJECT_NAME = os.environ.get("BRAINTRUST_PROJECT", "py-sdk-demo-langchain-anthropic-cache")
25-
MODEL = os.environ.get("ANTHROPIC_MODEL", "claude-sonnet-4-5-20250929")
25+
MODEL = os.environ.get("ANTHROPIC_MODEL", "claude-sonnet-5")
2626

2727
# Anthropic prompt caching requires a sufficiently long cacheable prefix.
2828
CACHEABLE_SYSTEM_PROMPT = "\n".join(

‎py/src/braintrust/integrations/claude_agent_sdk/__init__.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
setup_claude_agent_sdk(project="my-project")
88
99
# Use normally - all calls are automatically traced
10-
options = ClaudeAgentOptions(model="claude-sonnet-4-5-20250929")
10+
options = ClaudeAgentOptions(model="claude-sonnet-5")
1111
async with ClaudeSDKClient(options=options) as client:
1212
await client.query("Hello!")
1313
async for message in client.receive_response():
@@ -50,7 +50,7 @@ def setup_claude_agent_sdk(
5050
setup_claude_agent_sdk(project="my-project")
5151
5252
# Now use claude_agent_sdk normally - all calls automatically traced
53-
options = claude_agent_sdk.ClaudeAgentOptions(model="claude-sonnet-4-5-20250929")
53+
options = claude_agent_sdk.ClaudeAgentOptions(model="claude-sonnet-5")
5454
async with claude_agent_sdk.ClaudeSDKClient(options=options) as client:
5555
await client.query("Hello!")
5656
async for message in client.receive_response():

0 commit comments

Comments
 (0)