Skip to content

Commit 17d8133

Browse files
committed
Upgrade to Claude Sonnet 4
1 parent cff098b commit 17d8133

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

cli.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@
66
It instantiates an Agent and prompts the user for input, which is then passed to the Agent.
77
"""
88

9-
import os
109
import argparse
11-
from pathlib import Path
12-
import sys
1310
import logging
11+
import os
12+
import sys
13+
from pathlib import Path
1414

15-
from rich.console import Console
16-
from rich.panel import Panel
1715
from prompt_toolkit import prompt
1816
from prompt_toolkit.history import InMemoryHistory
17+
from rich.console import Console
18+
from rich.panel import Panel
1919

20+
from prompts.instruction import INSTRUCTION_PROMPT
2021
from tools.agent import Agent
21-
from utils.workspace_manager import WorkspaceManager
2222
from utils.llm_client import get_client
23-
from prompts.instruction import INSTRUCTION_PROMPT
23+
from utils.workspace_manager import WorkspaceManager
2424

2525
MAX_OUTPUT_TOKENS_PER_TURN = 32768
2626
MAX_TURNS = 200
@@ -115,7 +115,7 @@ def main():
115115
# Initialize LLM client
116116
client = get_client(
117117
"anthropic-direct",
118-
model_name="claude-3-7-sonnet-20250219",
118+
model_name="claude-sonnet-4-20250514",
119119
use_caching=True,
120120
)
121121

utils/llm_client.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
"""LLM client for Anthropic models."""
22

33
import json
4+
import logging
45
import os
56
import random
67
import time
78
from dataclasses import dataclass
89
from typing import Any, Tuple, cast
9-
from dataclasses_json import DataClassJsonMixin
10+
1011
import anthropic
1112
import openai
1213
from anthropic import (
@@ -24,10 +25,14 @@
2425
from anthropic._exceptions import (
2526
OverloadedError as AnthropicOverloadedError, # pyright: ignore[reportPrivateImportUsage]
2627
)
28+
from anthropic.types import (
29+
RedactedThinkingBlock as AnthropicRedactedThinkingBlock,
30+
)
2731
from anthropic.types import (
2832
TextBlock as AnthropicTextBlock,
33+
)
34+
from anthropic.types import (
2935
ThinkingBlock as AnthropicThinkingBlock,
30-
RedactedThinkingBlock as AnthropicRedactedThinkingBlock,
3136
)
3237
from anthropic.types import ToolParam as AnthropicToolParam
3338
from anthropic.types import (
@@ -41,7 +46,7 @@
4146
ToolChoiceToolChoiceAuto,
4247
ToolChoiceToolChoiceTool,
4348
)
44-
49+
from dataclasses_json import DataClassJsonMixin
4550
from openai import (
4651
APIConnectionError as OpenAI_APIConnectionError,
4752
)
@@ -55,8 +60,6 @@
5560
NOT_GIVEN as OpenAI_NOT_GIVEN, # pyright: ignore[reportPrivateImportUsage]
5661
)
5762

58-
import logging
59-
6063
logging.getLogger("httpx").setLevel(logging.WARNING)
6164

6265

@@ -170,7 +173,7 @@ class AnthropicDirectClient(LLMClient):
170173

171174
def __init__(
172175
self,
173-
model_name="claude-3-7-sonnet-20250219",
176+
model_name="claude-sonnet-4-20250514",
174177
max_retries=2,
175178
use_caching=True,
176179
use_low_qos_server: bool = False,

0 commit comments

Comments
 (0)