feat(llm_openai): make temperature configurable - #1709
Conversation
temperature was hardcoded to 0 when constructing ChatOpenAI for
non-reasoning models, with no way to override it via the node's config.
This forced fully deterministic output regardless of use case, with no
path for creative writing, brainstorming, or varied-response pipelines
short of editing the node's source directly.
Read temperature via config.get('temperature', 0) and pass it through
to ChatOpenAI(...) instead of the hardcoded 0, following the existing
pattern already working in llm_ollama. Defaults to the current
behavior when unset, so it's fully backward-compatible. Exposed for
every OpenAI profile (not just custom), since the motivating use cases
apply to named models like gpt-4o/gpt-5.2 as much as custom ones.
Closes rocketride-org#1660
🤖 Internal: Discord sync markerAuto-managed by the Discord notification workflow. Stores the linked Discord message ID and forum thread ID. Do not edit or delete. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe OpenAI node exposes configurable ChangesOpenAI temperature configuration
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Biome (2.5.5)nodes/src/nodes/llm_openai/services.jsonFile contains syntax errors that prevent linting: Line 2: Expected a property but instead found '//'.; Line 6: End of file expected; Line 6: End of file expected; Line 6: End of file expected; Line 6: End of file expected; Line 11: End of file expected; Line 11: End of file expected; Line 11: End of file expected; Line 11: End of file expected; Line 16: End of file expected; Line 16: End of file expected; Line 16: End of file expected; Line 16: End of file expected; Line 22: End of file expected; Line 22: End of file expected; Line 22: End of file expected; Line 22: End of file expected; Line 28: End of file expected; Line 28: End of file expected; Line 28: End of file expected; Line 28: End of file expected; Line 34: End of file expected; Line 34: End of file expected; Line 34: End of file expected; Line 34: End of file expected; Line 40: End of file expected; Line 40: End of file expected; Line 40: End of file expected; Line 40: End of file expected; Line 45: End of file expected; Li ... [truncated 12798 characters] ... instead found '// openrouter'.; Line 545: expected Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@nodes/src/nodes/llm_openai/services.json`:
- Around line 580-584: Revise the temperature documentation to avoid
guaranteeing deterministic output: in nodes/src/nodes/llm_openai/services.json
lines 580-584, change the description to state that 0 is generally more
deterministic; in nodes/src/nodes/llm_openai/README.md lines 13-16, replace the
claim that responses are deterministic with equivalent probabilistic wording.
Update documentation only; no code behavior changes are needed.
- Around line 580-584: The temperature field definition in services.json
currently accepts any number; update the temperature schema to enforce a minimum
of 0 and maximum of 2, so invalid values are rejected during configuration
validation before reaching ChatOpenAI.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 485f8727-748f-454b-ad86-ffae21902028
📒 Files selected for processing (3)
nodes/src/nodes/llm_openai/README.mdnodes/src/nodes/llm_openai/openai_client.pynodes/src/nodes/llm_openai/services.json
- Bound temperature to [0, 2] (OpenAI's accepted range) so out-of-range values fail config validation before reaching the client. - Soften "deterministic" claims to reflect that temperature 0 does not guarantee identical OpenAI output for identical input.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
nodes/src/nodes/llm_openai/README.md (1)
53-53: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winDocument the supported temperature range.
services.jsonrejects values outside0–2, but the hand-written README does not state that range. Add it to the field description so users know the accepted values before configuration.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@nodes/src/nodes/llm_openai/README.md` at line 53, Update the temperature field description in the README to state that accepted values range from 0 to 2, while preserving the existing default, profile availability, and reasoning-model behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@nodes/src/nodes/llm_openai/README.md`:
- Line 53: Update the temperature field description in the README to state that
accepted values range from 0 to 2, while preserving the existing default,
profile availability, and reasoning-model behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: a2e78a2c-4a35-4ec2-a5df-683449b02b19
📒 Files selected for processing (2)
nodes/src/nodes/llm_openai/README.mdnodes/src/nodes/llm_openai/services.json
services.json bounds temperature to [0, 2]; the README field table didn't state that range.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
nodes/src/nodes/llm_openai/README.md (1)
53-57: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick winRegenerate the README schema section.
The new
temperaturefield is documented here, but the generated schema block later in this README still omits it. Runnodes:docs-generateso the user-facing schema matchesservices.json; do not manually edit the generated block.As per coding guidelines, content between
ROCKETRIDE:GENERATED:PARAMS STARTandROCKETRIDE:GENERATED:PARAMS ENDmust be regenerated.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@nodes/src/nodes/llm_openai/README.md` around lines 53 - 57, Regenerate the README schema section using the nodes:docs-generate command so the generated block between ROCKETRIDE:GENERATED:PARAMS START and ROCKETRIDE:GENERATED:PARAMS END includes the temperature field from services.json; do not edit that generated block manually.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@nodes/src/nodes/llm_openai/README.md`:
- Around line 53-57: Regenerate the README schema section using the
nodes:docs-generate command so the generated block between
ROCKETRIDE:GENERATED:PARAMS START and ROCKETRIDE:GENERATED:PARAMS END includes
the temperature field from services.json; do not edit that generated block
manually.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: ae79e223-39fa-4423-a2d6-ffeee84f0d9b
📒 Files selected for processing (1)
nodes/src/nodes/llm_openai/README.md
Run via nodes:docs-generate (with a temporary branch rename to satisfy its release-track-branch gate, then reverted) rather than hand-editing the generated block, per the repo's doc-generation convention.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@nodes/src/nodes/llm_openai/README.md`:
- Line 138: The temperature field’s generated documentation omits its documented
default. Update the temperature definition in services.json to declare a default
value of 0, then rerun nodes:docs-generate so the README table is regenerated;
do not edit the generated README block directly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 86c2ed0c-a07f-42b4-b85c-e65e8fe4f694
📒 Files selected for processing (1)
nodes/src/nodes/llm_openai/README.md
Add "default": 0 to services.json so the generated Schema table's Default column isn't blank, and drop the now-redundant "Defaults to 0." prose from the description (the default field carries it). Regenerated via nodes:docs-generate (temporary branch rename to satisfy its release-track gate, reverted after), not hand-edited.
Summary
llm_openaihardcodedtemperature=0when constructingChatOpenAIfornon-reasoning models, with no way to configure it via the node's config. This
forced fully deterministic output regardless of use case — creative writing,
brainstorming, or varied-response pipelines had no way to increase temperature
without editing the node's source directly.
temperatureviaconfig.get('temperature', 0)and pass it through toChatOpenAI(...)instead of the hardcoded0, porting the pattern alreadyworking in
llm_ollama.Responses API and don't currently pass
temperatureat all; OpenAI'sreasoning models reject arbitrary temperature values, so that path is left
alone rather than risk breaking it.
temperaturefield toservices.json, exposed for every profile(not just
custom), since the motivating use cases (gpt-4o, gpt-5.2, etc.)apply to named models as much as custom ones.
README.md(prose + Fields table).Scoped to
llm_openaionly, per the issue's own scope note — other providerswith the same hardcoding (
llm_mistral,llm_bedrock,llm_baidu_qianfan,llm_gmi_cloud,llm_perplexity,llm_ibm_watson) can follow in separatePRs.
Closes #1660
Test plan
./builder nodes:test --pytest-pattern="llm_openai"— 12 passedruff check/ruff format --checkcleantemperatureis unsetSummary by CodeRabbit
0, range0–2).