fix: add google provider model transform for gemini-3-flash/pro preview suffix

transformModelForProvider only handled github-copilot provider, leaving
google provider models untransformed. This caused ProviderModelNotFoundError
when google/gemini-3-flash was sent to the API (correct ID is
gemini-3-flash-preview).

Add google provider block with -preview suffix guard to prevent double
transformation.
This commit is contained in:
once
2026-02-17 21:15:38 +09:00
committed by YeonGyu-Kim
parent 4b09428d7b
commit a2e51ea51f
3 changed files with 219 additions and 44 deletions
+8
View File
@@ -8,5 +8,13 @@ export function transformModelForProvider(provider: string, model: string): stri
.replace("gemini-3-pro", "gemini-3-pro-preview")
.replace("gemini-3-flash", "gemini-3-flash-preview")
}
if (provider === "google") {
if (!model.endsWith("-preview")) {
return model
.replace("gemini-3-pro", "gemini-3-pro-preview")
.replace("gemini-3-flash", "gemini-3-flash-preview")
}
return model
}
return model
}