fix: temperature convert to float

This commit is contained in:
Jeffrey-Wang
2023-06-29 21:23:21 +08:00
parent 7a8db1dff3
commit 184a783847
8 changed files with 8 additions and 8 deletions
@@ -124,7 +124,7 @@ class AzureChatOpenAI_ChatModels implements INode {
const streaming = nodeData.inputs?.streaming as boolean
const obj: Partial<AzureOpenAIInput> & Partial<OpenAIBaseInput> = {
temperature: parseInt(temperature, 10),
temperature: parseFloat(temperature),
modelName,
azureOpenAIApiKey,
azureOpenAIApiInstanceName,
@@ -120,7 +120,7 @@ class ChatAnthropic_ChatModels implements INode {
const streaming = nodeData.inputs?.streaming as boolean
const obj: Partial<AnthropicInput> & { anthropicApiKey?: string } = {
temperature: parseInt(temperature, 10),
temperature: parseFloat(temperature),
modelName,
anthropicApiKey,
streaming: streaming ?? true
@@ -89,7 +89,7 @@ class ChatHuggingFace_ChatModels implements INode {
apiKey
}
if (temperature) obj.temperature = parseInt(temperature, 10)
if (temperature) obj.temperature = parseFloat(temperature)
if (maxTokens) obj.maxTokens = parseInt(maxTokens, 10)
if (topP) obj.topP = parseInt(topP, 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 obj: Partial<OpenAIChatInput> & { openAIApiKey?: string } = {
temperature: parseInt(temperature, 10),
temperature: parseFloat(temperature),
modelName,
openAIApiKey: 'sk-'
}