Skip to content

fix(gemini): Only include thinkingLevel if thinkingBudget is unset#7

Merged
Tom-Ryder merged 1 commit intoTom-Ryder:mainfrom
subpop:gemini-thinking-budget
Mar 28, 2026
Merged

fix(gemini): Only include thinkingLevel if thinkingBudget is unset#7
Tom-Ryder merged 1 commit intoTom-Ryder:mainfrom
subpop:gemini-thinking-budget

Conversation

@subpop
Copy link
Copy Markdown
Contributor

@subpop subpop commented Mar 28, 2026

If a request contains both thinkingLevel and thinkingBudget, the Gemini API returns an HTTP 400. This fix degrades the thinking config to prefer a token budget, falling back to a thinking level value only if the budget is not provided. gemini-2.5-pro doesn't support thinkingLevel, only gemini-3-pro-preview, so the library should have some way to support both.

@Tom-Ryder Tom-Ryder merged commit 2dc9ebd into Tom-Ryder:main Mar 28, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants