diff --git a/packages/@n8n/nodes-langchain/nodes/llms/LMChatOpenAi/LmChatOpenAi.node.ts b/packages/@n8n/nodes-langchain/nodes/llms/LMChatOpenAi/LmChatOpenAi.node.ts index 1f39c082290e45..bcd2e7680d5af9 100644 --- a/packages/@n8n/nodes-langchain/nodes/llms/LMChatOpenAi/LmChatOpenAi.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/llms/LMChatOpenAi/LmChatOpenAi.node.ts @@ -94,6 +94,7 @@ export class LmChatOpenAi implements INodeType { // 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('ft:') || ($responseItem.id.startsWith('gpt-') && !$responseItem.id.includes('instruct')) }}`, }, diff --git a/packages/@n8n/nodes-langchain/nodes/vendors/OpenAi/methods/listSearch.ts b/packages/@n8n/nodes-langchain/nodes/vendors/OpenAi/methods/listSearch.ts index 9aa3633d453a13..cce0edeb41e78e 100644 --- a/packages/@n8n/nodes-langchain/nodes/vendors/OpenAi/methods/listSearch.ts +++ b/packages/@n8n/nodes-langchain/nodes/vendors/OpenAi/methods/listSearch.ts @@ -76,7 +76,10 @@ export async function modelSearch( this: ILoadOptionsFunctions, filter?: string, ): Promise { - return await getModelSearch((model) => model.id.startsWith('gpt-'))(this, filter); + return await getModelSearch((model) => model.id.startsWith('gpt-') || model.id.startsWith('ft:'))( + this, + filter, + ); } export async function imageModelSearch(