fix(openai_models): Use correct options for o3 and o3-mini models#1370
Open
BillionClaw wants to merge 1 commit intosimonw:mainfrom
Open
fix(openai_models): Use correct options for o3 and o3-mini models#1370BillionClaw wants to merge 1 commit intosimonw:mainfrom
BillionClaw wants to merge 1 commit intosimonw:mainfrom
Conversation
The o3 and o3-mini models don't support temperature, max_tokens, top_p, frequency_penalty, and presence_penalty parameters. They only support max_completion_tokens and reasoning_effort. Fixes simonw#731
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #731
The o3 and o3-mini models don't support
temperature,max_tokens,top_p,frequency_penalty, andpresence_penaltyparameters. When these parameters are passed to the OpenAI API, it returns an error like:This PR creates a new
OptionsForO3class that only includes the supported parameters:max_completion_tokens- Maximum number of tokens to generate (including reasoning tokens)reasoning_effort- Constraints effort on reasoning (low, medium, high)Changes
OptionsForO3class with onlymax_completion_tokensandreasoning_effortoptionsis_o3parameter to_Sharedclass to distinguish o3 models from other reasoning modelsis_o3=Trueinstead ofreasoning=TrueTesting
max_completion_tokensandreasoning_effortoptionsOptionsForReasoningwith all standard options