-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Support Gemini 2.5 model family with Google GenAI client #1129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 1fe80de 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Greptile Overview
Summary
Added support for the Gemini 2.5 model family (Flash, Flash Lite, Pro, and September 2025 preview variants) by extending the model schema and provider mappings. The new models integrate seamlessly with the existing Google GenAI client.
- Added 5 new model identifiers to
AvailableModelSchema:gemini-2.5-flash,gemini-2.5-flash-preview-09-2025,gemini-2.5-flash-lite,gemini-2.5-flash-lite-preview-09-2025, andgemini-2.5-pro - Mapped all new models to the
googleprovider inmodelToProviderMap - Included changeset documenting the patch-level version bump per repository requirements
Confidence Score: 5/5
- This PR is safe to merge with minimal risk
- The changes are straightforward model additions following established patterns. All new models are correctly added to both the schema enum and provider mapping in parallel. The GoogleClient already supports these models through the Google GenAI SDK. The PR includes proper changeset documentation as required.
- No files require special attention
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| .changeset/brown-dingos-teach.md | 5/5 | Added changeset documenting Gemini 2.5 model support - follows versioning requirements |
| types/model.ts | 5/5 | Added 5 new Gemini 2.5 model variants to the schema enum - clean addition with consistent naming |
| lib/llm/LLMProvider.ts | 5/5 | Mapped new Gemini 2.5 models to google provider - consistent with existing pattern |
Sequence Diagram
sequenceDiagram
participant User
participant Stagehand
participant LLMProvider
participant GoogleClient
participant GoogleGenAI
User->>Stagehand: Initialize with modelName: "gemini-2.5-flash"
Stagehand->>LLMProvider: getClient("gemini-2.5-flash")
LLMProvider->>LLMProvider: Check modelToProviderMap
Note over LLMProvider: Maps "gemini-2.5-flash" to "google"
LLMProvider->>GoogleClient: Create new GoogleClient
GoogleClient->>GoogleGenAI: Initialize with API key
GoogleClient-->>LLMProvider: Return client instance
LLMProvider-->>Stagehand: Return GoogleClient
User->>Stagehand: Perform action (act/extract/etc)
Stagehand->>GoogleClient: createChatCompletion()
GoogleClient->>GoogleGenAI: models.generateContent(modelName: "gemini-2.5-flash")
GoogleGenAI-->>GoogleClient: Return response
GoogleClient-->>Stagehand: Return formatted response
Stagehand-->>User: Return action result
2 files reviewed, no comments
|
hey @mcndt , thanks for the contrib! Before merging, can you try set the modelName to |
4567949 to
1fe80de
Compare
|
Rebased this branch on the 3.0.1 release |
|
@miguelg719 I verified that the model names would indeed be compatible with the AI SDK! |
why
I want to use the latest Gemini 2.5 models.
what changed
I updated the list of available models and mapping to model provider to include the following models:
test plan
Works out of the box with the Google GenAI client.