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

@@ -90,7 +90,11 @@ export class LmChatOpenAi implements INodeType {
{
type: 'filter',
properties: {
pass: "={{ $responseItem.id.startsWith('gpt-') && !$responseItem.id.includes('instruct') }}",
// If the baseURL is not set or is set to api.openai.com, include only chat models
pass: `={{
($parameter.options?.baseURL && !$parameter.options?.baseURL?.includes('api.openai.com')) ||
($responseItem.id.startsWith('gpt-') && !$responseItem.id.includes('instruct'))
}}`,
},
},
{
@@ -119,6 +123,18 @@ export class LmChatOpenAi implements INodeType {
},
default: 'gpt-3.5-turbo',
},
{
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',