Skip to content

Add support for Gemini 3 models#8

Open
mzazakeith wants to merge 2 commits into
developfrom
feat/gemini-3-support-18165654933649868291
Open

Add support for Gemini 3 models#8
mzazakeith wants to merge 2 commits into
developfrom
feat/gemini-3-support-18165654933649868291

Conversation

@mzazakeith
Copy link
Copy Markdown
Owner

@mzazakeith mzazakeith commented Mar 19, 2026

Added support for the latest Gemini 3 models: Gemini 3.1 Pro Preview, Gemini 3.1 Flash Lite Preview, and Gemini 3 Flash Preview. Updated configuration validation, API call parameters (setting thinkingLevel to 'minimal' for high-volume efficiency), and README documentation.


PR created automatically by Jules for task 18165654933649868291 started by @mzazakeith

Summary by CodeRabbit

  • New Features

    • Added support for three new Gemini models: gemini-3.1-pro-preview, gemini-3.1-flash-lite-preview and gemini-3-flash-preview. Model-specific configurations have been optimised.
  • Documentation

    • Updated model configuration docs to recommend gemini-3.1-pro-preview for enhanced reasoning and removed older gemini-1.5 entries.

- Add gemini-3.1-pro-preview, gemini-3.1-flash-lite-preview, and gemini-3-flash-preview to supported models in config.ts
- Update gemini.ts to use thinkingLevel: 'minimal' for Gemini 3 models for fast commit message generation
- Update README.md to include new Gemini 3 models and descriptions
@google-labs-jules
Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 19, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 29e4ff9e-7ce9-40ce-961a-85a720dab9ad

📥 Commits

Reviewing files that changed from the base of the PR and between 10207b8 and fab7519.

📒 Files selected for processing (3)
  • README.md
  • src/utils/config.ts
  • src/utils/gemini.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/utils/config.ts
  • src/utils/gemini.ts

Walkthrough

Added three Gemini model variants to the supported list, removed older Gemini 1.5 entries, updated README recommendation, and added model-based thinkingConfig overrides that set thinkingLevel to "low" for gemini-3 pro models and "minimal" for other gemini-3 models.

Changes

Cohort / File(s) Summary
Documentation
README.md
Updated supported-models list: added gemini-3.1-pro-preview, gemini-3.1-flash-lite-preview, gemini-3-flash-preview; removed gemini-1.5-flash, gemini-1.5-pro; changed recommended model tip to gemini-3.1-pro-preview.
Config validation
src/utils/config.ts
Expanded supportedModels whitelist to include the three new Gemini 3 variants and removed the Gemini 1.5 entries; validation/error message now reflects the updated set.
Generation logic
src/utils/gemini.ts
Added conditional merge to request config: for model names starting with gemini-3, set thinkingConfig{ thinkingLevel: 'low' } if name includes pro, otherwise { thinkingLevel: 'minimal' }; retains existing 2.5+flash override.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Feature/gemini support #2: Modifies the same Gemini model whitelist and thinkingConfig logic in src/utils/config.ts and src/utils/gemini.ts.

Poem

🐰 I hopped through docs and code tonight,

Three Geminis gleam in new moonlight,
Pro ones ponder with low, calm cheer,
The others nibble minimal thought near,
A tiny config dance — hop, hooray! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main objective of the changeset: adding support for Gemini 3 models.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/gemini-3-support-18165654933649868291
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can suggest fixes for GitHub Check annotations.

Configure the reviews.tools.github-checks setting to adjust the time to wait for GitHub Checks to complete.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/utils/gemini.ts`:
- Around line 57-58: The added thinkingConfig with thinkingLevel is incompatible
with the pinned `@google/genai` types; inspect package.json for the pinned
`@google/genai` version and either (A) upgrade `@google/genai` to a version that
defines GenerateContentConfig.thinkingConfig.thinkingLevel and run npm/yarn
install, or (B) keep the pinned SDK and remove/replace thinkingLevel in
src/utils/gemini.ts (the branch that checks model.startsWith('gemini-3')) with
only supported properties (e.g., thinkingBudget) so the config object matches
the GenerateContentConfig typing; verify by searching for
thinkingConfig/thinkingLevel/thinkingBudget usages and running TypeScript build
to confirm TS2322 is resolved.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b7128ae1-5c0f-4344-be29-8f4b5148114b

📥 Commits

Reviewing files that changed from the base of the PR and between 77ef2d1 and 10207b8.

📒 Files selected for processing (3)
  • README.md
  • src/utils/config.ts
  • src/utils/gemini.ts

Comment thread src/utils/gemini.ts Outdated
Comment on lines +57 to +58
...(model.includes('2.5') && model.toLowerCase().includes('flash') ? { thinkingConfig: { thinkingBudget: 0 } } : {}),
...(model.startsWith('gemini-3') ? { thinkingConfig: { thinkingLevel: 'minimal' } } : {}),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Build blocker: thinkingConfig shape is not compatible with current SDK typings.

Line 58 introduces thinkingLevel, and CI already fails with TS2322 on the config object. Please align this with the @google/genai version in the repo (either upgrade SDK/types to one that supports thinkingLevel, or use a supported thinkingConfig field for the pinned version).

#!/bin/bash
set -euo pipefail

# 1) Print pinned `@google/genai` version from repo config
python - <<'PY'
import json
with open('package.json') as f:
    p = json.load(f)
deps = {}
deps.update(p.get('dependencies', {}))
deps.update(p.get('devDependencies', {}))
print("Pinned `@google/genai`:", deps.get('@google/genai', 'NOT_FOUND'))
PY

# 2) Confirm all thinkingConfig usages in source
rg -n -C3 'thinkingConfig|thinkingLevel|thinkingBudget' src
For the exact `@google/genai` version pinned in this repository, what properties are allowed in GenerateContentConfig.thinkingConfig? Is thinkingLevel supported?
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/utils/gemini.ts` around lines 57 - 58, The added thinkingConfig with
thinkingLevel is incompatible with the pinned `@google/genai` types; inspect
package.json for the pinned `@google/genai` version and either (A) upgrade
`@google/genai` to a version that defines
GenerateContentConfig.thinkingConfig.thinkingLevel and run npm/yarn install, or
(B) keep the pinned SDK and remove/replace thinkingLevel in src/utils/gemini.ts
(the branch that checks model.startsWith('gemini-3')) with only supported
properties (e.g., thinkingBudget) so the config object matches the
GenerateContentConfig typing; verify by searching for
thinkingConfig/thinkingLevel/thinkingBudget usages and running TypeScript build
to confirm TS2322 is resolved.

- Added support for Gemini 3.1 Pro Preview, 3.1 Flash Lite Preview, and 3 Flash Preview
- Removed support for Gemini 1.5 Flash and 1.5 Pro models
- Implemented thinkingLevel: 'low' for Pro models and 'minimal' for Flash models to ensure optimal performance and cost-efficiency
- Updated README.md and config validation to reflect these changes
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.

1 participant