-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat: hardcode temperature to 1 for GPT-5 models #6830
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 all commits
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 |
|---|---|---|
|
|
@@ -146,6 +146,11 @@ export function getModelParams({ | |
| params.temperature = undefined | ||
| } | ||
|
|
||
| // Hardcode temperature to 1 for GPT-5 models | ||
| if (modelId.startsWith("gpt-5")) { | ||
| params.temperature = 1 | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the placement after the o1/o3-mini handling intentional? It might be cleaner to group all OpenAI model-specific temperature handling together, perhaps in a separate helper function for better maintainability. Also, could we add a comment explaining why temperature is hardcoded to 1 for GPT-5 models, similar to lines 143-144 for o1/o3-mini? |
||
| } | ||
|
|
||
| return { | ||
| format, | ||
| ...params, | ||
|
|
||
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.
Great test coverage! Consider adding a test case for potential future GPT-5 variants (e.g., "gpt-5-turbo") to ensure the startsWith("gpt-5") logic handles all GPT-5 family models correctly.
Also, for consistency, the test descriptions could follow a uniform pattern like "hardcodes temperature to 1 for..." and "preserves user temperature for..."