Skip to content

Conversation

@hsubox76
Copy link
Contributor

Add thinking levels feature.

API proposal (internal): https://docs.google.com/document/d/16cdWurhdLDuNIDj0eJWNnL00any0tL_DjI-lAg7miP8/edit?tab=t.0

Added the param, plus an error if both thinkingLevel and thinkingBudget are set. This validation function may be used in the future to validate other common config issues.

Docs notes:

  • Copied text of documentation from Swift comments in API proposal doc (see above)
  • Some of the "removed" text in the md files is actually just removing them from the toc table at the top of the page, where they are unnecessary, and most of the text still remains in the entries below.

@changeset-bot
Copy link

changeset-bot bot commented Dec 12, 2025

🦋 Changeset detected

Latest commit: 101059f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@firebase/ai Minor
firebase Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @hsubox76, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the AI model configuration by introducing a thinkingLevel parameter, offering a simplified way to control the model's internal reasoning process. It ensures proper configuration through client-side validation and provides comprehensive documentation for the new feature.

Highlights

  • New thinkingLevel Parameter: Introduced a new thinkingLevel parameter within ThinkingConfig to allow users to specify a preset level for the model's 'thinking' process, with options like MINIMAL, LOW, MEDIUM, and HIGH.
  • Mutual Exclusivity Validation: Implemented client-side validation to prevent the simultaneous setting of both thinkingBudget and thinkingLevel in the GenerationConfig, throwing an AIErrorCode.UNSUPPORTED error if both are provided.
  • Documentation Updates: Updated API documentation and devsite markdown files to reflect the new ThinkingLevel type, its usage, and the updated ThinkingConfig interface, including notes on its interaction with thinkingBudget and model support.
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
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 12, 2025

Changeset File Check ✅

  • No modified packages are missing from the changeset file.
  • No changeset formatting errors detected.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces the thinkingLevel parameter to the thinkingConfig, providing users with presets to control the model's thinking process. The changes include updates to the ThinkingConfig interface, new type definitions for ThinkingLevel, and comprehensive documentation updates. A key addition is the client-side validation that prevents thinkingLevel and thinkingBudget from being set simultaneously, which is a great way to prevent invalid configurations. The associated test case for this validation is also well-implemented. Overall, the changes are solid. I have one minor suggestion to improve the readability of the validation logic.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Dec 12, 2025

Size Report 1

Affected Products

  • @firebase/ai

    TypeBase (bc2b2cd)Merge (532adcf)Diff
    browser67.4 kB67.8 kB+406 B (+0.6%)
    main71.7 kB72.2 kB+483 B (+0.7%)
    module67.4 kB67.8 kB+406 B (+0.6%)
  • @firebase/firestore

    TypeBase (bc2b2cd)Merge (532adcf)Diff
    browser391 kB393 kB+1.81 kB (+0.5%)
    main611 kB637 kB+25.9 kB (+4.2%)
    module391 kB393 kB+1.81 kB (+0.5%)
    react-native392 kB393 kB+1.74 kB (+0.4%)
  • @firebase/firestore-lite

    TypeBase (bc2b2cd)Merge (532adcf)Diff
    browser115 kB118 kB+2.78 kB (+2.4%)
    main158 kB169 kB+10.6 kB (+6.7%)
    module115 kB118 kB+2.78 kB (+2.4%)
    react-native116 kB118 kB+2.76 kB (+2.4%)
  • @firebase/firestore-lite-pipelines

    TypeBase (bc2b2cd)Merge (532adcf)Diff
    browser?112 kB? (?)
    main?212 kB? (?)
    module?112 kB? (?)
    react-native?112 kB? (?)
  • @firebase/firestore-pipelines

    TypeBase (bc2b2cd)Merge (532adcf)Diff
    browser?205 kB? (?)
    main?631 kB? (?)
    module?205 kB? (?)
    react-native?205 kB? (?)
  • bundle

    18 size changes

    TypeBase (bc2b2cd)Merge (532adcf)Diff
    firestore (CSI Auto Indexing Disable and Delete)286 kB287 kB+677 B (+0.2%)
    firestore (CSI Auto Indexing Enable)286 kB287 kB+677 B (+0.2%)
    firestore (Persistence)318 kB319 kB+657 B (+0.2%)
    firestore (Pipeline Query with lt filter (execute))?246 kB? (?)
    firestore (Pipeline Query with lt filter (useFirestorePipelines))?171 kB? (?)
    firestore (Pipeline Query with lt plus and function)?171 kB? (?)
    firestore (Query Cursors)257 kB258 kB+1.20 kB (+0.5%)
    firestore (Query)255 kB256 kB+1.21 kB (+0.5%)
    firestore (Read data once)245 kB245 kB+562 B (+0.2%)
    firestore (Read Write w Persistence)337 kB339 kB+1.06 kB (+0.3%)
    firestore (Realtime updates)245 kB246 kB+571 B (+0.2%)
    firestore (Transaction)223 kB224 kB+1.13 kB (+0.5%)
    firestore (Write data)224 kB225 kB+1.03 kB (+0.5%)
    firestore-lite (Query Cursors)110 kB112 kB+2.42 kB (+2.2%)
    firestore-lite (Query)106 kB108 kB+2.27 kB (+2.1%)
    firestore-lite (Read data once)81.6 kB83.1 kB+1.44 kB (+1.8%)
    firestore-lite (Transaction)107 kB109 kB+2.23 kB (+2.1%)
    firestore-lite (Write data)91.1 kB93.0 kB+1.94 kB (+2.1%)

  • firebase

    TypeBase (bc2b2cd)Merge (532adcf)Diff
    firebase-ai.js52.8 kB53.1 kB+312 B (+0.6%)
    firebase-compat.js809 kB810 kB+1.20 kB (+0.1%)
    firebase-firestore-compat.js348 kB349 kB+1.20 kB (+0.3%)
    firebase-firestore-lite-pipelines.js?124 kB? (?)
    firebase-firestore-lite.js138 kB139 kB+853 B (+0.6%)
    firebase-firestore-pipelines.js?506 kB? (?)
    firebase-firestore.js454 kB455 kB+1.32 kB (+0.3%)

Test Logs

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

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Dec 12, 2025

Size Analysis Report 1

This report is too large (1,080,564 characters) to be displayed here in a GitHub comment. Please use the below link to see the full report on Google Cloud Storage.

Test Logs

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

@hsubox76 hsubox76 marked this pull request as ready for review January 5, 2026 18:20
@hsubox76 hsubox76 requested review from a team as code owners January 5, 2026 18:20
@hsubox76 hsubox76 requested a review from DellaBitta January 5, 2026 18:22
If you don't specify a budget, the model will determine the appropriate amount of thinking based on the complexity of the prompt.
The range of supported thinking budget values depends on the model.

<ul> <li>To use the default thinking budget or thinking level for a model, leave this value undefined.</li>
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like this is describing thinkingBudget? If so, I'm not sure if we should be talking about thinking levels in this section?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed thinking levels from this sentence but kept the line below that says you cannot set both.


<li>To disable thinking, when supported by the model, set this value to `0`<!-- -->.</li>

<li>To use dynamic thinking, allowing the model to decide on the thinking budget based on the task, set this value to `-1`<!-- -->.</li> </ul>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<li>To use dynamic thinking, allowing the model to decide on the thinking budget based on the task, set this value to `-1`<!-- -->.</li> </ul>
<li>To use dynamic thinking, which allows the model to decide on the thinking budget based on the task, set this value to `-1`<!-- -->.</li> </ul>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

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.

4 participants