Skip to content

Commit 56780fb

Browse files
committed
feat: fix code review points
1 parent c9fdb3b commit 56780fb

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

packages/components/nodes/chatmodels/ChatLmStudio/ChatLmStudio.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ class ChatLmStudio_ChatModels implements INode {
119119
const cache = nodeData.inputs?.cache as BaseCache
120120

121121
const obj: ChatLmStudioFields = {
122-
temperature: parseFloat(temperature),
123122
modelName,
124123
streaming: streaming ?? true,
125124
configuration: {
@@ -128,6 +127,7 @@ class ChatLmStudio_ChatModels implements INode {
128127
}
129128
}
130129

130+
if (temperature) obj.temperature = parseFloat(temperature)
131131
if (maxTokens) obj.maxTokens = parseInt(maxTokens, 10)
132132
if (topP) obj.topP = parseFloat(topP)
133133
if (timeout) obj.timeout = parseInt(timeout, 10)

packages/components/nodes/llms/LmStudio/LmStudio.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ class LmStudio_LLMs implements INode {
2929
label: 'Connect Credential',
3030
name: 'credential',
3131
type: 'credential',
32-
credentialNames: ['lmStudioApi']
32+
credentialNames: ['lmStudioApi'],
33+
optional: true
3334
}
3435
this.inputs = [
3536
{
@@ -143,7 +144,6 @@ class LmStudio_LLMs implements INode {
143144
const cache = nodeData.inputs?.cache as BaseCache
144145

145146
const obj: Partial<LmStudioInput> & BaseLLMParams & { configuration?: ClientOptions } = {
146-
temperature: parseFloat(temperature),
147147
modelName,
148148
streaming: streaming ?? true,
149149
configuration: {
@@ -152,6 +152,7 @@ class LmStudio_LLMs implements INode {
152152
}
153153
}
154154

155+
if (temperature) obj.temperature = parseFloat(temperature)
155156
if (maxTokens) obj.maxTokens = parseInt(maxTokens, 10)
156157
if (topP) obj.topP = parseFloat(topP)
157158
if (frequencyPenalty) obj.frequencyPenalty = parseFloat(frequencyPenalty)

0 commit comments

Comments
 (0)