mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 21:00:58 +03:00
fix: temperature convert to float
This commit is contained in:
@@ -124,7 +124,7 @@ class AzureChatOpenAI_ChatModels implements INode {
|
|||||||
const streaming = nodeData.inputs?.streaming as boolean
|
const streaming = nodeData.inputs?.streaming as boolean
|
||||||
|
|
||||||
const obj: Partial<AzureOpenAIInput> & Partial<OpenAIBaseInput> = {
|
const obj: Partial<AzureOpenAIInput> & Partial<OpenAIBaseInput> = {
|
||||||
temperature: parseInt(temperature, 10),
|
temperature: parseFloat(temperature),
|
||||||
modelName,
|
modelName,
|
||||||
azureOpenAIApiKey,
|
azureOpenAIApiKey,
|
||||||
azureOpenAIApiInstanceName,
|
azureOpenAIApiInstanceName,
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ class ChatAnthropic_ChatModels implements INode {
|
|||||||
const streaming = nodeData.inputs?.streaming as boolean
|
const streaming = nodeData.inputs?.streaming as boolean
|
||||||
|
|
||||||
const obj: Partial<AnthropicInput> & { anthropicApiKey?: string } = {
|
const obj: Partial<AnthropicInput> & { anthropicApiKey?: string } = {
|
||||||
temperature: parseInt(temperature, 10),
|
temperature: parseFloat(temperature),
|
||||||
modelName,
|
modelName,
|
||||||
anthropicApiKey,
|
anthropicApiKey,
|
||||||
streaming: streaming ?? true
|
streaming: streaming ?? true
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ class ChatHuggingFace_ChatModels implements INode {
|
|||||||
apiKey
|
apiKey
|
||||||
}
|
}
|
||||||
|
|
||||||
if (temperature) obj.temperature = parseInt(temperature, 10)
|
if (temperature) obj.temperature = parseFloat(temperature)
|
||||||
if (maxTokens) obj.maxTokens = parseInt(maxTokens, 10)
|
if (maxTokens) obj.maxTokens = parseInt(maxTokens, 10)
|
||||||
if (topP) obj.topP = parseInt(topP, 10)
|
if (topP) obj.topP = parseInt(topP, 10)
|
||||||
if (hfTopK) obj.topK = parseInt(hfTopK, 10)
|
if (hfTopK) obj.topK = parseInt(hfTopK, 10)
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ class ChatLocalAI_ChatModels implements INode {
|
|||||||
const basePath = nodeData.inputs?.basePath as string
|
const basePath = nodeData.inputs?.basePath as string
|
||||||
|
|
||||||
const obj: Partial<OpenAIChatInput> & { openAIApiKey?: string } = {
|
const obj: Partial<OpenAIChatInput> & { openAIApiKey?: string } = {
|
||||||
temperature: parseInt(temperature, 10),
|
temperature: parseFloat(temperature),
|
||||||
modelName,
|
modelName,
|
||||||
openAIApiKey: 'sk-'
|
openAIApiKey: 'sk-'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ class AzureOpenAI_LLMs implements INode {
|
|||||||
const streaming = nodeData.inputs?.streaming as boolean
|
const streaming = nodeData.inputs?.streaming as boolean
|
||||||
|
|
||||||
const obj: Partial<AzureOpenAIInput> & Partial<OpenAIInput> = {
|
const obj: Partial<AzureOpenAIInput> & Partial<OpenAIInput> = {
|
||||||
temperature: parseInt(temperature, 10),
|
temperature: parseFloat(temperature),
|
||||||
modelName,
|
modelName,
|
||||||
azureOpenAIApiKey,
|
azureOpenAIApiKey,
|
||||||
azureOpenAIApiInstanceName,
|
azureOpenAIApiInstanceName,
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ class Cohere_LLMs implements INode {
|
|||||||
|
|
||||||
if (maxTokens) obj.maxTokens = parseInt(maxTokens, 10)
|
if (maxTokens) obj.maxTokens = parseInt(maxTokens, 10)
|
||||||
if (modelName) obj.model = modelName
|
if (modelName) obj.model = modelName
|
||||||
if (temperature) obj.temperature = parseInt(temperature, 10)
|
if (temperature) obj.temperature = parseFloat(temperature)
|
||||||
|
|
||||||
const model = new Cohere(obj)
|
const model = new Cohere(obj)
|
||||||
return model
|
return model
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ class HuggingFaceInference_LLMs implements INode {
|
|||||||
apiKey
|
apiKey
|
||||||
}
|
}
|
||||||
|
|
||||||
if (temperature) obj.temperature = parseInt(temperature, 10)
|
if (temperature) obj.temperature = parseFloat(temperature)
|
||||||
if (maxTokens) obj.maxTokens = parseInt(maxTokens, 10)
|
if (maxTokens) obj.maxTokens = parseInt(maxTokens, 10)
|
||||||
if (topP) obj.topP = parseInt(topP, 10)
|
if (topP) obj.topP = parseInt(topP, 10)
|
||||||
if (hfTopK) obj.topK = parseInt(hfTopK, 10)
|
if (hfTopK) obj.topK = parseInt(hfTopK, 10)
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ class OpenAI_LLMs implements INode {
|
|||||||
const basePath = nodeData.inputs?.basepath as string
|
const basePath = nodeData.inputs?.basepath as string
|
||||||
|
|
||||||
const obj: Partial<OpenAIInput> & { openAIApiKey?: string } = {
|
const obj: Partial<OpenAIInput> & { openAIApiKey?: string } = {
|
||||||
temperature: parseInt(temperature, 10),
|
temperature: parseFloat(temperature),
|
||||||
modelName,
|
modelName,
|
||||||
openAIApiKey,
|
openAIApiKey,
|
||||||
streaming: streaming ?? true
|
streaming: streaming ?? true
|
||||||
|
|||||||
Reference in New Issue
Block a user