fix(ai): correct thinking budget for 2.5-flash-lite models (#2861)
The 2.5-flash-lite model was incorrectly matching the 2.5-flash case, setting minimal budget to 128. Per Google's docs, flash-lite's minimum thinking budget is 512, not 128. This caused the error: The thinking budget 128 is invalid. Please choose a value between 512 and 24576. Add a dedicated 2.5-flash-lite case before the 2.5-flash case so the more specific match takes priority. Fixes #2838 Co-authored-by: JasonOA888 <JasonOA888@users.noreply.github.com>
This commit is contained in:
@@ -462,6 +462,16 @@ function getGoogleBudget(
|
|||||||
return budgets[effort];
|
return budgets[effort];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (model.id.includes("2.5-flash-lite")) {
|
||||||
|
const budgets: Record<ClampedThinkingLevel, number> = {
|
||||||
|
minimal: 512,
|
||||||
|
low: 2048,
|
||||||
|
medium: 8192,
|
||||||
|
high: 24576,
|
||||||
|
};
|
||||||
|
return budgets[effort];
|
||||||
|
}
|
||||||
|
|
||||||
if (model.id.includes("2.5-flash")) {
|
if (model.id.includes("2.5-flash")) {
|
||||||
const budgets: Record<ClampedThinkingLevel, number> = {
|
const budgets: Record<ClampedThinkingLevel, number> = {
|
||||||
minimal: 128,
|
minimal: 128,
|
||||||
|
|||||||
Reference in New Issue
Block a user