Uh oh!
There was an error while loading. Please reload this page.
Add current-generation Gemini models to AIModel and deprecate the 2.x members - #366
Merged
Conversation
… members
Google has withdrawn most of the Gemini 2.x generation. A `hint` naming one of
those models made `ai.prompt()` fail outright, and the speed/cost tiers that
resolve without a hint pointed at several of them too, so `{ speed: "capable",
cost: "high" }` and neighbouring tiers stopped working.
Adds `GEMINI_31_PRO`, `GEMINI_35_FLASH`, and `GEMINI_35_FLASH_LITE`, and marks
the `GEMINI_25_*` and `GEMINI_20_*` members deprecated. The deprecated members
are kept so twists built against an earlier SDK version still compile, and a
hint naming a withdrawn model is now served by its current equivalent instead
of erroring.
`GEMINI_25_FLASH` is deprecated but not remapped: it still works, and silently
substituting a model an author deliberately asked for would be worse than
letting it run until it is actually withdrawn.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y9GNwKEBkEAoLYzkTngfGk
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 freeto 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.
Google has withdrawn most of the Gemini 2.x generation. Calling one of those
models now returns
404 "no longer available to new users", which affected theAI tool in two ways:
hintnaming a withdrawn model failed the wholeai.prompt()call.speed/costtiers that resolve without a hint pointed atwithdrawn models, so
{ speed: "capable", cost: "high" }and neighbouringtiers stopped working even for twists that never named a model.
Worth knowing if you are checking your own pins: the model-listing endpoints are
not sufficient evidence here.
gemini-2.5-prois still returned by ListModels,and still advertises
generateContentinsupportedGenerationMethods, while anactual generation request 404s. Only a real call distinguishes the two.
Changes
Added —
AIModel.GEMINI_31_PRO,AIModel.GEMINI_35_FLASH, andAIModel.GEMINI_35_FLASH_LITE.Deprecated — the
GEMINI_25_*andGEMINI_20_*members. They are kept, notremoved, so twists built against an earlier SDK version still compile. A hint
naming a withdrawn model is now served by its current equivalent rather than
erroring.
GEMINI_25_FLASHis deprecated but deliberately not remapped: it stillworks, and silently substituting a model an author explicitly asked for would be
worse than letting it run until it is actually withdrawn.
The tiers that
ai.prompt()resolves without a hint have also moved onto currentmodels, so every
speed/costcombination works again.Compatibility
Additive. No member is removed or renamed, and no existing twist needs a change
to keep working — deprecated members still compile and now resolve to a live
model. New code should name a 3.x member.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Y9GNwKEBkEAoLYzkTngfGk