Open
Description
This code previously worked on stagehand 2.1:
const { count } = await page.extract({
instruction: `Extract the ${widgetTitle} link's value`,
schema: z.object({
count: z.number(),
}),
});
This would consistently produce a target number. Now we're getting inconsistent numbers with the 2.2.1 upgrade. The workaround we implemented that works consistently is:
const [action] = await page.observe({
instruction: `Extract the ${widgetTitle} link's value`,
});
const { count } = await page.extract({
selector: action.selector,
schema: z.object({
count: z.number(),
}),
});
Which tells me it's a problem around how we're processing instructions in extract (observe is consistently accurate, extract is not).
Metadata
Metadata
Assignees
Labels
No labels