Browse Source

fix: use nullish coalescing for temperature default

`||` treats temperature=0 as falsy and falls back to 0.7, which
incorrectly clamps a valid zero temperature. `??` only falls back
when the value is null/undefined.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
handoff-20260429-1057
shrimbly 4 months ago
parent
commit
ee7b251f6b
  1. 2
      src/components/nodes/LLMGenerateNode.tsx

2
src/components/nodes/LLMGenerateNode.tsx

@ -83,7 +83,7 @@ export function LLMGenerateNode({ id, data, selected }: NodeProps<LLMGenerateNod
provider: newProvider,
model: firstModelForProvider,
};
if (newProvider === "anthropic" && (nodeData.temperature || 0.7) > 1) {
if (newProvider === "anthropic" && (nodeData.temperature ?? 0.7) > 1) {
updates.temperature = 1;
}
updateNodeData(id, updates);

Loading…
Cancel
Save