Skip to content

Commit 024aef3

Browse files
authored
fix(template): update Stagehand and SDK configurations for Gemini CUA
1 parent d064395 commit 024aef3

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

templates/typescript/gemini-cua/index.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,9 @@ async function runStagehandTask(invocationId?: string): Promise<SearchQueryOutpu
4949
const stagehand = new Stagehand({
5050
env: "LOCAL",
5151
verbose: 1,
52-
domSettleTimeoutMs: 30_000,
53-
modelName: "gpt-4o",
54-
modelClientOptions: {
55-
apiKey: OPENAI_API_KEY
56-
},
52+
domSettleTimeout: 30_000,
53+
model: "openai/gpt-4o",
54+
apiKey: OPENAI_API_KEY,
5755
localBrowserLaunchOptions: {
5856
cdpUrl: kernelBrowser.cdp_ws_url
5957
}
@@ -64,7 +62,7 @@ async function runStagehandTask(invocationId?: string): Promise<SearchQueryOutpu
6462
// Your Stagehand implementation here
6563
/////////////////////////////////////
6664
try {
67-
const page = stagehand.page;
65+
const page = stagehand.context.pages()[0];
6866

6967
const agent = stagehand.agent({
7068
provider: "google",

templates/typescript/gemini-cua/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"typescript": "^5"
88
},
99
"dependencies": {
10-
"@browserbasehq/stagehand": "^2.5.2",
11-
"@onkernel/sdk": "^0.15.0",
12-
"zod": "^3.25.67"
10+
"@browserbasehq/stagehand": "^3.0.1",
11+
"@onkernel/sdk": "^0.18.0",
12+
"zod": "=3.25.67"
1313
}
1414
}

0 commit comments

Comments
 (0)