Skip to content
This repository was archived by the owner on Dec 11, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions notdiamond/llms/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class NDLLMProviders(Enum):

CLAUDE_2_1 (NDLLMProvider): refers to 'claude-2.1' model by Anthropic
CLAUDE_3_OPUS_20240229 (NDLLMProvider): refers to 'claude-3-opus-20240229' model by Anthropic
CLAUDE_3_SONNET_20240229 (NDLLMProvider): refers to 'claude-3-sonnet-20240229' model by Anthropic
CLAUDE_3_7_SONNET_LATEST (NDLLMProvider): refers to 'claude-3-7-sonnet-latest' model by Anthropic
CLAUDE_3_7_SONNET_20250219 (NDLLMProvider): refers to 'claude-3-7-sonnet-20250219' model by Anthropic
CLAUDE_3_5_HAIKU_20241022 (NDLLMProvider): refers to 'claude-3-5-haiku-20241022' model by Anthropic
Expand Down Expand Up @@ -122,7 +121,6 @@ class NDLLMProviders(Enum):

CLAUDE_2_1 = ("anthropic", "claude-2.1")
CLAUDE_3_OPUS_20240229 = ("anthropic", "claude-3-opus-20240229")
CLAUDE_3_SONNET_20240229 = ("anthropic", "claude-3-sonnet-20240229")
CLAUDE_3_7_SONNET_LATEST = ("anthropic", "claude-3-7-sonnet-latest")
CLAUDE_3_7_SONNET_20250219 = ("anthropic", "claude-3-7-sonnet-20250219")
CLAUDE_3_5_HAIKU_20241022 = ("anthropic", "claude-3-5-haiku-20241022")
Expand Down
9 changes: 8 additions & 1 deletion notdiamond/llms/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,14 @@ def model_select_parse(response_code, response_json, llm_configs):
)[0]
return best_llm, session_id

error_message = response_json["detail"]
# Handle different error response formats
if "error" in response_json and isinstance(response_json["error"], dict):
error_message = response_json["error"].get("message", str(response_json["error"]))
elif "detail" in response_json:
error_message = response_json["detail"]
else:
error_message = str(response_json)

LOGGER.error(f"API error: {response_code}. {error_message}")
return None, "NO-SESSION-ID"

Expand Down
4 changes: 0 additions & 4 deletions notdiamond/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@
"models": [
"claude-2.1",
"claude-3-opus-20240229",
"claude-3-sonnet-20240229",
"claude-3-haiku-20240307",
"claude-3-5-haiku-20241022",
"claude-3-7-sonnet-latest",
Expand All @@ -164,7 +163,6 @@
"api_key": ANTHROPIC_API_KEY,
"support_tools": [
"claude-3-opus-20240229",
"claude-3-sonnet-20240229",
"claude-3-haiku-20240307",
"claude-3-5-haiku-20241022",
"claude-3-7-sonnet-latest",
Expand All @@ -187,7 +185,6 @@
"openrouter_identifier": {
"claude-2.1": "anthropic/claude-2.1",
"claude-3-opus-20240229": "anthropic/claude-3-opus",
"claude-3-sonnet-20240229": "anthropic/claude-3-sonnet",
"claude-3-haiku-20240307": "anthropic/claude-3-haiku",
"claude-3-5-haiku-20241022": "anthropic/claude-3.5-haiku",
"claude-3-7-sonnet-latest": "anthropic/claude-3.7-sonnet",
Expand All @@ -206,7 +203,6 @@
"price": {
"claude-2.1": {"input": 8.0, "output": 24.0},
"claude-3-opus-20240229": {"input": 15.0, "output": 75.0},
"claude-3-sonnet-20240229": {"input": 3.0, "output": 15.0},
"claude-3-haiku-20240307": {"input": 0.25, "output": 1.25},
"claude-3-5-haiku-20241022": {"input": 1.0, "output": 5.0},
"claude-3-7-sonnet-latest": {"input": 3.0, "output": 15.0},
Expand Down
2 changes: 0 additions & 2 deletions tests/test_documentation/test_fallback_and_custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ def test_fallback_model():
"openai/gpt-4-1106-preview",
"openai/gpt-4-turbo-preview",
"anthropic/claude-2.1",
"anthropic/claude-3-sonnet-20240229",
"anthropic/claude-3-opus-20240229",
"google/gemini-pro",
]
Expand All @@ -33,7 +32,6 @@ def test_set_max_model_depth():
"openai/gpt-4-1106-preview",
"openai/gpt-4-turbo-preview",
"anthropic/claude-2.1",
"anthropic/claude-3-sonnet-20240229",
"anthropic/claude-3-opus-20240229",
"google/gemini-pro",
]
Expand Down
8 changes: 4 additions & 4 deletions tests/test_documentation/test_getting_started.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def test_main_example():
"openai/gpt-4-1106-preview",
"openai/gpt-4-turbo-preview",
"anthropic/claude-3-haiku-20240307",
"anthropic/claude-3-sonnet-20240229",
"anthropic/claude-sonnet-4-5-20250929",
"anthropic/claude-3-opus-20240229",
]

Expand Down Expand Up @@ -55,7 +55,7 @@ def test_pass_array_of_messages(start_prompt):
"openai/gpt-4-1106-preview",
"openai/gpt-4-turbo-preview",
"anthropic/claude-3-haiku-20240307",
"anthropic/claude-3-sonnet-20240229",
"anthropic/claude-sonnet-4-5-20250929",
"anthropic/claude-3-opus-20240229",
]

Expand Down Expand Up @@ -87,7 +87,7 @@ def test_programatic_define_llm_configs(start_prompt):
),
LLMConfig(
provider="anthropic",
model="claude-3-sonnet-20240229",
model="claude-sonnet-4-5-20250929",
temperature=0.8,
max_tokens=256,
),
Expand Down Expand Up @@ -118,7 +118,7 @@ def test_model_select(start_prompt):
"openai/gpt-4-1106-preview",
"openai/gpt-4-turbo-preview",
"anthropic/claude-3-haiku-20240307",
"anthropic/claude-3-sonnet-20240229",
"anthropic/claude-sonnet-4-5-20250929",
"anthropic/claude-3-opus-20240229",
]

Expand Down
2 changes: 1 addition & 1 deletion tests/test_documentation/test_openrouter.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def test_openrouter_integration():
"openai/gpt-4-1106-preview",
"openai/gpt-4-turbo-preview",
"anthropic/claude-3-haiku-20240307",
"anthropic/claude-3-sonnet-20240229",
"anthropic/claude-sonnet-4-5-20250929",
"anthropic/claude-3-opus-20240229",
]

Expand Down
2 changes: 1 addition & 1 deletion tests/test_documentation/test_personalization.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def test_personalization():
"openai/gpt-4-1106-preview",
"openai/gpt-4-turbo-preview",
"anthropic/claude-2.1",
"anthropic/claude-3-sonnet-20240229",
"anthropic/claude-sonnet-4-5-20250929",
"anthropic/claude-3-opus-20240229",
"google/gemini-pro",
]
Expand Down

This file was deleted.

Loading
Loading