-
Notifications
You must be signed in to change notification settings - Fork 1.6k
evals: port the act/extract/observe bench suite to the v4 SDK #2494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
shriyatheunicorn
wants to merge
24
commits into
v4-spike
Choose a base branch
from
evals-v4-spike
base: v4-spike
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
a6b568e
evals: port act/extract/observe bench tasks to the v4 SDK
shriyatheunicorn c831658
Update packages/evals/tasks/bench/act/osr_in_spif.ts
shriyatheunicorn 89c3206
evals: address review findings - error sanitization, replay click fid…
shriyatheunicorn de97287
evals: use cross-frame locators for iframe form assertions (#2431)
shriyatheunicorn faf57e0
Update packages/evals/tasks/bench/act/custom_dropdown.ts
shriyatheunicorn e77fc2d
evals: fail fast when a v4 bench task is invoked with a v3 context
shriyatheunicorn cbf7cac
evals: replay observed actions through act(Action) (#2427) and drop t…
shriyatheunicorn a4840d3
Update extract_hamilton_weather.ts
shriyatheunicorn f53d0c0
Update extract_hamilton_weather.ts
shriyatheunicorn e817832
Refactor defineBenchV4Task to defineBenchTask
shriyatheunicorn 6745b4c
Update packages/evals/tasks/bench/act/shadow_dom.ts
shriyatheunicorn 30c4d4e
Update packages/evals/tasks/bench/act/multi_tab.ts
shriyatheunicorn 9d890a6
Revert "Refactor defineBenchV4Task to defineBenchTask"
shriyatheunicorn 91f5752
evals: fold typesV4 into types and drop the extra module
shriyatheunicorn 678b725
Update flight observation method in google_flights.ts
shriyatheunicorn 0731d06
Update packages/evals/tasks/bench/act/hidden_input_dropdown.ts
shriyatheunicorn f38304e
Refactor type imports in types.ts
shriyatheunicorn c481923
Update documentation for systemPrompt in types.ts
shriyatheunicorn c8e31b2
Update csr_in_oopif.ts
shriyatheunicorn d62fbc1
Add comment placeholder in publications schema
shriyatheunicorn e922097
Fix syntax error in extract_csa.ts
shriyatheunicorn 1d6ee88
Add publication details to extract_csa.ts schema
shriyatheunicorn 80a24e0
Clean up extract_csa.ts by removing excess code
shriyatheunicorn 8b68d62
Add null check for context in defineTask function
shriyatheunicorn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,32 +1,34 @@ | ||
| import { defineBenchTask } from "../../../framework/defineTask.js"; | ||
| import { defineBenchV4Task } from "../../../framework/defineTask.js"; | ||
|
|
||
| export default defineBenchTask({ name: "bidnet" }, async ({ logger, debugUrl, sessionUrl, v3 }) => { | ||
| try { | ||
| const page = v3.context.pages()[0]; | ||
| await page.goto("https://www.bidnetdirect.com/"); | ||
| export default defineBenchV4Task( | ||
| { name: "bidnet" }, | ||
| async ({ logger, debugUrl, sessionUrl, stagehand, page }) => { | ||
| try { | ||
| await page.goto("https://www.bidnetdirect.com/"); | ||
|
|
||
| await v3.act('Click on the "Construction" keyword'); | ||
| await stagehand.act('Click on the "Construction" keyword'); | ||
|
|
||
| const expectedUrl = | ||
| "https://www.bidnetdirect.com/public/solicitations/open?keywords=Construction"; | ||
| const currentUrl = page.url(); | ||
| const expectedUrl = | ||
| "https://www.bidnetdirect.com/public/solicitations/open?keywords=Construction"; | ||
| const currentUrl = await page.url(); | ||
|
|
||
| return { | ||
| _success: currentUrl.startsWith(expectedUrl), | ||
| currentUrl, | ||
| debugUrl, | ||
| sessionUrl, | ||
| logs: logger.getLogs(), | ||
| }; | ||
| } catch (error) { | ||
| return { | ||
| _success: false, | ||
| error: error, | ||
| debugUrl, | ||
| sessionUrl, | ||
| logs: logger.getLogs(), | ||
| }; | ||
| } finally { | ||
| await v3.close(); | ||
| } | ||
| }); | ||
| return { | ||
| _success: currentUrl.startsWith(expectedUrl), | ||
| currentUrl, | ||
| debugUrl, | ||
| sessionUrl, | ||
| logs: logger.getLogs(), | ||
| }; | ||
| } catch (error) { | ||
| return { | ||
| _success: false, | ||
| error: error instanceof Error ? error.message : String(error), | ||
| debugUrl, | ||
| sessionUrl, | ||
| logs: logger.getLogs(), | ||
| }; | ||
| } finally { | ||
| await stagehand.close(); | ||
| } | ||
| }, | ||
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.