agent: Add support for google gemini 2.5 flash preview (#29205)

Adds support for the new gemini-2.5-flash-preview-04-17

Release Notes:

- agent: Added support for gemini-2.5-flash-preview
This commit is contained in:
Stephan Seidt 2025-04-22 11:37:12 +02:00 committed by GitHub
parent b0b620af56
commit 10ded0ab75
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View file

@ -402,6 +402,8 @@ pub enum Model {
Gemini25ProExp0325,
#[serde(rename = "gemini-2.5-pro-preview-03-25")]
Gemini25ProPreview0325,
#[serde(rename = "gemini-2.5-flash-preview-04-17")]
Gemini25FlashPreview0417,
#[serde(rename = "custom")]
Custom {
name: String,
@ -426,6 +428,7 @@ impl Model {
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::Custom { name, .. } => name,
}
}
@ -440,6 +443,7 @@ impl Model {
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",
Self::Custom {
name, display_name, ..
} => display_name.as_ref().unwrap_or(name),
@ -456,6 +460,7 @@ impl Model {
Model::Gemini20FlashLite => 1_000_000,
Model::Gemini25ProExp0325 => 1_000_000,
Model::Gemini25ProPreview0325 => 1_000_000,
Model::Gemini25FlashPreview0417 => 1_000_000,
Model::Custom { max_tokens, .. } => *max_tokens,
}
}