language_models: Add vision support for OpenAI gpt-5, gpt-5-mini, and gpt-5-nano models (#36047)
## Summary Enable image processing capabilities for GPT-5 series models by updating the `supports_images()` method. ## Changes - Add vision support for `gpt-5`, `gpt-5-mini`, and `gpt-5-nano` models - Update `supports_images()` method in `crates/language_models/src/provider/open_ai.rs` ## Models with Vision Support (after this PR) - gpt-4o - gpt-4o-mini - gpt-4.1 - gpt-4.1-mini - gpt-4.1-nano - gpt-5 (new) - gpt-5-mini (new) - gpt-5-nano (new) - o1 - o3 - o4-mini This brings GPT-5 vision capabilities in line with other OpenAI models that support image processing. Release Notes: - Added vision support for OpenAI models
This commit is contained in:
parent
d8fc53608e
commit
9de04ce215
1 changed files with 19 additions and 1 deletions
|
@ -301,7 +301,25 @@ impl LanguageModel for OpenAiLanguageModel {
|
|||
}
|
||||
|
||||
fn supports_images(&self) -> bool {
|
||||
false
|
||||
use open_ai::Model;
|
||||
match &self.model {
|
||||
Model::FourOmni
|
||||
| Model::FourOmniMini
|
||||
| Model::FourPointOne
|
||||
| Model::FourPointOneMini
|
||||
| Model::FourPointOneNano
|
||||
| Model::Five
|
||||
| Model::FiveMini
|
||||
| Model::FiveNano
|
||||
| Model::O1
|
||||
| Model::O3
|
||||
| Model::O4Mini => true,
|
||||
Model::ThreePointFiveTurbo
|
||||
| Model::Four
|
||||
| Model::FourTurbo
|
||||
| Model::O3Mini
|
||||
| Model::Custom { .. } => false,
|
||||
}
|
||||
}
|
||||
|
||||
fn supports_tool_choice(&self, choice: LanguageModelToolChoice) -> bool {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue