Skip to content

Conversation

mcndt
Copy link

@mcndt mcndt commented Oct 13, 2025

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:

  • Gemini 2.5 Flash
  • Gemini 2.5 Flash (September 2025 Preview)
  • Gemini 2.5 Flash Lite
  • Gemini 2.5 Flash Lite (September 2025 Preview)
  • Gemini 2.5 Pro

test plan

Works out of the box with the Google GenAI client.

Copy link

changeset-bot bot commented Oct 13, 2025

🦋 Changeset detected

Latest commit: 4567949

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

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

Copy link
Contributor

@greptile-apps greptile-apps bot left a 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, and gemini-2.5-pro
  • Mapped all new models to the google provider in modelToProviderMap
  • 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
Loading

2 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@miguelg719
Copy link
Collaborator

hey @mcndt , thanks for the contrib! Before merging, can you try set the modelName to google/<2.5-family-modelname> and see if it works/supports your config? We're adopting AI SDK more for LLM inference to avoid custom client maintenance

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.

2 participants