fix(ai): support gemini-3.1 flash-lite and thinking matching

closes #1785
This commit is contained in:
Mario Zechner
2026-03-04 20:17:58 +01:00
parent e64cd15c25
commit 2af0c98b5f
5 changed files with 54 additions and 8 deletions

View File

@@ -416,11 +416,11 @@ function buildParams(
type ClampedThinkingLevel = Exclude<PiThinkingLevel, "xhigh">;
function isGemini3ProModel(model: Model<"google-generative-ai">): boolean {
return model.id.includes("3-pro");
return /gemini-3(?:\.\d+)?-pro/.test(model.id.toLowerCase());
}
function isGemini3FlashModel(model: Model<"google-generative-ai">): boolean {
return model.id.includes("3-flash");
return /gemini-3(?:\.\d+)?-flash/.test(model.id.toLowerCase());
}
function getGemini3ThinkingLevel(

View File

@@ -386,11 +386,11 @@ function buildParams(
type ClampedThinkingLevel = Exclude<ThinkingLevel, "xhigh">;
function isGemini3ProModel(model: Model<"google-generative-ai">): boolean {
return model.id.includes("3-pro");
return /gemini-3(?:\.\d+)?-pro/.test(model.id.toLowerCase());
}
function isGemini3FlashModel(model: Model<"google-generative-ai">): boolean {
return model.id.includes("3-flash");
return /gemini-3(?:\.\d+)?-flash/.test(model.id.toLowerCase());
}
function getGemini3ThinkingLevel(