Skip to content

Commit 1f56595

Browse files
committed
.
1 parent 92e53eb commit 1f56595

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

packages/components/nodes/chatmodels/ChatLitellm/ChatLitellm.ts

+8-2
Original file line numberDiff line numberDiff line change
@@ -107,19 +107,25 @@ class ChatLitellm_ChatModels implements INode {
107107
const credentialData = await getCredentialData(nodeData.credential ?? '', options)
108108
const apiKey = getCredentialParam('litellmApiKey', credentialData, nodeData)
109109

110-
const obj: Partial<OpenAIChatInput> & BaseLLMParams & { openAIApiKey?: string } = {
110+
const obj: Partial<OpenAIChatInput> & BaseLLMParams & { openAIApiKey?: string } & { configuration?: { baseURL?: string; defaultHeaders?: ICommonObject } } = {
111111
temperature: parseFloat(temperature),
112112
modelName,
113113
streaming: streaming ?? true
114114
}
115115

116+
if (basePath ) {
117+
obj.configuration = {
118+
baseURL: basePath
119+
}
120+
}
121+
116122
if (maxTokens) obj.maxTokens = parseInt(maxTokens, 10)
117123
if (topP) obj.topP = parseFloat(topP)
118124
if (timeout) obj.timeout = parseInt(timeout, 10)
119125
if (cache) obj.cache = cache
120126
if (apiKey) obj.openAIApiKey = apiKey
121127

122-
const model = new ChatOpenAI(obj, { basePath })
128+
const model = new ChatOpenAI(obj)
123129

124130
return model
125131
}

0 commit comments

Comments
 (0)