Skip to content
This repository was archived by the owner on Dec 11, 2025. It is now read-only.

Commit 4698582

Browse files
committed
refactor: remove deprecated references to claude-3-sonnet-20240229
- Removed all instances of claude-3-sonnet-20240229 from settings.py, providers.py, and test files. - Updated tests to use the new claude-sonnet-4-5-20250929 model. - Deleted obsolete test cassettes related to the removed model.
1 parent fb1eb33 commit 4698582

11 files changed

Lines changed: 15 additions & 364 deletions

notdiamond/llms/providers.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ class NDLLMProviders(Enum):
3333
3434
CLAUDE_2_1 (NDLLMProvider): refers to 'claude-2.1' model by Anthropic
3535
CLAUDE_3_OPUS_20240229 (NDLLMProvider): refers to 'claude-3-opus-20240229' model by Anthropic
36-
CLAUDE_3_SONNET_20240229 (NDLLMProvider): refers to 'claude-3-sonnet-20240229' model by Anthropic
3736
CLAUDE_3_7_SONNET_LATEST (NDLLMProvider): refers to 'claude-3-7-sonnet-latest' model by Anthropic
3837
CLAUDE_3_7_SONNET_20250219 (NDLLMProvider): refers to 'claude-3-7-sonnet-20250219' model by Anthropic
3938
CLAUDE_3_5_HAIKU_20241022 (NDLLMProvider): refers to 'claude-3-5-haiku-20241022' model by Anthropic
@@ -122,7 +121,6 @@ class NDLLMProviders(Enum):
122121

123122
CLAUDE_2_1 = ("anthropic", "claude-2.1")
124123
CLAUDE_3_OPUS_20240229 = ("anthropic", "claude-3-opus-20240229")
125-
CLAUDE_3_SONNET_20240229 = ("anthropic", "claude-3-sonnet-20240229")
126124
CLAUDE_3_7_SONNET_LATEST = ("anthropic", "claude-3-7-sonnet-latest")
127125
CLAUDE_3_7_SONNET_20250219 = ("anthropic", "claude-3-7-sonnet-20250219")
128126
CLAUDE_3_5_HAIKU_20241022 = ("anthropic", "claude-3-5-haiku-20241022")

notdiamond/llms/request.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,14 @@ def model_select_parse(response_code, response_json, llm_configs):
119119
)[0]
120120
return best_llm, session_id
121121

122-
error_message = response_json["detail"]
122+
# Handle different error response formats
123+
if "error" in response_json and isinstance(response_json["error"], dict):
124+
error_message = response_json["error"].get("message", str(response_json["error"]))
125+
elif "detail" in response_json:
126+
error_message = response_json["detail"]
127+
else:
128+
error_message = str(response_json)
129+
123130
LOGGER.error(f"API error: {response_code}. {error_message}")
124131
return None, "NO-SESSION-ID"
125132

