From 1d6f3dbf10343bb64f43205a2ec4eabbd44a4311 Mon Sep 17 00:00:00 2001 From: reanon <> Date: Tue, 6 May 2025 17:21:17 +0200 Subject: [PATCH] strip models/ --- src/proxy/google-ai.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/proxy/google-ai.ts b/src/proxy/google-ai.ts index eb2b26e..c0ed6d5 100644 --- a/src/proxy/google-ai.ts +++ b/src/proxy/google-ai.ts @@ -42,9 +42,11 @@ const getModelsResponse = () => { const modelIds = Array.from( new Set(keys.map((k) => k.modelIds).flat()) ).filter((id) => id.startsWith("models/") && !id.includes("bard")); - + + // Strip "models/" prefix from IDs before creating model objects const models = modelIds.map((id) => ({ - id, + // Strip "models/" prefix from ID for consistency with request processing + id: id.startsWith("models/") ? id.slice("models/".length) : id, object: "model", created: new Date().getTime(), owned_by: "google",