File tree 1 file changed +8
-2
lines changed
packages/components/nodes/chatmodels/ChatLitellm
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -107,19 +107,25 @@ class ChatLitellm_ChatModels implements INode {
107
107
const credentialData = await getCredentialData ( nodeData . credential ?? '' , options )
108
108
const apiKey = getCredentialParam ( 'litellmApiKey' , credentialData , nodeData )
109
109
110
- const obj : Partial < OpenAIChatInput > & BaseLLMParams & { openAIApiKey ?: string } = {
110
+ const obj : Partial < OpenAIChatInput > & BaseLLMParams & { openAIApiKey ?: string } & { configuration ?: { baseURL ?: string ; defaultHeaders ?: ICommonObject } } = {
111
111
temperature : parseFloat ( temperature ) ,
112
112
modelName,
113
113
streaming : streaming ?? true
114
114
}
115
115
116
+ if ( basePath ) {
117
+ obj . configuration = {
118
+ baseURL : basePath
119
+ }
120
+ }
121
+
116
122
if ( maxTokens ) obj . maxTokens = parseInt ( maxTokens , 10 )
117
123
if ( topP ) obj . topP = parseFloat ( topP )
118
124
if ( timeout ) obj . timeout = parseInt ( timeout , 10 )
119
125
if ( cache ) obj . cache = cache
120
126
if ( apiKey ) obj . openAIApiKey = apiKey
121
127
122
- const model = new ChatOpenAI ( obj , { basePath } )
128
+ const model = new ChatOpenAI ( obj )
123
129
124
130
return model
125
131
}
You can’t perform that action at this time.
0 commit comments