google: Add latest versions of Gemini 2.5 Pro and Flash Preview (#32183)

Release Notes:

- Added the latest versions of Gemini 2.5 Pro and Flash Preview
This commit is contained in:
Oleksiy Syvokon 2025-06-05 22:30:34 +03:00 committed by GitHub
parent d15d85830a
commit 04cd3fcd23
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 44 additions and 6 deletions

View file

@ -508,6 +508,16 @@ pub enum Model {
Gemini25ProPreview0325,
#[serde(rename = "gemini-2.5-flash-preview-04-17")]
Gemini25FlashPreview0417,
#[serde(
rename = "gemini-2.5-flash-preview-latest",
alias = "gemini-2.5-flash-preview-05-20"
)]
Gemini25FlashPreview,
#[serde(
rename = "gemini-2.5-pro-preview-latest",
alias = "gemini-2.5-pro-preview-06-05"
)]
Gemini25ProPreview,
#[serde(rename = "custom")]
Custom {
name: String,
@ -535,6 +545,24 @@ impl Model {
Model::Gemini25ProExp0325 => "gemini-2.5-pro-exp-03-25",
Model::Gemini25ProPreview0325 => "gemini-2.5-pro-preview-03-25",
Model::Gemini25FlashPreview0417 => "gemini-2.5-flash-preview-04-17",
Model::Gemini25FlashPreview => "gemini-2.5-flash-preview-latest",
Model::Gemini25ProPreview => "gemini-2.5-pro-preview-latest",
Model::Custom { name, .. } => name,
}
}
pub fn request_id(&self) -> &str {
match self {
Model::Gemini15Pro => "gemini-1.5-pro",
Model::Gemini15Flash => "gemini-1.5-flash",
Model::Gemini20Pro => "gemini-2.0-pro-exp",
Model::Gemini20Flash => "gemini-2.0-flash",
Model::Gemini20FlashThinking => "gemini-2.0-flash-thinking-exp",
Model::Gemini20FlashLite => "gemini-2.0-flash-lite-preview",
Model::Gemini25ProExp0325 => "gemini-2.5-pro-exp-03-25",
Model::Gemini25ProPreview0325 => "gemini-2.5-pro-preview-03-25",
Model::Gemini25FlashPreview0417 => "gemini-2.5-flash-preview-04-17",
Model::Gemini25FlashPreview => "gemini-2.5-flash-preview-05-20",
Model::Gemini25ProPreview => "gemini-2.5-pro-preview-06-05",
Model::Custom { name, .. } => name,
}
}
@ -548,8 +576,10 @@ impl Model {
Model::Gemini20FlashThinking => "Gemini 2.0 Flash Thinking",
Model::Gemini20FlashLite => "Gemini 2.0 Flash Lite",
Model::Gemini25ProExp0325 => "Gemini 2.5 Pro Exp",
Model::Gemini25ProPreview0325 => "Gemini 2.5 Pro Preview",
Model::Gemini25FlashPreview0417 => "Gemini 2.5 Flash Preview",
Model::Gemini25ProPreview0325 => "Gemini 2.5 Pro Preview (0325)",
Model::Gemini25FlashPreview0417 => "Gemini 2.5 Flash Preview (0417)",
Model::Gemini25FlashPreview => "Gemini 2.5 Flash Preview",
Model::Gemini25ProPreview => "Gemini 2.5 Pro Preview",
Self::Custom {
name, display_name, ..
} => display_name.as_ref().unwrap_or(name),
@ -569,6 +599,8 @@ impl Model {
Model::Gemini25ProExp0325 => ONE_MILLION,
Model::Gemini25ProPreview0325 => ONE_MILLION,
Model::Gemini25FlashPreview0417 => ONE_MILLION,
Model::Gemini25FlashPreview => ONE_MILLION,
Model::Gemini25ProPreview => ONE_MILLION,
Model::Custom { max_tokens, .. } => *max_tokens,
}
}
@ -582,6 +614,8 @@ impl Model {
| Self::Gemini20FlashThinking
| Self::Gemini20FlashLite
| Self::Gemini25ProExp0325
| Self::Gemini25ProPreview
| Self::Gemini25FlashPreview
| Self::Gemini25ProPreview0325
| Self::Gemini25FlashPreview0417 => GoogleModelMode::Default,
Self::Custom { mode, .. } => *mode,