Skip to content

Commit 2a9693e

Browse files
ashwin-antclaude
andauthored
Update model references to claude-sonnet-4-5 (#198)
Replace all dated model references (claude-sonnet-4-20250514, claude-3-5-sonnet-20241022) with the simplified claude-sonnet-4-5 identifier across examples, tests, and documentation. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Claude <noreply@anthropic.com>
1 parent af87062 commit 2a9693e

File tree

7 files changed

+12
-12
lines changed

7 files changed

+12
-12
lines changed

e2e-tests/test_include_partial_messages.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ async def test_include_partial_messages_stream_events():
2828

2929
options = ClaudeAgentOptions(
3030
include_partial_messages=True,
31-
model="claude-sonnet-4-20250514",
31+
model="claude-sonnet-4-5",
3232
max_turns=2,
3333
env={
3434
"MAX_THINKING_TOKENS": "8000",
@@ -94,7 +94,7 @@ async def test_include_partial_messages_thinking_deltas():
9494

9595
options = ClaudeAgentOptions(
9696
include_partial_messages=True,
97-
model="claude-sonnet-4-20250514",
97+
model="claude-sonnet-4-5",
9898
max_turns=2,
9999
env={
100100
"MAX_THINKING_TOKENS": "8000",
@@ -132,7 +132,7 @@ async def test_partial_messages_disabled_by_default():
132132

133133
options = ClaudeAgentOptions(
134134
# include_partial_messages not set (defaults to False)
135-
model="claude-sonnet-4-20250514",
135+
model="claude-sonnet-4-5",
136136
max_turns=2,
137137
)
138138

examples/include_partial_messages.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ async def main():
2929
# Enable partial message streaming
3030
options = ClaudeAgentOptions(
3131
include_partial_messages=True,
32-
model="claude-sonnet-4-20250514",
32+
model="claude-sonnet-4-5",
3333
max_turns=2,
3434
env={
3535
"MAX_THINKING_TOKENS": "8000",

examples/streaming_mode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ async def example_with_options():
219219
allowed_tools=["Read", "Write"], # Allow file operations
220220
system_prompt="You are a helpful coding assistant.",
221221
env={
222-
"ANTHROPIC_MODEL": "claude-sonnet-4-20250514",
222+
"ANTHROPIC_MODEL": "claude-sonnet-4-5",
223223
},
224224
)
225225

examples/streaming_mode_trio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def display_message(msg):
4646
async def multi_turn_conversation():
4747
"""Example of a multi-turn conversation using trio."""
4848
async with ClaudeSDKClient(
49-
options=ClaudeAgentOptions(model="claude-3-5-sonnet-20241022")
49+
options=ClaudeAgentOptions(model="claude-sonnet-4-5")
5050
) as client:
5151
print("=== Multi-turn Conversation with Trio ===\n")
5252

src/claude_agent_sdk/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ async def set_model(self, model: str | None = None) -> None:
232232
233233
Args:
234234
model: The model to use, or None to use default. Examples:
235-
- 'claude-sonnet-4-20250514'
235+
- 'claude-sonnet-4-5'
236236
- 'claude-opus-4-1-20250805'
237237
- 'claude-opus-4-20250514'
238238
@@ -243,7 +243,7 @@ async def set_model(self, model: str | None = None) -> None:
243243
await client.query("Help me understand this problem")
244244
245245
# Switch to a different model for implementation
246-
await client.set_model('claude-3-5-sonnet-20241022')
246+
await client.set_model('claude-sonnet-4-5')
247247
await client.query("Now implement the solution")
248248
```
249249
"""

tests/test_transport.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def test_build_command_with_options(self):
106106
options=ClaudeAgentOptions(
107107
allowed_tools=["Read", "Write"],
108108
disallowed_tools=["Bash"],
109-
model="claude-3-5-sonnet",
109+
model="claude-sonnet-4-5",
110110
permission_mode="acceptEdits",
111111
max_turns=5,
112112
),
@@ -119,7 +119,7 @@ def test_build_command_with_options(self):
119119
assert "--disallowedTools" in cmd
120120
assert "Bash" in cmd
121121
assert "--model" in cmd
122-
assert "claude-3-5-sonnet" in cmd
122+
assert "claude-sonnet-4-5" in cmd
123123
assert "--permission-mode" in cmd
124124
assert "acceptEdits" in cmd
125125
assert "--max-turns" in cmd

tests/test_types.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def test_claude_code_options_with_session_continuation(self):
145145
def test_claude_code_options_with_model_specification(self):
146146
"""Test Options with model specification."""
147147
options = ClaudeAgentOptions(
148-
model="claude-3-5-sonnet-20241022", permission_prompt_tool_name="CustomTool"
148+
model="claude-sonnet-4-5", permission_prompt_tool_name="CustomTool"
149149
)
150-
assert options.model == "claude-3-5-sonnet-20241022"
150+
assert options.model == "claude-sonnet-4-5"
151151
assert options.permission_prompt_tool_name == "CustomTool"

0 commit comments

Comments
 (0)