OpenAI cleanups (#32597)

Release Notes:

- openai: Remove support for deprecated o1-preview and o1-mini models 
- openai: Support streaming for o1 model
This commit is contained in:
Ben Brandt 2025-06-12 10:55:48 +02:00 committed by GitHub
parent 4e4856f2c1
commit 2d4e427b45
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 244 deletions

View file

@ -438,7 +438,7 @@ pub fn into_open_ai(
stream,
stop: request.stop,
temperature: request.temperature.unwrap_or(1.0),
max_tokens: max_output_tokens,
max_completion_tokens: max_output_tokens,
parallel_tool_calls: if model.supports_parallel_tool_calls() && !request.tools.is_empty() {
// Disable parallel tool calls, as the Agent currently expects a maximum of one per turn.
Some(false)
@ -648,8 +648,6 @@ pub fn count_open_ai_tokens(
| Model::FourPointOneMini
| Model::FourPointOneNano
| Model::O1
| Model::O1Preview
| Model::O1Mini
| Model::O3
| Model::O3Mini
| Model::O4Mini => tiktoken_rs::num_tokens_from_messages(model.id(), &messages),