diff --git a/src/lib/models/providers/openai.ts b/src/lib/models/providers/openai.ts index 7e56b5a..6055b34 100644 --- a/src/lib/models/providers/openai.ts +++ b/src/lib/models/providers/openai.ts @@ -148,7 +148,7 @@ class OpenAIProvider extends BaseModelProvider { async loadChatModel(key: string): Promise { const modelList = await this.getModelList(); - const exists = modelList.chat.filter((m) => m.key === key); + const exists = modelList.chat.find((m) => m.key === key); if (!exists) { throw new Error( @@ -168,8 +168,7 @@ class OpenAIProvider extends BaseModelProvider { async loadEmbeddingModel(key: string): Promise { const modelList = await this.getModelList(); - - const exists = modelList.chat.filter((m) => m.key === key); + const exists = modelList.embedding.find((m) => m.key === key); if (!exists) { throw new Error(