Skip to content

Conversation

jay-sahnan
Copy link
Contributor

why

what changed

test plan

Copy link

changeset-bot bot commented Oct 7, 2025

⚠️ No Changeset found

Latest commit: 122e1b0

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a 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

This PR updates the documentation to promote Google as the primary provider for Stagehand's computer use agents. The changes add Google to the supported AI providers list and comprehensively update all code examples throughout the agent documentation to use Google's `gemini-2.5-computer-use-preview` model instead of OpenAI or Anthropic models. This represents a strategic documentation shift to position Google as the recommended default provider while maintaining support for existing providers.

The changes integrate with Stagehand's existing multi-provider architecture that already supports OpenAI and Anthropic models. Based on the CHANGELOG context, Google Generative models support was added in version 2.1.0, and this PR appears to be updating the documentation to reflect improved capabilities or performance of Google's computer use models. The documentation now consistently shows Google provider examples with GOOGLE_API_KEY environment variable usage and the specialized computer use model.

PR Description Notes:

  • The PR description is empty with only template headers ("why", "what changed", "test plan") and no content
  • This makes it difficult to understand the motivation and testing approach for these changes

Important Files Changed

Changed Files
Filename Score Overview
docs/references/agent.mdx 5/5 Added Google as a supported provider option with documentation for gemini-2.5-computer-use-preview model
docs/basics/agent.mdx 5/5 Updated all code examples to use Google provider as the primary/default option instead of OpenAI/Anthropic

Confidence score: 5/5

  • This PR is safe to merge with minimal risk as it only contains documentation updates
  • Score reflects that these are purely additive documentation changes with no code modifications that could break functionality
  • No files require special attention as both changes are straightforward documentation updates

Sequence Diagram

sequenceDiagram
    participant User
    participant Stagehand
    participant Agent
    participant Browser
    participant AIProvider as "AI Provider (OpenAI/Anthropic/Google)"
    participant MCP as "MCP Services"

    User->>Stagehand: "new Stagehand(config)"
    Stagehand->>Stagehand: "init()"
    Stagehand->>Browser: "Launch browser instance"
    Browser-->>Stagehand: "Browser ready"

    User->>Stagehand: "agent(agentConfig)"
    Stagehand->>Agent: "Create agent instance"
    Agent->>AIProvider: "Initialize with model & instructions"
    AIProvider-->>Agent: "Provider ready"

    opt MCP Integrations
        Agent->>MCP: "Connect to MCP servers"
        MCP-->>Agent: "External tools available"
    end

    User->>Agent: "execute(instruction)"
    Agent->>Agent: "Parse instruction & context"
    Agent->>AIProvider: "Plan task execution"
    AIProvider-->>Agent: "Action plan"

    loop Until task complete or maxSteps reached
        Agent->>Browser: "Take screenshot (if autoScreenshot)"
        Browser-->>Agent: "Current page state"
        Agent->>AIProvider: "Analyze page & determine next action"
        AIProvider-->>Agent: "Next action decision"
        
        alt Browser Action
            Agent->>Browser: "Execute action (click/type/navigate)"
            Browser-->>Agent: "Action result"
        else External Tool Action
            Agent->>MCP: "Call external service"
            MCP-->>Agent: "Service response"
        end
        
        Agent->>Agent: "Check task completion"
        
        opt Wait between actions
            Agent->>Agent: "Wait (waitBetweenActions ms)"
        end
    end

    Agent->>Agent: "Compile execution results"
    Agent-->>User: "AgentResult with success, actions, metadata"
Loading

2 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@seanmcguire12 seanmcguire12 changed the title Elephant google cua docs Oct 7, 2025
@seanmcguire12 seanmcguire12 merged commit 9a29937 into main Oct 7, 2025
1 check passed
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