fix(OpenAI Chat Model Node): Prevent filtering of fine-tuned models in model selector (#10662)

This commit is contained in:
oleg 2024-09-09 11:12:22 +02:00 committed by GitHub
parent e9b8d99084
commit 4e89912588
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View file

@ -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'))
}}`,
},

View file

@ -76,7 +76,10 @@ export async function modelSearch(
this: ILoadOptionsFunctions,
filter?: string,
): Promise<INodeListSearchResult> {
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(