From bda3a5f317327ee466f541b22d00b62bb5bd0bbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=97=8D+85CD?= <50108258+kwaa@users.noreply.github.com> Date: Fri, 17 Oct 2025 16:12:08 +0800 Subject: [PATCH] fix(openai-compatible-builder): ignore embed & gemini-2.5-pro model (#658) --- .../stores/providers/openai-compatible-builder.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/stage-ui/src/stores/providers/openai-compatible-builder.ts b/packages/stage-ui/src/stores/providers/openai-compatible-builder.ts index 47f50af90..897b103b1 100644 --- a/packages/stage-ui/src/stores/providers/openai-compatible-builder.ts +++ b/packages/stage-ui/src/stores/providers/openai-compatible-builder.ts @@ -122,7 +122,19 @@ export function buildOpenAICompatibleProvider( Authorization: `Bearer ${apiKey}`, }, }) - if (models && models.length > 0) + .then(models => models.filter(model => + [ + // exclude embedding models + 'embed', + // exclude tts models, specifically for OpenAI + 'tts', + // bypass gemini pro quota + // TODO: more elegant solution + 'gemini-2.5-pro', + ].every(str => !model.id.includes(str)), + )) + + if (models.length > 0) model = models[0].id } catch (e) {