Skip to content

Commit dae1700

Browse files
committed
minor fixes
1 parent e88d244 commit dae1700

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

stagehand/src/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const stagehandConfig: ConstructorParams = {
5050
: "LOCAL",
5151
apiKey: process.env.BROWSERBASE_API_KEY /* API key for authentication */,
5252
projectId: process.env.BROWSERBASE_PROJECT_ID /* Project identifier */,
53-
debugDom: true /* Enable DOM debugging features */,
53+
debugDom: false /* Enable DOM debugging features */,
5454
headless: false /* Run browser in headless mode */,
5555
logger: (message: LogLine) =>
5656
console.error(logLineToString(message)) /* Custom logging function to stderr */,
@@ -65,6 +65,7 @@ const stagehandConfig: ConstructorParams = {
6565
modelClientOptions: {
6666
apiKey: process.env.OPENAI_API_KEY,
6767
} /* Configuration options for the model client */,
68+
useAPI: false,
6869
};
6970

7071
// Define the Stagehand tools
@@ -368,6 +369,7 @@ async function handleToolCall(
368369
await stagehand.page.act({
369370
action: args.action,
370371
variables: args.variables,
372+
slowDomBasedAct: false,
371373
});
372374
// log("Action completed successfully", 'info');
373375
return {
@@ -403,9 +405,10 @@ async function handleToolCall(
403405
// log(`Schema: ${JSON.stringify(args.schema)}`, 'debug');
404406
// Convert the JSON schema from args.schema to a zod schema
405407
const zodSchema = jsonSchemaToZod(args.schema) as AnyZodObject;
406-
const data = await stagehand.extract({
408+
const data = await stagehand.page.extract({
407409
instruction: args.instruction,
408410
schema: zodSchema,
411+
useTextExtract: true,
409412
});
410413
if (!data || typeof data !== "object" || !("data" in data)) {
411414
throw new Error("Invalid extraction response format");

0 commit comments

Comments
 (0)