feat(llm): Gemini thinking_level/thinking_budget support for flash-thinking models#1710
Merged
feat(llm): Gemini thinking_level/thinking_budget support for flash-thinking models#1710
Conversation
…h-thinking models
Add GeminiThinkingLevel enum (Minimal/Low/Medium/High, lowercase serde),
GeminiThinkingConfig struct (thinkingLevel/thinkingBudget/includeThoughts,
camelCase per Gemini API spec), and wire into GeminiProvider at all three
construction sites (primary, orchestrator, router).
GeminiConfig gains thinking_level, thinking_budget, and include_thoughts
optional fields. with_thinking_budget() is fallible and validates the
value is in {-1} ∪ [0, 32768]. --init wizard adds a thinking_level
select prompt in the Gemini section.
Covers both Gemini 3+ (thinkingLevel string) and Gemini 2.5
(thinkingBudget integer) APIs. 19 new unit tests added (5359 total).
Closes #1652.
4e9c90c to
866aeb1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GeminiThinkingLevelenum (Minimal/Low/Medium/High, lowercase serde matching Gemini API) andGeminiThinkingConfigstruct (thinkingLevel/thinkingBudget/includeThoughts, camelCase) tozeph-llmGeminiProvidergains builder methodswith_thinking_level(),with_thinking_budget()(fallible, validates -1/0/1..=32768),with_include_thoughts()GeminiConfiginzeph-coregainsthinking_level,thinking_budget,include_thoughtsoptional fields--initwizard addsthinking_levelselect prompt in the Gemini sectionthinkingLevelstring) and Gemini 2.5 (thinkingBudgetinteger) APIsConfiguration
Test plan
ThinkingLevelserializes to correct lowercase strings (all 4 variants round-trip)GeminiThinkingConfigserializes with camelCase field namesskip_serializing_ifomitsthinking_configfrom JSON when all fields are Nonemake_gen_config()with_thinking_budget()rejects out-of-range values (-2, 32769) withLlmErrorGeminiConfig.thinking_level/thinking_budgetinzeph-coreCloses #1652.