Repository navigation
Conversation
…custom tools Add gemini-4-carbon, gemini-4-hydrogen, gemini-4-neon and gemini-3.1-pro-preview-customtools to GEMINI_MODELS and every per-model map. Give gemini-4-argon its reasoning levels and combined tools + schema support (TanStack#2119), and update its price to $4 / $20. Sources: Google's Gemini 4 model pages on Vertex AI and models.dev. Closes TanStack#2292 Closes TanStack#2119 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 2211519 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
Thanks for the PR, @jperasmus! 🙌 @jherr will take a look. Automated pre-review checks
Automated triage — a human review follows. |
You can now use Gemini 4 Carbon (
gemini-4-carbon), Gemini 4 Hydrogen (gemini-4-hydrogen), Gemini 4 Neon (gemini-4-neon) and the Gemini 3.1 Pro custom tools endpoint (gemini-3.1-pro-preview-customtools) withgeminiText.chat({ reasoning })now works ongemini-4-argontoo.Closes #2292. Closes #2119.
Why these models exist
The reply on #2292 found no Carbon, Hydrogen or Neon in the gateway catalogs under
scripts/. Those catalogs don't list them yet, but Google does:LOW,MEDIUM(default),HIGH.LOW,MEDIUM,HIGH(default),XHIGH.LOW,MEDIUM,HIGH(default),XHIGH.LOW,MEDIUM(default),HIGH.gemini-3.1-pro-preview-customtoolsas its custom tools endpoint, priced the same as Gemini 3.1 Pro.googleandgoogle-vertex, with prices, limits and a2026-03knowledge cutoff.🎯 Changes
Three new Gemini 4 models. Each copies the shape of
gemini-4-argon: the same inputs, capabilities and built-in tools. Prices and limits come from models.dev'sgoogleentries:gemini-4-carbongemini-4-hydrogengemini-4-neongemini-3.1-pro-preview-customtools. A copy ofgemini-3.1-pro-previewunder the custom tools id.gemini-4-argon(ai-gemini: gemini-4-argon has no reasoning metadata #2119).reasoning: EFFORT_LOW_TO_HIGH, sochat({ reasoning })sendsthinkingConfig.thinkingLevel.GEMINI_COMBINED_TOOLS_AND_SCHEMA_MODELS.Reasoning on the new models. Every Gemini 4 model gets
low,medium,high. Google also listsXHIGHfor Hydrogen and Neon, but@google/genai'sThinkingLevelhas noXHIGHvalue yet, so I left it out. It can be added once the SDK has it.Combined tools and schema. All new models join
GEMINI_COMBINED_TOOLS_AND_SCHEMA_MODELS.Tests.
model-meta.test.tschecks that each new model is registered, takes combined tools and schema, has the expected options and input types, and reasons atlow,medium,high.reasoning-request.test.tschecks that each Gemini 4 model sendsthinkingLevel.Docs.
docs/adapters/gemini.mdlists the new ids in the reasoning table and the models table.Changeset. One patch changeset for
@tanstack/ai-gemini.✅ Checklist
pnpm run test:pr, or these tests do not apply to this pull request.docs/for this change, or this change is not user-facing.pnpm changeset), or this PR does not change a published package.🚀 Release Impact
Testing
Commands run
nx run @tanstack/ai-gemini:build: passed.packages/ai-gemini:vitest run(552 tests) andtscpassed.oxlintshowed only warnings that were already there.vitest run scripts/model-sync,pnpm run test:docs(link check) andoxfmt --checkon the changed files: passed.pnpm run test:pr: passed (525 Nx tasks, thentest:dts: no dangling.d.ts).Manual test
pnpm --filter @tanstack/ai-gemini exec vitest run tests/model-meta.test.ts tests/reasoning-request.test.ts.geminiText('gemini-4-neon'). It type-checks now; onmainit does not.Risk / rollback
Low. The PR adds ids and model entries, so code that type-checks today still type-checks. Argon's
chat({ reasoning })now sendsthinkingConfig, where before it sent nothing. To undo it, revert the PR.Public API change
Before
After
🤖 Generated with Claude Code
Summary by CodeRabbit