1
0
Fork 0
mirror of https://github.com/n8n-io/n8n.git synced 2025-03-05 20:50:17 -08:00

feat(OpenAI Node): Include O1 models in the models select ()

This commit is contained in:
oleg 2024-09-12 21:09:59 +02:00 committed by GitHub
parent 53c0fb18bf
commit b2b1abc531
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 4 deletions
packages/@n8n/nodes-langchain/nodes
llms/LMChatOpenAi
vendors/OpenAi/methods

View file

@ -95,6 +95,7 @@ export class LmChatOpenAi implements INodeType {
pass: `={{
($parameter.options?.baseURL && !$parameter.options?.baseURL?.includes('api.openai.com')) ||
$responseItem.id.startsWith('ft:') ||
$responseItem.id.startsWith('o1') ||
($responseItem.id.startsWith('gpt-') && !$responseItem.id.includes('instruct'))
}}`,
},

View file

@ -76,10 +76,10 @@ export async function modelSearch(
this: ILoadOptionsFunctions,
filter?: string,
): Promise<INodeListSearchResult> {
return await getModelSearch((model) => model.id.startsWith('gpt-') || model.id.startsWith('ft:'))(
this,
filter,
);
return await getModelSearch(
(model) =>
model.id.startsWith('gpt-') || model.id.startsWith('ft:') || model.id.startsWith('o1'),
)(this, filter);
}
export async function imageModelSearch(