Skip to content

Commit

Permalink
gen2e: include all aria attributes, set default spolicy to model
Browse files Browse the repository at this point in the history
  • Loading branch information
rhighs committed Jun 11, 2024
1 parent 319419f commit 2e97768
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions packages/gen2e/src/gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const evalLoop = async (
const errors: Error[] = [];
const attempts: string[] = [];

const _spolicy = policies.screenshot ?? "onfail";
const _spolicy = policies.screenshot ?? "model";
const _model = (model ?? env.OPENAI_MODEL) as Gen2ELLMAgentModel;

const shouldScreenshot = (
Expand Down Expand Up @@ -297,7 +297,7 @@ const _gen: GenType = (
evalCode,
policies: {
maxRetries: options?.policies?.maxRetries ?? 3,
screenshot: options?.policies?.screenshot ?? "onfail",
screenshot: options?.policies?.screenshot ?? "model",
},
},
{
Expand Down Expand Up @@ -420,7 +420,7 @@ _gen.test = function (
evalCode,
policies: {
maxRetries: options?.policies?.maxRetries ?? 3,
screenshot: options?.policies?.screenshot ?? "onfail",
screenshot: options?.policies?.screenshot ?? "model",
},
},
{
Expand Down
5 changes: 2 additions & 3 deletions packages/gen2e/src/snapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ const attributes: {
"href",
"role",
"title",
"aria-label",
"aria-labelledby",
"aria*",
"data-testid",
"data-*",
"for",
Expand All @@ -94,7 +93,7 @@ const attributes: {
frame: ["src"],
},
high: {
"*": ["id", "placeholder", "data-testid", "textContent"],
"*": ["id", "placeholder", "data-testid", "textContent", "aria*"],
iframe: ["src"],
frame: ["src"],
},
Expand Down

0 comments on commit 2e97768

Please sign in to comment.