Skip to content

Commit 132d978

Browse files
FuturMixclaude
andcommitted
fix: guard temperature against NaN when undefined
Move temperature out of the ChatOpenAIFields initializer and apply it conditionally, matching the pattern used by maxTokens, topP, frequencyPenalty and presencePenalty. This prevents parseFloat from returning NaN when the temperature input is undefined or empty. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 7d6345d commit 132d978

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/components/nodes/chatmodels/ChatFuturMix/ChatFuturMix.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,13 @@ class ChatFuturMix_ChatModels implements INode {
148148
const futurmixApiKey = getCredentialParam('futurmixApiKey', credentialData, nodeData)
149149

150150
const obj: ChatOpenAIFields = {
151-
temperature: parseFloat(temperature),
152151
modelName,
153152
openAIApiKey: futurmixApiKey,
154153
apiKey: futurmixApiKey,
155154
streaming: streaming ?? true
156155
}
157156

157+
if (temperature) obj.temperature = parseFloat(temperature)
158158
if (maxTokens) obj.maxTokens = parseInt(maxTokens, 10)
159159
if (topP) obj.topP = parseFloat(topP)
160160
if (frequencyPenalty) obj.frequencyPenalty = parseFloat(frequencyPenalty)

0 commit comments

Comments
 (0)