feat: hardcode temperature to 1 for GPT-5 models#6830
feat: hardcode temperature to 1 for GPT-5 models#6830roomote[bot] wants to merge 1 commit intomainfrom
Conversation
- Set temperature to 1 for all GPT-5 model variants (gpt-5, gpt-5-mini, gpt-5-nano) - Added comprehensive tests to verify temperature hardcoding - Ensures consistent behavior for GPT-5 models as requested
|
|
||
| // Hardcode temperature to 1 for GPT-5 models | ||
| if (modelId.startsWith("gpt-5")) { | ||
| params.temperature = 1 |
There was a problem hiding this comment.
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?
| }) | ||
| }) | ||
|
|
||
| describe("GPT-5 temperature hardcoding", () => { |
There was a problem hiding this comment.
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..."
This PR hardcodes the temperature to 1 for all GPT-5 model variants as requested by @mrubens in #6819.
Changes
getModelParamsfunction insrc/api/transform/model-params.tsto set temperature to 1 for models starting with "gpt-5"Testing
Context
This change was requested in PR #6819 to ensure consistent behavior for GPT-5 models by always using a temperature of 1, regardless of user settings or defaults.
Fixes: Follow-up to #6819
Important
Hardcodes temperature to 1 for GPT-5 models in
getModelParamsand adds tests to verify this behavior.getModelParamsinmodel-params.ts.model-params.spec.tsto verify temperature hardcoding for GPT-5 models.This description was created by
for d8092e3. You can customize this summary. It will automatically update as commits are pushed.