-
Notifications
You must be signed in to change notification settings - Fork 1k
Add more agent evals #961
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
Merged
Merged
Add more agent evals #961
Changes from 8 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
6ee4de7
add more evals for agent
tkattkat bac6f01
add more evals
tkattkat d30d4d0
update evals config
tkattkat d924370
add changeset
tkattkat fffe986
update eval
tkattkat 81f0e1a
offload initialization of agent to the runner
tkattkat 55ef435
update type
tkattkat 7b4b030
update steps on eval
tkattkat d6c6dc0
add more validation to evals + update default models for agent in tas…
tkattkat 439494e
update kith eval
tkattkat e8e2eeb
remove type casting
tkattkat 358a767
add agentInstance type
tkattkat a824aa6
remove accidental commit
tkattkat 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@browserbasehq/stagehand": patch | ||
--- | ||
|
||
Add more evals for stagehand agent |
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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { EvalFunction } from "@/types/evals"; | ||
|
||
export const all_recipes: EvalFunction = async ({ | ||
debugUrl, | ||
sessionUrl, | ||
stagehand, | ||
logger, | ||
agent, | ||
}) => { | ||
try { | ||
await stagehand.page.goto("https://www.allrecipes.com/"); | ||
|
||
const agentResult = await agent.execute({ | ||
instruction: | ||
"Search for a recipe for Beef Wellington on Allrecipes that has at least 200 reviews and an average rating of 4.5 stars or higher. List the main ingredients required for the dish.", | ||
maxSteps: 20, | ||
}); | ||
logger.log(agentResult); | ||
|
||
const success = agentResult.success; | ||
tkattkat marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
if (!success) { | ||
return { | ||
_success: false, | ||
message: agentResult.message, | ||
debugUrl, | ||
sessionUrl, | ||
logs: logger.getLogs(), | ||
}; | ||
} | ||
|
||
return { | ||
_success: true, | ||
debugUrl, | ||
sessionUrl, | ||
logs: logger.getLogs(), | ||
}; | ||
} catch (error) { | ||
return { | ||
_success: false, | ||
error, | ||
debugUrl, | ||
sessionUrl, | ||
logs: logger.getLogs(), | ||
} as unknown as ReturnType<EvalFunction> extends Promise<infer R> | ||
? R | ||
: never; | ||
} 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { EvalFunction } from "@/types/evals"; | ||
|
||
export const amazon_shoes: EvalFunction = async ({ | ||
debugUrl, | ||
sessionUrl, | ||
stagehand, | ||
logger, | ||
agent, | ||
}) => { | ||
try { | ||
await stagehand.page.goto("https://www.amazon.com/"); | ||
|
||
const agentResult = await agent.execute({ | ||
instruction: | ||
"Find a pair of mens running shoes in black, size 7, 4+ stars and under $50 and add them to my cart on Amazon.", | ||
maxSteps: 18, | ||
}); | ||
|
||
const success = agentResult.success; | ||
|
||
if (!success) { | ||
return { | ||
_success: false, | ||
message: agentResult.message, | ||
debugUrl, | ||
sessionUrl, | ||
logs: logger.getLogs(), | ||
}; | ||
} | ||
return { | ||
_success: true, | ||
debugUrl, | ||
sessionUrl, | ||
logs: logger.getLogs(), | ||
}; | ||
} catch (error) { | ||
return { | ||
_success: false, | ||
message: error.message, | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { EvalFunction } from "@/types/evals"; | ||
|
||
export const apple_trade_in: EvalFunction = async ({ | ||
debugUrl, | ||
sessionUrl, | ||
stagehand, | ||
logger, | ||
agent, | ||
}) => { | ||
try { | ||
await stagehand.page.goto("https://www.apple.com/"); | ||
|
||
const agentResult = await agent.execute({ | ||
instruction: | ||
"Find out the trade-in value for an iPhone 13 Pro Max in good condition on the Apple website.", | ||
maxSteps: 30, | ||
}); | ||
|
||
const success = agentResult.success; | ||
|
||
if (!success) { | ||
return { | ||
_success: false, | ||
message: agentResult.message, | ||
debugUrl, | ||
sessionUrl, | ||
logs: logger.getLogs(), | ||
}; | ||
} | ||
return { | ||
_success: true, | ||
debugUrl, | ||
sessionUrl, | ||
logs: logger.getLogs(), | ||
}; | ||
} catch (error) { | ||
return { | ||
_success: false, | ||
message: error.message, | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { EvalFunction } from "@/types/evals"; | ||
|
||
export const apple_tv: EvalFunction = async ({ | ||
debugUrl, | ||
sessionUrl, | ||
stagehand, | ||
logger, | ||
agent, | ||
}) => { | ||
try { | ||
await stagehand.page.goto("https://www.apple.com/"); | ||
|
||
const agentResult = await agent.execute({ | ||
instruction: | ||
"Identify the size and weight for the Apple TV 4K and list the Siri Remote features introduced.", | ||
maxSteps: 30, | ||
}); | ||
|
||
const success = agentResult.success; | ||
|
||
if (!success) { | ||
return { | ||
_success: false, | ||
message: agentResult.message, | ||
debugUrl, | ||
sessionUrl, | ||
logs: logger.getLogs(), | ||
}; | ||
} | ||
return { | ||
_success: true, | ||
debugUrl, | ||
sessionUrl, | ||
logs: logger.getLogs(), | ||
}; | ||
} catch (error) { | ||
return { | ||
_success: false, | ||
message: error.message, | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { EvalFunction } from "@/types/evals"; | ||
|
||
export const arxiv_gpt_report: EvalFunction = async ({ | ||
debugUrl, | ||
sessionUrl, | ||
stagehand, | ||
logger, | ||
agent, | ||
}) => { | ||
try { | ||
await stagehand.page.goto("https://arxiv.org/"); | ||
|
||
const agentResult = await agent.execute({ | ||
instruction: | ||
"Find the paper 'GPT-4 Technical Report', when was v3 submitted?", | ||
maxSteps: 30, | ||
}); | ||
|
||
const success = agentResult.success; | ||
|
||
if (!success) { | ||
return { | ||
_success: false, | ||
message: agentResult.message, | ||
debugUrl, | ||
sessionUrl, | ||
logs: logger.getLogs(), | ||
}; | ||
} | ||
return { | ||
_success: true, | ||
debugUrl, | ||
sessionUrl, | ||
logs: logger.getLogs(), | ||
}; | ||
} catch (error) { | ||
return { | ||
_success: false, | ||
message: error.message, | ||
debugUrl, | ||
sessionUrl, | ||
logs: logger.getLogs(), | ||
}; | ||
} finally { | ||
await stagehand.close(); | ||
} | ||
}; |
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.