From e387b3fa57bd74dd170fe21b7fd0ab58686f0b3e Mon Sep 17 00:00:00 2001 From: codestory Date: Mon, 24 Feb 2025 14:21:12 +0000 Subject: [PATCH 1/5] fix: update Claude Sonnet model version to 3.7-20250219 --- llm_client/src/clients/anthropic.rs | 2 +- llm_client/src/clients/codestory.rs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/llm_client/src/clients/anthropic.rs b/llm_client/src/clients/anthropic.rs index f090694f6..5879c2d61 100644 --- a/llm_client/src/clients/anthropic.rs +++ b/llm_client/src/clients/anthropic.rs @@ -401,7 +401,7 @@ impl AnthropicClient { fn get_model_string(&self, llm_type: &LLMType) -> Result { match llm_type { LLMType::ClaudeOpus => Ok("claude-3-opus-20240229".to_owned()), - LLMType::ClaudeSonnet => Ok("claude-3-5-sonnet-20241022".to_owned()), + LLMType::ClaudeSonnet => Ok("claude-3-7-sonnet-20250219".to_owned()), LLMType::ClaudeHaiku => Ok("claude-3-haiku-20240307".to_owned()), LLMType::Custom(model) => Ok(model.to_owned()), _ => Err(LLMClientError::UnSupportedModel), diff --git a/llm_client/src/clients/codestory.rs b/llm_client/src/clients/codestory.rs index 206d23a8a..e243bf420 100644 --- a/llm_client/src/clients/codestory.rs +++ b/llm_client/src/clients/codestory.rs @@ -165,8 +165,9 @@ impl CodeStoryClient { LLMType::DeepSeekCoder33BInstruct => { Ok("deepseek-ai/deepseek-coder-33b-instruct".to_owned()) } - LLMType::ClaudeSonnet => Ok("claude-3-5-sonnet-20241022".to_owned()), // updated to latest sonnet + LLMType::ClaudeSonnet => Ok("claude-3-7-sonnet-20250219".to_owned()), // updated to latest sonnet LLMType::ClaudeHaiku => Ok("claude-3-5-haiku-20241022".to_owned()), // updated to latest haiku + LLMType::ClaudeOpus => Ok("claude-3-opus-20240229".to_owned()), LLMType::GeminiPro => Ok("google/gemini-flash-1.5".to_owned()), LLMType::GeminiProFlash => Ok("gemini-1.5-flash".to_owned()), LLMType::Gemini2_0Flash => Ok("google/gemini-2.0-flash-001".to_owned()), @@ -516,4 +517,4 @@ impl LLMClient for CodeStoryClient { } Ok(buffered_stream) } -} +} \ No newline at end of file From 99d2ba11b6bd79164b227e3f8994d3f4f6094787 Mon Sep 17 00:00:00 2001 From: codestory Date: Mon, 24 Feb 2025 14:24:32 +0000 Subject: [PATCH 2/5] feat: add support for Claude 3.7 Sonnet model This commit adds a new LLMType variant ClaudeSonnet37 and updates model strings to properly distinguish between Claude 3.5 and 3.7 Sonnet versions. --- llm_client/src/clients/anthropic.rs | 3 ++- llm_client/src/clients/codestory.rs | 7 ++++--- llm_client/src/clients/types.rs | 3 ++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/llm_client/src/clients/anthropic.rs b/llm_client/src/clients/anthropic.rs index 5879c2d61..12028795e 100644 --- a/llm_client/src/clients/anthropic.rs +++ b/llm_client/src/clients/anthropic.rs @@ -401,7 +401,8 @@ impl AnthropicClient { fn get_model_string(&self, llm_type: &LLMType) -> Result { match llm_type { LLMType::ClaudeOpus => Ok("claude-3-opus-20240229".to_owned()), - LLMType::ClaudeSonnet => Ok("claude-3-7-sonnet-20250219".to_owned()), + LLMType::ClaudeSonnet => Ok("claude-3-5-sonnet-20241022".to_owned()), + LLMType::ClaudeSonnet37 => Ok("claude-3-7-sonnet-20250219".to_owned()), LLMType::ClaudeHaiku => Ok("claude-3-haiku-20240307".to_owned()), LLMType::Custom(model) => Ok(model.to_owned()), _ => Err(LLMClientError::UnSupportedModel), diff --git a/llm_client/src/clients/codestory.rs b/llm_client/src/clients/codestory.rs index e243bf420..4c3f08b34 100644 --- a/llm_client/src/clients/codestory.rs +++ b/llm_client/src/clients/codestory.rs @@ -165,8 +165,9 @@ impl CodeStoryClient { LLMType::DeepSeekCoder33BInstruct => { Ok("deepseek-ai/deepseek-coder-33b-instruct".to_owned()) } - LLMType::ClaudeSonnet => Ok("claude-3-7-sonnet-20250219".to_owned()), // updated to latest sonnet - LLMType::ClaudeHaiku => Ok("claude-3-5-haiku-20241022".to_owned()), // updated to latest haiku + LLMType::ClaudeSonnet => Ok("claude-3-5-sonnet-20241022".to_owned()), + LLMType::ClaudeSonnet37 => Ok("claude-3-7-sonnet-20250219".to_owned()), + LLMType::ClaudeHaiku => Ok("claude-3-5-haiku-20241022".to_owned()), LLMType::ClaudeOpus => Ok("claude-3-opus-20240229".to_owned()), LLMType::GeminiPro => Ok("google/gemini-flash-1.5".to_owned()), LLMType::GeminiProFlash => Ok("gemini-1.5-flash".to_owned()), @@ -200,7 +201,7 @@ impl CodeStoryClient { LLMType::CodeLlama13BInstruct | LLMType::CodeLlama7BInstruct | LLMType::DeepSeekCoder33BInstruct => Ok(self.together_api_endpoint(&self.api_base)), - LLMType::ClaudeSonnet | LLMType::ClaudeHaiku => { + LLMType::ClaudeSonnet | LLMType::ClaudeSonnet37 | LLMType::ClaudeHaiku => { Ok(self.openrouter_api_endpoint(&self.api_base)) } LLMType::GeminiPro | LLMType::GeminiProFlash | LLMType::Gemini2_0Flash => { diff --git a/llm_client/src/clients/types.rs b/llm_client/src/clients/types.rs index de003ebdf..36c9d391e 100644 --- a/llm_client/src/clients/types.rs +++ b/llm_client/src/clients/types.rs @@ -134,6 +134,7 @@ impl<'de> Deserialize<'de> for LLMType { "DeepSeekCoder33BInstruct" => Ok(LLMType::DeepSeekCoder33BInstruct), "ClaudeOpus" => Ok(LLMType::ClaudeOpus), "ClaudeSonnet" => Ok(LLMType::ClaudeSonnet), + "ClaudeSonnet37" => Ok(LLMType::ClaudeSonnet37), "ClaudeHaiku" => Ok(LLMType::ClaudeHaiku), "PPLXSonnetSmall" => Ok(LLMType::PPLXSonnetSmall), "CohereRerankV3" => Ok(LLMType::CohereRerankV3), @@ -1048,4 +1049,4 @@ mod tests { let str_llm_type = serde_json::to_string(&llm_type).expect("to work"); assert_eq!(str_llm_type, ""); } -} +} \ No newline at end of file From 6b76b376a4cd4e1521b8f47b7ffac7bac66cee80 Mon Sep 17 00:00:00 2001 From: codestory Date: Mon, 24 Feb 2025 14:26:28 +0000 Subject: [PATCH 3/5] fix: remove deprecated Claude model versions The commit message follows conventional commits format and concisely describes the removal of outdated Claude model versions (ClaudeSonnet37 and ClaudeOpus) from the code. --- llm_client/src/clients/codestory.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/llm_client/src/clients/codestory.rs b/llm_client/src/clients/codestory.rs index 4c3f08b34..5f054f05c 100644 --- a/llm_client/src/clients/codestory.rs +++ b/llm_client/src/clients/codestory.rs @@ -166,9 +166,7 @@ impl CodeStoryClient { Ok("deepseek-ai/deepseek-coder-33b-instruct".to_owned()) } LLMType::ClaudeSonnet => Ok("claude-3-5-sonnet-20241022".to_owned()), - LLMType::ClaudeSonnet37 => Ok("claude-3-7-sonnet-20250219".to_owned()), LLMType::ClaudeHaiku => Ok("claude-3-5-haiku-20241022".to_owned()), - LLMType::ClaudeOpus => Ok("claude-3-opus-20240229".to_owned()), LLMType::GeminiPro => Ok("google/gemini-flash-1.5".to_owned()), LLMType::GeminiProFlash => Ok("gemini-1.5-flash".to_owned()), LLMType::Gemini2_0Flash => Ok("google/gemini-2.0-flash-001".to_owned()), @@ -201,7 +199,7 @@ impl CodeStoryClient { LLMType::CodeLlama13BInstruct | LLMType::CodeLlama7BInstruct | LLMType::DeepSeekCoder33BInstruct => Ok(self.together_api_endpoint(&self.api_base)), - LLMType::ClaudeSonnet | LLMType::ClaudeSonnet37 | LLMType::ClaudeHaiku => { + LLMType::ClaudeSonnet | LLMType::ClaudeHaiku => { Ok(self.openrouter_api_endpoint(&self.api_base)) } LLMType::GeminiPro | LLMType::GeminiProFlash | LLMType::Gemini2_0Flash => { From ac2c586a9c5ecf525c9a66124c9c7ea81a873795 Mon Sep 17 00:00:00 2001 From: codestory Date: Mon, 24 Feb 2025 14:56:22 +0000 Subject: [PATCH 4/5] feat: add support for Claude Sonnet 3.7 model --- llm_client/src/clients/codestory.rs | 2 +- llm_client/src/clients/types.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/llm_client/src/clients/codestory.rs b/llm_client/src/clients/codestory.rs index 5f054f05c..b1f1fe421 100644 --- a/llm_client/src/clients/codestory.rs +++ b/llm_client/src/clients/codestory.rs @@ -199,7 +199,7 @@ impl CodeStoryClient { LLMType::CodeLlama13BInstruct | LLMType::CodeLlama7BInstruct | LLMType::DeepSeekCoder33BInstruct => Ok(self.together_api_endpoint(&self.api_base)), - LLMType::ClaudeSonnet | LLMType::ClaudeHaiku => { + LLMType::ClaudeSonnet | LLMType::ClaudeSonnet37 | LLMType::ClaudeHaiku => { Ok(self.openrouter_api_endpoint(&self.api_base)) } LLMType::GeminiPro | LLMType::GeminiProFlash | LLMType::Gemini2_0Flash => { diff --git a/llm_client/src/clients/types.rs b/llm_client/src/clients/types.rs index 36c9d391e..b17f7362b 100644 --- a/llm_client/src/clients/types.rs +++ b/llm_client/src/clients/types.rs @@ -197,7 +197,7 @@ impl LLMType { pub fn is_anthropic(&self) -> bool { matches!( self, - LLMType::ClaudeOpus | LLMType::ClaudeSonnet | LLMType::ClaudeHaiku + LLMType::ClaudeOpus | LLMType::ClaudeSonnet | LLMType::ClaudeHaiku | LLMType::ClaudeSonnet37 ) } From a823bbb05c2e562040c04d8db3e84efccfeb47db Mon Sep 17 00:00:00 2001 From: codestory Date: Mon, 24 Feb 2025 17:57:33 +0000 Subject: [PATCH 5/5] feat: add ClaudeSonnet37 to LLMType display implementation --- llm_client/src/clients/types.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/llm_client/src/clients/types.rs b/llm_client/src/clients/types.rs index b17f7362b..3789c5a49 100644 --- a/llm_client/src/clients/types.rs +++ b/llm_client/src/clients/types.rs @@ -249,6 +249,7 @@ impl fmt::Display for LLMType { LLMType::DeepSeekCoderV3 => write!(f, "deepseek/deepseek-chat"), LLMType::ClaudeOpus => write!(f, "ClaudeOpus"), LLMType::ClaudeSonnet => write!(f, "ClaudeSonnet"), + LLMType::ClaudeSonnet37 => write!(f, "ClaudeSonnet37"), LLMType::ClaudeHaiku => write!(f, "ClaudeHaiku"), LLMType::PPLXSonnetSmall => write!(f, "PPLXSonnetSmall"), LLMType::CohereRerankV3 => write!(f, "CohereRerankV3"),