-
Notifications
You must be signed in to change notification settings - Fork 596
/
Copy pathstagehand.config.ts
42 lines (39 loc) · 1.27 KB
/
stagehand.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import type { ConstructorParams } from "@/dist";
import dotenv from "dotenv";
dotenv.config();
const StagehandConfig: ConstructorParams = {
verbose: 2 /* Verbosity level for logging: 0 = silent, 1 = info, 2 = all */,
domSettleTimeoutMs: 30_000 /* Timeout for DOM to settle in milliseconds */,
// LLM configuration
modelName: "gpt-4o" /* Name of the model to use */,
modelClientOptions: {
apiKey: process.env.OPENAI_API_KEY,
} /* Configuration options for the model client */,
// Browser configuration
env:
process.env.BROWSERBASE_API_KEY && process.env.BROWSERBASE_PROJECT_ID
? "BROWSERBASE"
: "LOCAL",
apiKey: process.env.BROWSERBASE_API_KEY /* API key for authentication */,
projectId: process.env.BROWSERBASE_PROJECT_ID /* Project identifier */,
browserbaseSessionID:
undefined /* Session ID for resuming Browserbase sessions */,
browserbaseSessionCreateParams: {
projectId: process.env.BROWSERBASE_PROJECT_ID!,
browserSettings: {
blockAds: true,
viewport: {
width: 1024,
height: 768,
},
},
},
localBrowserLaunchOptions: {
headless: false,
viewport: {
width: 1024,
height: 768,
},
} /* Configuration options for the local browser */,
};
export default StagehandConfig;