Skip to content

Commit

Permalink
copilot_chat: Rename o1-preview model to o1 (#23038)
Browse files Browse the repository at this point in the history
https://github.blog/news-insights/openais-o1-model-available-in-copilot-chat-and-github-models/

Release Notes:

- Renamed Github Copilot Chat "o1-preview" model to "o1".

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
  • Loading branch information
SkywardSyntax and maxdeviant authored Jan 13, 2025
1 parent 7ed834b commit 955248f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions crates/copilot/src/copilot_chat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ pub enum Model {
Gpt4,
#[serde(alias = "gpt-3.5-turbo", rename = "gpt-3.5-turbo")]
Gpt3_5Turbo,
#[serde(alias = "o1-preview", rename = "o1")]
O1Preview,
#[serde(alias = "o1", rename = "o1")]
O1,
#[serde(alias = "o1-mini", rename = "o1-mini")]
O1Mini,
#[serde(alias = "claude-3-5-sonnet", rename = "claude-3.5-sonnet")]
Expand All @@ -46,7 +46,7 @@ impl Model {
pub fn uses_streaming(&self) -> bool {
match self {
Self::Gpt4o | Self::Gpt4 | Self::Gpt3_5Turbo | Self::Claude3_5Sonnet => true,
Self::O1Mini | Self::O1Preview => false,
Self::O1Mini | Self::O1 => false,
}
}

Expand All @@ -55,7 +55,7 @@ impl Model {
"gpt-4o" => Ok(Self::Gpt4o),
"gpt-4" => Ok(Self::Gpt4),
"gpt-3.5-turbo" => Ok(Self::Gpt3_5Turbo),
"o1-preview" => Ok(Self::O1Preview),
"o1" => Ok(Self::O1),
"o1-mini" => Ok(Self::O1Mini),
"claude-3-5-sonnet" => Ok(Self::Claude3_5Sonnet),
_ => Err(anyhow!("Invalid model id: {}", id)),
Expand All @@ -68,7 +68,7 @@ impl Model {
Self::Gpt4 => "gpt-4",
Self::Gpt4o => "gpt-4o",
Self::O1Mini => "o1-mini",
Self::O1Preview => "o1-preview",
Self::O1 => "o1",
Self::Claude3_5Sonnet => "claude-3-5-sonnet",
}
}
Expand All @@ -79,7 +79,7 @@ impl Model {
Self::Gpt4 => "GPT-4",
Self::Gpt4o => "GPT-4o",
Self::O1Mini => "o1-mini",
Self::O1Preview => "o1-preview",
Self::O1 => "o1",
Self::Claude3_5Sonnet => "Claude 3.5 Sonnet",
}
}
Expand All @@ -90,7 +90,7 @@ impl Model {
Self::Gpt4 => 32768,
Self::Gpt3_5Turbo => 12288,
Self::O1Mini => 20000,
Self::O1Preview => 20000,
Self::O1 => 20000,
Self::Claude3_5Sonnet => 200_000,
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/language_models/src/provider/copilot_chat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ impl LanguageModel for CopilotChatLanguageModel {
CopilotChatModel::Gpt4o => open_ai::Model::FourOmni,
CopilotChatModel::Gpt4 => open_ai::Model::Four,
CopilotChatModel::Gpt3_5Turbo => open_ai::Model::ThreePointFiveTurbo,
CopilotChatModel::O1Preview | CopilotChatModel::O1Mini => open_ai::Model::Four,
CopilotChatModel::O1 | CopilotChatModel::O1Mini => open_ai::Model::Four,
CopilotChatModel::Claude3_5Sonnet => unreachable!(),
};
count_open_ai_tokens(request, model, cx)
Expand Down

0 comments on commit 955248f

Please sign in to comment.