Skip to content

Commit e4e806c

Browse files
committed
🔧 Upgrade to Claude 3.7 Sonnet model
Update Claude AI model to the latest 3.7 version This change modernizes our AI integration by: - Updating default model from claude-3-5-sonnet to claude-3-7-sonnet-20250219 in both code and documentation - Adding compatibility handling for Claude 3.7 models by skipping the token_limit parameter which is unsupported in the newer API - Updating example configuration references in CONFIG.md to reflect the new model version This upgrade ensures we leverage Claude's latest capabilities while maintaining backward compatibility.
1 parent f6ad5f0 commit e4e806c

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

CONFIG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Each provider has its own subtable under `[providers]` with these fields:
5858
1. OpenAI
5959
- Default model: "gpt-o4"
6060
2. Claude
61-
- Default model: "claude-3-sonnet-20240320"
61+
- Default model: "claude-3-7-sonnet-20250219"
6262

6363
## Example Configuration File
6464

@@ -78,7 +78,7 @@ custom_token_limit = 8000
7878

7979
[providers.claude]
8080
api_key = "sk-abcdef1234567890"
81-
model = "claude-3-sonnet-20240320"
81+
model = "claude-3-7-sonnet-20250219"
8282
additional_params = { temperature = "0.8" }
8383
custom_token_limit = 100000
8484
```

src/llm_providers/claude.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ impl LLMProvider for ClaudeProvider {
3535

3636
// Add additional parameters from the configuration
3737
for (key, value) in &self.config.additional_params {
38+
// Skip token_limit parameter for Claude 3.7 models
39+
if key == "token_limit" && self.config.model.contains("claude-3-7") {
40+
continue;
41+
}
3842
request_body[key] = serde_json::Value::String(value.clone());
3943
}
4044

@@ -80,7 +84,7 @@ impl LLMProvider for ClaudeProvider {
8084
pub(super) fn get_metadata() -> ProviderMetadata {
8185
ProviderMetadata {
8286
name: "Claude",
83-
default_model: "claude-3-5-sonnet-20241022",
87+
default_model: "claude-3-7-sonnet-20250219",
8488
default_token_limit: 150_000,
8589
requires_api_key: true,
8690
}

tests/llm_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ fn test_get_default_model_for_provider() {
7777
);
7878
assert_eq!(
7979
get_default_model_for_provider(&LLMProviderType::Claude),
80-
"claude-3-5-sonnet-20241022"
80+
"claude-3-7-sonnet-20250219"
8181
);
8282
assert_eq!(
8383
get_default_model_for_provider(&LLMProviderType::Test),

0 commit comments

Comments
 (0)