feat: support basePath

This commit is contained in:
微笑
2023-06-06 16:50:11 +08:00
parent c261eb506c
commit 1a35bad434
3 changed files with 31 additions and 3 deletions
@@ -106,6 +106,13 @@ class OpenAI_LLMs implements INode {
type: 'number',
optional: true,
additionalParams: true
},
{
label: 'BasePath',
name: 'basepath',
type: 'string',
optional: true,
additionalParams: true
}
]
}
@@ -122,6 +129,7 @@ class OpenAI_LLMs implements INode {
const batchSize = nodeData.inputs?.batchSize as string
const bestOf = nodeData.inputs?.bestOf as string
const streaming = nodeData.inputs?.streaming as boolean
const basePath = nodeData.inputs?.basepath as string
const obj: Partial<OpenAIInput> & { openAIApiKey?: string } = {
temperature: parseInt(temperature, 10),
@@ -138,7 +146,9 @@ class OpenAI_LLMs implements INode {
if (batchSize) obj.batchSize = parseInt(batchSize, 10)
if (bestOf) obj.bestOf = parseInt(bestOf, 10)
const model = new OpenAI(obj)
const model = new OpenAI(obj, {
basePath
})
return model
}
}