@@ -30,28 +30,28 @@ There are two ways to create agents in Stagehand:
30
30
31
31
### Computer Use Agents
32
32
33
- Use computer use agents with specialized models from OpenAI or Anthropic :
33
+ Use computer use agents with specialized models from OpenAI, Anthropic, or Google :
34
34
35
35
<CodeGroup >
36
36
``` typescript TypeScript
37
37
const agent = stagehand .agent ({
38
- provider: " anthropic " ,
39
- model: " claude-sonnet-4-20250514 " ,
38
+ provider: " google " ,
39
+ model: " gemini-2.5-computer-use-preview-10-2025 " ,
40
40
instructions: " You are a helpful assistant that can use a web browser." ,
41
41
options: {
42
- apiKey: process .env .ANTHROPIC_API_KEY ,
42
+ apiKey: process .env .GOOGLE_API_KEY ,
43
43
},
44
44
});
45
45
await agent .execute (" apply for a job at Browserbase" )
46
46
```
47
47
48
48
``` python Python
49
49
agent = stagehand.agent({
50
- " provider" : " anthropic " ,
51
- " model" : " claude-sonnet-4-20250514 " ,
50
+ " provider" : " google " ,
51
+ " model" : " gemini-2.5-computer-use-preview-10-2025 " ,
52
52
" instructions" : " You are a helpful assistant that can use a web browser." ,
53
53
" options" : {
54
- " apiKey" : os.getenv(" ANTHROPIC_API_KEY " ),
54
+ " apiKey" : os.getenv(" GOOGLE_API_KEY " ),
55
55
},
56
56
})
57
57
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
77
77
<CodeGroup >
78
78
``` typescript TypeScript (Pass URL)
79
79
const agent = stagehand .agent ({
80
- provider: " openai " ,
81
- model: " computer-use-preview" ,
80
+ provider: " google " ,
81
+ model: " gemini-2.5- computer-use-preview-10-2025 " ,
82
82
integrations: [
83
83
` https://mcp.exa.ai/mcp?exaApiKey=${process .env .EXA_API_KEY } ` ,
84
84
],
85
85
instructions: ` You have access to web search through Exa. Use it to find current information before browsing. ` ,
86
86
options: {
87
- apiKey: process .env .OPENAI_API_KEY ,
87
+ apiKey: process .env .GOOGLE_API_KEY ,
88
88
},
89
89
});
90
90
@@ -99,12 +99,12 @@ const supabaseClient = await connectToMCPServer(
99
99
);
100
100
101
101
const agent = stagehand .agent ({
102
- provider: " openai " ,
103
- model: " computer-use-preview" ,
102
+ provider: " google " ,
103
+ model: " gemini-2.5- computer-use-preview-10-2025 " ,
104
104
integrations: [supabaseClient ],
105
105
instructions: ` You can interact with Supabase databases. Use these tools to store and retrieve data. ` ,
106
106
options: {
107
- apiKey: process .env .OPENAI_API_KEY ,
107
+ apiKey: process .env .GOOGLE_API_KEY ,
108
108
},
109
109
});
110
110
@@ -123,7 +123,7 @@ Stagehand uses a 1024x768 viewport by default (the optimal size for Computer Use
123
123
124
124
## Available Models
125
125
126
- Use specialized computer use models (e.g., ` computer-use-preview ` from OpenAI or ` claude-sonnet-4-20250514 ` from Anthropic)
126
+ Use specialized computer use models (e.g., ` gemini-2.5- computer-use-preview-10-2025 ` from Google or ` claude-sonnet-4-20250514 ` from Anthropic)
127
127
128
128
<Card title = " Available Models" icon = " robot" href = " /configuration/models" >
129
129
Check out the guide on how to use different models with Stagehand.
0 commit comments