-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat: set default temperature to 1.0 for GPT-5 models #6831
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -147,10 +147,13 @@ export class OpenAiNativeHandler extends BaseProvider implements SingleCompletio | |
| ): ApiStream { | ||
| const { reasoning, verbosity } = this.getModel() | ||
|
|
||
| // For GPT-5 models, use temperature 1.0 as default when user hasn't set a temperature | ||
| const defaultTemp = this.isGpt5Model(model.id) ? 1.0 : OPENAI_NATIVE_DEFAULT_TEMPERATURE | ||
|
|
||
| // Prepare the request parameters | ||
| const params: any = { | ||
| model: model.id, | ||
| temperature: this.options.modelTemperature ?? OPENAI_NATIVE_DEFAULT_TEMPERATURE, | ||
| temperature: this.options.modelTemperature ?? defaultTemp, | ||
|
||
| messages: [{ role: "system", content: systemPrompt }, ...convertToOpenAiMessages(messages)], | ||
| stream: true, | ||
| stream_options: { include_usage: true }, | ||
|
|
@@ -401,12 +404,15 @@ export class OpenAiNativeHandler extends BaseProvider implements SingleCompletio | |
|
|
||
| const info: ModelInfo = openAiNativeModels[id] | ||
|
|
||
| // For GPT-5 models, use temperature 1.0 as default when user hasn't set a temperature | ||
|
||
| const defaultTemp = this.isGpt5Model(id) ? 1.0 : OPENAI_NATIVE_DEFAULT_TEMPERATURE | ||
|
|
||
| const params = getModelParams({ | ||
| format: "openai", | ||
| modelId: id, | ||
| model: info, | ||
| settings: this.options, | ||
| defaultTemperature: OPENAI_NATIVE_DEFAULT_TEMPERATURE, | ||
| defaultTemperature: defaultTemp, | ||
| }) | ||
|
|
||
| // For GPT-5 models, ensure we support minimal reasoning effort | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this intentional? We're setting up temperature logic for GPT-5 models in
handleDefaultModelMessage, but GPT-5 models actually get routed tohandleGpt5Message(line 85) which doesn't use this temperature setting at all. This means the temperature logic here would never actually apply to GPT-5 models.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@daniel-lxs is it right?