fix(OpenAI Chat Model Node): Respect baseURL override for /models (#10076)

This commit is contained in:
oleg
2024-07-17 08:25:16 +02:00
committed by GitHub
parent 09f2cf9eaf
commit e5dda5731d
5 changed files with 304 additions and 4 deletions

View File

@@ -97,6 +97,18 @@ export class LmOpenAi implements INodeType {
},
},
},
{
displayName:
'When using non OpenAI models via Base URL override, not all models might be chat-compatible or support other features, like tools calling or JSON response format.',
name: 'notice',
type: 'notice',
default: '',
displayOptions: {
show: {
'/options.baseURL': [{ _cnd: { exists: true } }],
},
},
},
{
displayName: 'Options',
name: 'options',
@@ -198,7 +210,7 @@ export class LmOpenAi implements INodeType {
})) as { data: Array<{ owned_by: string; id: string }> };
for (const model of data) {
if (!model.owned_by?.startsWith('system')) continue;
if (!options.baseURL && !model.owned_by?.startsWith('system')) continue;
results.push({
name: model.id,
value: model.id,