Skip to content

Commit 37d81b7

Browse files
committed
Make browserOptions more re-usable
1 parent 52959c1 commit 37d81b7

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

templates/typescript/gemini-cua/index.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,15 @@ if (!GOOGLE_API_KEY) {
3232
async function runStagehandTask(invocationId?: string): Promise<SearchQueryOutput> {
3333
// Executes a Computer Use Agent (CUA) task using Gemini 2.5 and Stagehand
3434

35-
const browserOptions = invocationId
36-
? { invocation_id: invocationId, stealth: true }
37-
: { stealth: true };
35+
const browserOptions = {
36+
stealth: true,
37+
// viewport: {
38+
// width: 1440,
39+
// height: 900,
40+
// refresh_rate: 25
41+
// },
42+
...(invocationId && { invocation_id: invocationId })
43+
};
3844

3945
const kernelBrowser = await kernel.browsers.create(browserOptions);
4046

0 commit comments

Comments
 (0)