copilot: Add Claude 3.7-Sonnet-Thought model to Copilot Chat (#27409)
- Follow-up to: #25529 Release Notes: - Added Claude Sonnet 3.7 Thought to GitHub Copilot Chat
This commit is contained in:
parent
35ec4753b4
commit
baf03e355b
2 changed files with 13 additions and 1 deletions
|
@ -43,6 +43,11 @@ pub enum Model {
|
||||||
Claude3_5Sonnet,
|
Claude3_5Sonnet,
|
||||||
#[serde(alias = "claude-3-7-sonnet", rename = "claude-3.7-sonnet")]
|
#[serde(alias = "claude-3-7-sonnet", rename = "claude-3.7-sonnet")]
|
||||||
Claude3_7Sonnet,
|
Claude3_7Sonnet,
|
||||||
|
#[serde(
|
||||||
|
alias = "claude-3.7-sonnet-thought",
|
||||||
|
rename = "claude-3.7-sonnet-thought"
|
||||||
|
)]
|
||||||
|
Claude3_7SonnetThinking,
|
||||||
#[serde(alias = "gemini-2.0-flash", rename = "gemini-2.0-flash-001")]
|
#[serde(alias = "gemini-2.0-flash", rename = "gemini-2.0-flash-001")]
|
||||||
Gemini20Flash,
|
Gemini20Flash,
|
||||||
}
|
}
|
||||||
|
@ -54,7 +59,8 @@ impl Model {
|
||||||
| Self::Gpt4
|
| Self::Gpt4
|
||||||
| Self::Gpt3_5Turbo
|
| Self::Gpt3_5Turbo
|
||||||
| Self::Claude3_5Sonnet
|
| Self::Claude3_5Sonnet
|
||||||
| Self::Claude3_7Sonnet => true,
|
| Self::Claude3_7Sonnet
|
||||||
|
| Self::Claude3_7SonnetThinking => true,
|
||||||
Self::O3Mini | Self::O1 | Self::Gemini20Flash => false,
|
Self::O3Mini | Self::O1 | Self::Gemini20Flash => false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -68,6 +74,7 @@ impl Model {
|
||||||
"o3-mini" => Ok(Self::O3Mini),
|
"o3-mini" => Ok(Self::O3Mini),
|
||||||
"claude-3-5-sonnet" => Ok(Self::Claude3_5Sonnet),
|
"claude-3-5-sonnet" => Ok(Self::Claude3_5Sonnet),
|
||||||
"claude-3-7-sonnet" => Ok(Self::Claude3_7Sonnet),
|
"claude-3-7-sonnet" => Ok(Self::Claude3_7Sonnet),
|
||||||
|
"claude-3.7-sonnet-thought" => Ok(Self::Claude3_7SonnetThinking),
|
||||||
"gemini-2.0-flash-001" => Ok(Self::Gemini20Flash),
|
"gemini-2.0-flash-001" => Ok(Self::Gemini20Flash),
|
||||||
_ => Err(anyhow!("Invalid model id: {}", id)),
|
_ => Err(anyhow!("Invalid model id: {}", id)),
|
||||||
}
|
}
|
||||||
|
@ -82,6 +89,7 @@ impl Model {
|
||||||
Self::O1 => "o1",
|
Self::O1 => "o1",
|
||||||
Self::Claude3_5Sonnet => "claude-3-5-sonnet",
|
Self::Claude3_5Sonnet => "claude-3-5-sonnet",
|
||||||
Self::Claude3_7Sonnet => "claude-3-7-sonnet",
|
Self::Claude3_7Sonnet => "claude-3-7-sonnet",
|
||||||
|
Self::Claude3_7SonnetThinking => "claude-3.7-sonnet-thought",
|
||||||
Self::Gemini20Flash => "gemini-2.0-flash-001",
|
Self::Gemini20Flash => "gemini-2.0-flash-001",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -95,6 +103,7 @@ impl Model {
|
||||||
Self::O1 => "o1",
|
Self::O1 => "o1",
|
||||||
Self::Claude3_5Sonnet => "Claude 3.5 Sonnet",
|
Self::Claude3_5Sonnet => "Claude 3.5 Sonnet",
|
||||||
Self::Claude3_7Sonnet => "Claude 3.7 Sonnet",
|
Self::Claude3_7Sonnet => "Claude 3.7 Sonnet",
|
||||||
|
Self::Claude3_7SonnetThinking => "Claude 3.7 Sonnet Thinking",
|
||||||
Self::Gemini20Flash => "Gemini 2.0 Flash",
|
Self::Gemini20Flash => "Gemini 2.0 Flash",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -108,6 +117,7 @@ impl Model {
|
||||||
Self::O1 => 20_000,
|
Self::O1 => 20_000,
|
||||||
Self::Claude3_5Sonnet => 200_000,
|
Self::Claude3_5Sonnet => 200_000,
|
||||||
Self::Claude3_7Sonnet => 90_000,
|
Self::Claude3_7Sonnet => 90_000,
|
||||||
|
Self::Claude3_7SonnetThinking => 90_000,
|
||||||
Model::Gemini20Flash => 128_000,
|
Model::Gemini20Flash => 128_000,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -186,6 +186,7 @@ impl LanguageModel for CopilotChatLanguageModel {
|
||||||
match self.model {
|
match self.model {
|
||||||
CopilotChatModel::Claude3_5Sonnet => count_anthropic_tokens(request, cx),
|
CopilotChatModel::Claude3_5Sonnet => count_anthropic_tokens(request, cx),
|
||||||
CopilotChatModel::Claude3_7Sonnet => count_anthropic_tokens(request, cx),
|
CopilotChatModel::Claude3_7Sonnet => count_anthropic_tokens(request, cx),
|
||||||
|
CopilotChatModel::Claude3_7SonnetThinking => count_anthropic_tokens(request, cx),
|
||||||
CopilotChatModel::Gemini20Flash => count_google_tokens(request, cx),
|
CopilotChatModel::Gemini20Flash => count_google_tokens(request, cx),
|
||||||
_ => {
|
_ => {
|
||||||
let model = match self.model {
|
let model = match self.model {
|
||||||
|
@ -195,6 +196,7 @@ impl LanguageModel for CopilotChatLanguageModel {
|
||||||
CopilotChatModel::O1 | CopilotChatModel::O3Mini => open_ai::Model::Four,
|
CopilotChatModel::O1 | CopilotChatModel::O3Mini => open_ai::Model::Four,
|
||||||
CopilotChatModel::Claude3_5Sonnet
|
CopilotChatModel::Claude3_5Sonnet
|
||||||
| CopilotChatModel::Claude3_7Sonnet
|
| CopilotChatModel::Claude3_7Sonnet
|
||||||
|
| CopilotChatModel::Claude3_7SonnetThinking
|
||||||
| CopilotChatModel::Gemini20Flash => {
|
| CopilotChatModel::Gemini20Flash => {
|
||||||
unreachable!()
|
unreachable!()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue