diff --git a/docs/basics/agent.mdx b/docs/basics/agent.mdx index e1abd828b..a0def7a60 100644 --- a/docs/basics/agent.mdx +++ b/docs/basics/agent.mdx @@ -30,16 +30,16 @@ There are two ways to create agents in Stagehand: ### Computer Use Agents -Use computer use agents with specialized models from OpenAI or Anthropic: +Use computer use agents with specialized models from OpenAI, Anthropic, or Google: ```typescript TypeScript const agent = stagehand.agent({ - provider: "anthropic", - model: "claude-sonnet-4-20250514", + provider: "google", + model: "gemini-2.5-computer-use-preview-10-2025", instructions: "You are a helpful assistant that can use a web browser.", options: { - apiKey: process.env.ANTHROPIC_API_KEY, + apiKey: process.env.GOOGLE_API_KEY, }, }); await agent.execute("apply for a job at Browserbase") @@ -47,11 +47,11 @@ await agent.execute("apply for a job at Browserbase") ```python Python agent = stagehand.agent({ - "provider": "anthropic", - "model": "claude-sonnet-4-20250514", + "provider": "google", + "model": "gemini-2.5-computer-use-preview-10-2025", "instructions": "You are a helpful assistant that can use a web browser.", "options": { - "apiKey": os.getenv("ANTHROPIC_API_KEY"), + "apiKey": os.getenv("GOOGLE_API_KEY"), }, }) await agent.execute("apply for a job at Browserbase") @@ -77,14 +77,14 @@ Agents can be enhanced with external tools and services through MCP (Model Conte ```typescript TypeScript (Pass URL) const agent = stagehand.agent({ - provider: "openai", - model: "computer-use-preview", + provider: "google", + model: "gemini-2.5-computer-use-preview-10-2025", integrations: [ `https://mcp.exa.ai/mcp?exaApiKey=${process.env.EXA_API_KEY}`, ], instructions: `You have access to web search through Exa. Use it to find current information before browsing.`, options: { - apiKey: process.env.OPENAI_API_KEY, + apiKey: process.env.GOOGLE_API_KEY, }, }); @@ -99,12 +99,12 @@ const supabaseClient = await connectToMCPServer( ); const agent = stagehand.agent({ - provider: "openai", - model: "computer-use-preview", + provider: "google", + model: "gemini-2.5-computer-use-preview-10-2025", integrations: [supabaseClient], instructions: `You can interact with Supabase databases. Use these tools to store and retrieve data.`, options: { - apiKey: process.env.OPENAI_API_KEY, + apiKey: process.env.GOOGLE_API_KEY, }, }); @@ -123,7 +123,7 @@ Stagehand uses a 1024x768 viewport by default (the optimal size for Computer Use ## Available Models -Use specialized computer use models (e.g., `computer-use-preview` from OpenAI or `claude-sonnet-4-20250514` from Anthropic) +Use specialized computer use models (e.g., `gemini-2.5-computer-use-preview-10-2025` from Google or `claude-sonnet-4-20250514` from Anthropic) Check out the guide on how to use different models with Stagehand. diff --git a/docs/references/agent.mdx b/docs/references/agent.mdx index 2929c1bc2..6a468042d 100644 --- a/docs/references/agent.mdx +++ b/docs/references/agent.mdx @@ -23,7 +23,7 @@ const agent = stagehand.agent(config: AgentConfig): AgentInstance **AgentConfig Interface:** ```typescript interface AgentConfig { - provider?: AgentProviderType; // "openai" | "anthropic" + provider?: AgentProviderType; // "openai" | "anthropic" | "google" model?: string; instructions?: string; options?: Record; @@ -59,15 +59,18 @@ agent = stagehand.agent({ AI provider for agent functionality. - **Options:** `"anthropic"`, `"openai"` + **Options:** `"anthropic"`, `"openai"`, `"google"` Specific model for agent execution. - + **Anthropic:** `"claude-sonnet-4-20250514"`, `"claude-3-5-sonnet-20241022"` **OpenAI:** `"computer-use-preview"`, `"gpt-4o"` + + **Google:** `"gemini-2.5-computer-use-preview-10-2025"` +