Skip to content

Conversation

@rlazo
Copy link
Collaborator

@rlazo rlazo commented Dec 11, 2025

Gemini 3 models support thinking levels, an alternative to thinking budgets. They are preset values that can use to limit how many tokens are dedicated to the thinking process.

The thinking documentation gives more details.

Gemini 2.5 series models and newer utilize a thinking process before
generating a response. Thinking levels are an alternative to thinking
budgets as they are preset values that Gemini 3 models can use to
limit how many tokens are dedicated to the thinking process.

The [thinking
documentation](https://firebase.google.com/docs/ai-logic/thinking)
gives more details.
@gemini-code-assist
Copy link
Contributor

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 11, 2025

📝 PRs merging into main branch

Our main branch should always be in a releasable state. If you are working on a larger change, or if you don't want this change to see the light of the day just yet, consider using a feature branch first, and only merge into the main branch when the code complete and ready to be released.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Dec 11, 2025

@google-oss-bot
Copy link
Contributor

The public api surface has changed for the subproject firebase-ai:
error: Added method com.google.firebase.ai.type.ThinkingConfig.Builder.setThinkingLevel(com.google.firebase.ai.type.ThinkingLevel) [AddedMethod]
error: Added class com.google.firebase.ai.type.ThinkingLevel [AddedClass]

Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Dec 11, 2025

Size Report 1

Affected Products

  • firebase-ai

    TypeBase (bc2bc5c)Merge (3d15042)Diff
    aar1.11 MB1.11 MB+5.59 kB (+0.5%)
    apk (aggressive)1.71 MB1.71 MB+3.26 kB (+0.2%)
    apk (release)11.0 MB11.0 MB+4.62 kB (+0.0%)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/knnoIZQCjg.html

@google-oss-bot
Copy link
Contributor

The public api surface has changed for the subproject firebase-ai:
error: Added method com.google.firebase.ai.type.ThinkingConfig.Builder.setThinkingLevel(com.google.firebase.ai.type.ThinkingLevel) [AddedMethod]
error: Added class com.google.firebase.ai.type.ThinkingLevel [AddedClass]

Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly.

Comment on lines 56 to 57
if (thinkingLevel != null)
throw IllegalArgumentException("Cannot set both `thinkingBudget` and `thinkingLevel`")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's simpler to perform this check in the build() function once, rather than twice (one in each setter):

public fun build(): ThinkingConfig {
  if (thinkingLevel != null && thinkingBudget != null) {
    throw IllegalArgumentException("Cannot set both `thinkingBudget` and `thinkingLevel` in the same request")
  }
  ThinkingConfig(
    thinkingBudget = thinkingBudget,
    includeThoughts = includeThoughts,
    thinkingLevel = thinkingLevel
  )
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it would be simpler. On the other hand, by having the check duplicated on the method, any exception will pin point directly to the offending line, which makes devs life easier. WDYT?

I think the duplication balances out with the benefit. If you feel strongly around this, I can update the code.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, good point about pinpointing the exact line.
I have no strong preference.

@rlazo rlazo requested a review from thatfiredev December 16, 2025 10:29
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.

3 participants