notdiamond/settings.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@
145145
"models": [
146146
"claude-2.1",
147147
"claude-3-opus-20240229",
148-
"claude-3-sonnet-20240229",
149148
"claude-3-haiku-20240307",
150149
"claude-3-5-haiku-20241022",
151150
"claude-3-7-sonnet-latest",
@@ -164,7 +163,6 @@
164163
"api_key": ANTHROPIC_API_KEY,
165164
"support_tools": [
166165
"claude-3-opus-20240229",
167-
"claude-3-sonnet-20240229",
168166
"claude-3-haiku-20240307",
169167
"claude-3-5-haiku-20241022",
170168
"claude-3-7-sonnet-latest",
@@ -187,7 +185,6 @@
187185
"openrouter_identifier": {
188186
"claude-2.1": "anthropic/claude-2.1",
189187
"claude-3-opus-20240229": "anthropic/claude-3-opus",
190-
"claude-3-sonnet-20240229": "anthropic/claude-3-sonnet",
191188
"claude-3-haiku-20240307": "anthropic/claude-3-haiku",
192189
"claude-3-5-haiku-20241022": "anthropic/claude-3.5-haiku",
193190
"claude-3-7-sonnet-latest": "anthropic/claude-3.7-sonnet",
@@ -206,7 +203,6 @@
206203
"price": {
207204
"claude-2.1": {"input": 8.0, "output": 24.0},
208205
"claude-3-opus-20240229": {"input": 15.0, "output": 75.0},
209-
"claude-3-sonnet-20240229": {"input": 3.0, "output": 15.0},
210206
"claude-3-haiku-20240307": {"input": 0.25, "output": 1.25},
211207
"claude-3-5-haiku-20241022": {"input": 1.0, "output": 5.0},
212208
"claude-3-7-sonnet-latest": {"input": 3.0, "output": 15.0},

tests/test_documentation/test_fallback_and_custom.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ def test_fallback_model():
1313
"openai/gpt-4-1106-preview",
1414
"openai/gpt-4-turbo-preview",
1515
"anthropic/claude-2.1",
16-
"anthropic/claude-3-sonnet-20240229",
1716
"anthropic/claude-3-opus-20240229",
1817
"google/gemini-pro",
1918
]
@@ -33,7 +32,6 @@ def test_set_max_model_depth():
3332
"openai/gpt-4-1106-preview",
3433
"openai/gpt-4-turbo-preview",
3534
"anthropic/claude-2.1",
36-
"anthropic/claude-3-sonnet-20240229",
3735
"anthropic/claude-3-opus-20240229",
3836
"google/gemini-pro",
3937
]

tests/test_documentation/test_getting_started.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def test_main_example():
2323
"openai/gpt-4-1106-preview",
2424
"openai/gpt-4-turbo-preview",
2525
"anthropic/claude-3-haiku-20240307",
26-
"anthropic/claude-3-sonnet-20240229",
26+
"anthropic/claude-sonnet-4-5-20250929",
2727
"anthropic/claude-3-opus-20240229",
2828
]
2929

@@ -55,7 +55,7 @@ def test_pass_array_of_messages(start_prompt):
5555
"openai/gpt-4-1106-preview",
5656
"openai/gpt-4-turbo-preview",
5757
"anthropic/claude-3-haiku-20240307",
58-
"anthropic/claude-3-sonnet-20240229",
58+
"anthropic/claude-sonnet-4-5-20250929",
5959
"anthropic/claude-3-opus-20240229",
6060
]
6161

@@ -87,7 +87,7 @@ def test_programatic_define_llm_configs(start_prompt):
8787
),
8888
LLMConfig(
8989
provider="anthropic",
90-
model="claude-3-sonnet-20240229",
90+
model="claude-sonnet-4-5-20250929",
9191
temperature=0.8,
9292
max_tokens=256,
9393
),
@@ -118,7 +118,7 @@ def test_model_select(start_prompt):
118118
"openai/gpt-4-1106-preview",
119119
"openai/gpt-4-turbo-preview",
120120
"anthropic/claude-3-haiku-20240307",
121-
"anthropic/claude-3-sonnet-20240229",
121+
"anthropic/claude-sonnet-4-5-20250929",
122122
"anthropic/claude-3-opus-20240229",
123123
]
124124

tests/test_documentation/test_openrouter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def test_openrouter_integration():
2727
"openai/gpt-4-1106-preview",
2828
"openai/gpt-4-turbo-preview",
2929
"anthropic/claude-3-haiku-20240307",
30-
"anthropic/claude-3-sonnet-20240229",
30+
"anthropic/claude-sonnet-4-5-20250929",
3131
"anthropic/claude-3-opus-20240229",
3232
]
3333

tests/test_documentation/test_personalization.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def test_personalization():
1919
"openai/gpt-4-1106-preview",
2020
"openai/gpt-4-turbo-preview",
2121
"anthropic/claude-2.1",
22-
"anthropic/claude-3-sonnet-20240229",
22+
"anthropic/claude-sonnet-4-5-20250929",
2323
"anthropic/claude-3-opus-20240229",
2424
"google/gemini-pro",
2525
]

tests/test_llm_calls/cassettes/test_anthropic/Test_Anthropic_LLMs.test_claude_3_sonnet_with_openai_tool_calling.yaml

Lines changed: 0 additions & 160 deletions
This file was deleted.

0 commit comments

Comments
 (0)