Buckets:

download
raw
113 kB
<meta charset="utf-8" /><meta name="hf:doc:metadata" content="{&quot;title&quot;:&quot;BrowserGym Environment&quot;,&quot;local&quot;:&quot;browsergym-environment&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Why BrowserGym?&quot;,&quot;local&quot;:&quot;why-browsergym&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Quick Start - Training (MiniWoB)&quot;,&quot;local&quot;:&quot;quick-start---training-miniwob&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;No Setup Required! ๐ŸŽ‰&quot;,&quot;local&quot;:&quot;no-setup-required-&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Harness Sessions for TRL&quot;,&quot;local&quot;:&quot;harness-sessions-for-trl&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Available Tasks by Benchmark&quot;,&quot;local&quot;:&quot;available-tasks-by-benchmark&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;MiniWoB++ Tasks (Training - 100+ tasks)&quot;,&quot;local&quot;:&quot;miniwob-tasks-training---100-tasks&quot;,&quot;sections&quot;:[],&quot;depth&quot;:4},{&quot;title&quot;:&quot;WebArena Tasks (Evaluation - 812 tasks)&quot;,&quot;local&quot;:&quot;webarena-tasks-evaluation---812-tasks&quot;,&quot;sections&quot;:[],&quot;depth&quot;:4},{&quot;title&quot;:&quot;VisualWebArena Tasks (910 tasks)&quot;,&quot;local&quot;:&quot;visualwebarena-tasks-910-tasks&quot;,&quot;sections&quot;:[],&quot;depth&quot;:4},{&quot;title&quot;:&quot;WorkArena Tasks&quot;,&quot;local&quot;:&quot;workarena-tasks&quot;,&quot;sections&quot;:[],&quot;depth&quot;:4}],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Evaluation (WebArena)&quot;,&quot;local&quot;:&quot;evaluation-webarena&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Prerequisites&quot;,&quot;local&quot;:&quot;prerequisites&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Usage&quot;,&quot;local&quot;:&quot;usage&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Building the Docker Image&quot;,&quot;local&quot;:&quot;building-the-docker-image&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Prerequisites&quot;,&quot;local&quot;:&quot;prerequisites&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Build the BrowserGym Environment&quot;,&quot;local&quot;:&quot;build-the-browsergym-environment&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Run the Server&quot;,&quot;local&quot;:&quot;run-the-server&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;For MiniWoB (Training):&quot;,&quot;local&quot;:&quot;for-miniwob-training&quot;,&quot;sections&quot;:[],&quot;depth&quot;:4},{&quot;title&quot;:&quot;For WebArena (Evaluation):&quot;,&quot;local&quot;:&quot;for-webarena-evaluation&quot;,&quot;sections&quot;:[],&quot;depth&quot;:4}],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Environment Details&quot;,&quot;local&quot;:&quot;environment-details&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Action&quot;,&quot;local&quot;:&quot;action&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Observation&quot;,&quot;local&quot;:&quot;observation&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Advanced: Accessing Raw BrowserGym Data&quot;,&quot;local&quot;:&quot;advanced-accessing-raw-browsergym-data&quot;,&quot;sections&quot;:[],&quot;depth&quot;:4}],&quot;depth&quot;:3},{&quot;title&quot;:&quot;State&quot;,&quot;local&quot;:&quot;state&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Configuration&quot;,&quot;local&quot;:&quot;configuration&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Common Settings&quot;,&quot;local&quot;:&quot;common-settings&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;WebArena-Specific (only needed for WebArena benchmark)&quot;,&quot;local&quot;:&quot;webarena-specific-only-needed-for-webarena-benchmark&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Supported Benchmarks&quot;,&quot;local&quot;:&quot;supported-benchmarks&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;1. MiniWoB++ (Training) โœ… Recommended for Training&quot;,&quot;local&quot;:&quot;1-miniwob-training--recommended-for-training&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;2. WebArena (Evaluation) ๐Ÿ“Š Benchmark&quot;,&quot;local&quot;:&quot;2-webarena-evaluation--benchmark&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;3. VisualWebArena (Evaluation) ๐Ÿ‘๏ธ Visual Benchmark&quot;,&quot;local&quot;:&quot;3-visualwebarena-evaluation--visual-benchmark&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;4. WorkArena (Evaluation) ๐Ÿ’ผ Enterprise Benchmark&quot;,&quot;local&quot;:&quot;4-workarena-evaluation--enterprise-benchmark&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Typical Training Pipeline&quot;,&quot;local&quot;:&quot;typical-training-pipeline&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Development &amp; Testing&quot;,&quot;local&quot;:&quot;development--testing&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Running Tests&quot;,&quot;local&quot;:&quot;running-tests&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Local Development&quot;,&quot;local&quot;:&quot;local-development&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Project Structure&quot;,&quot;local&quot;:&quot;project-structure&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;References&quot;,&quot;local&quot;:&quot;references&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2}],&quot;depth&quot;:1}">
<link href="/docs/openenv/pr_813/en/_app/immutable/assets/0.e3b0c442.css" rel="modulepreload">
<link rel="modulepreload" href="/docs/openenv/pr_813/en/_app/immutable/entry/start.9c9d6cdf.js">
<link rel="modulepreload" href="/docs/openenv/pr_813/en/_app/immutable/chunks/scheduler.2b22cead.js">
<link rel="modulepreload" href="/docs/openenv/pr_813/en/_app/immutable/chunks/singletons.b9e7e2c8.js">
<link rel="modulepreload" href="/docs/openenv/pr_813/en/_app/immutable/chunks/paths.4b396019.js">
<link rel="modulepreload" href="/docs/openenv/pr_813/en/_app/immutable/entry/app.b8b7485a.js">
<link rel="modulepreload" href="/docs/openenv/pr_813/en/_app/immutable/chunks/preload-helper.b21f837c.js">
<link rel="modulepreload" href="/docs/openenv/pr_813/en/_app/immutable/chunks/index.1a0e8013.js">
<link rel="modulepreload" href="/docs/openenv/pr_813/en/_app/immutable/nodes/0.93b1c108.js">
<link rel="modulepreload" href="/docs/openenv/pr_813/en/_app/immutable/chunks/each.e59479a4.js">
<link rel="modulepreload" href="/docs/openenv/pr_813/en/_app/immutable/nodes/6.3c68d7f1.js">
<link rel="modulepreload" href="/docs/openenv/pr_813/en/_app/immutable/chunks/MermaidChart.svelte_svelte_type_style_lang.f5f19e58.js">
<link rel="modulepreload" href="/docs/openenv/pr_813/en/_app/immutable/chunks/CodeBlock.640a2a71.js"><!-- HEAD_svelte-u9bgzb_START --><meta name="hf:doc:metadata" content="{&quot;title&quot;:&quot;BrowserGym Environment&quot;,&quot;local&quot;:&quot;browsergym-environment&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Why BrowserGym?&quot;,&quot;local&quot;:&quot;why-browsergym&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Quick Start - Training (MiniWoB)&quot;,&quot;local&quot;:&quot;quick-start---training-miniwob&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;No Setup Required! ๐ŸŽ‰&quot;,&quot;local&quot;:&quot;no-setup-required-&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Harness Sessions for TRL&quot;,&quot;local&quot;:&quot;harness-sessions-for-trl&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Available Tasks by Benchmark&quot;,&quot;local&quot;:&quot;available-tasks-by-benchmark&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;MiniWoB++ Tasks (Training - 100+ tasks)&quot;,&quot;local&quot;:&quot;miniwob-tasks-training---100-tasks&quot;,&quot;sections&quot;:[],&quot;depth&quot;:4},{&quot;title&quot;:&quot;WebArena Tasks (Evaluation - 812 tasks)&quot;,&quot;local&quot;:&quot;webarena-tasks-evaluation---812-tasks&quot;,&quot;sections&quot;:[],&quot;depth&quot;:4},{&quot;title&quot;:&quot;VisualWebArena Tasks (910 tasks)&quot;,&quot;local&quot;:&quot;visualwebarena-tasks-910-tasks&quot;,&quot;sections&quot;:[],&quot;depth&quot;:4},{&quot;title&quot;:&quot;WorkArena Tasks&quot;,&quot;local&quot;:&quot;workarena-tasks&quot;,&quot;sections&quot;:[],&quot;depth&quot;:4}],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Evaluation (WebArena)&quot;,&quot;local&quot;:&quot;evaluation-webarena&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Prerequisites&quot;,&quot;local&quot;:&quot;prerequisites&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Usage&quot;,&quot;local&quot;:&quot;usage&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Building the Docker Image&quot;,&quot;local&quot;:&quot;building-the-docker-image&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Prerequisites&quot;,&quot;local&quot;:&quot;prerequisites&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Build the BrowserGym Environment&quot;,&quot;local&quot;:&quot;build-the-browsergym-environment&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Run the Server&quot;,&quot;local&quot;:&quot;run-the-server&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;For MiniWoB (Training):&quot;,&quot;local&quot;:&quot;for-miniwob-training&quot;,&quot;sections&quot;:[],&quot;depth&quot;:4},{&quot;title&quot;:&quot;For WebArena (Evaluation):&quot;,&quot;local&quot;:&quot;for-webarena-evaluation&quot;,&quot;sections&quot;:[],&quot;depth&quot;:4}],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Environment Details&quot;,&quot;local&quot;:&quot;environment-details&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Action&quot;,&quot;local&quot;:&quot;action&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Observation&quot;,&quot;local&quot;:&quot;observation&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Advanced: Accessing Raw BrowserGym Data&quot;,&quot;local&quot;:&quot;advanced-accessing-raw-browsergym-data&quot;,&quot;sections&quot;:[],&quot;depth&quot;:4}],&quot;depth&quot;:3},{&quot;title&quot;:&quot;State&quot;,&quot;local&quot;:&quot;state&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Configuration&quot;,&quot;local&quot;:&quot;configuration&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Common Settings&quot;,&quot;local&quot;:&quot;common-settings&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;WebArena-Specific (only needed for WebArena benchmark)&quot;,&quot;local&quot;:&quot;webarena-specific-only-needed-for-webarena-benchmark&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Supported Benchmarks&quot;,&quot;local&quot;:&quot;supported-benchmarks&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;1. MiniWoB++ (Training) โœ… Recommended for Training&quot;,&quot;local&quot;:&quot;1-miniwob-training--recommended-for-training&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;2. WebArena (Evaluation) ๐Ÿ“Š Benchmark&quot;,&quot;local&quot;:&quot;2-webarena-evaluation--benchmark&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;3. VisualWebArena (Evaluation) ๐Ÿ‘๏ธ Visual Benchmark&quot;,&quot;local&quot;:&quot;3-visualwebarena-evaluation--visual-benchmark&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;4. WorkArena (Evaluation) ๐Ÿ’ผ Enterprise Benchmark&quot;,&quot;local&quot;:&quot;4-workarena-evaluation--enterprise-benchmark&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Typical Training Pipeline&quot;,&quot;local&quot;:&quot;typical-training-pipeline&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Development &amp; Testing&quot;,&quot;local&quot;:&quot;development--testing&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Running Tests&quot;,&quot;local&quot;:&quot;running-tests&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Local Development&quot;,&quot;local&quot;:&quot;local-development&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Project Structure&quot;,&quot;local&quot;:&quot;project-structure&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;References&quot;,&quot;local&quot;:&quot;references&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2}],&quot;depth&quot;:1}"><!-- HEAD_svelte-u9bgzb_END --> <p></p> <div class="items-center shrink-0 min-w-[100px] max-sm:min-w-[50px] justify-end ml-auto flex" style="float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"><div class="inline-flex rounded-md max-sm:rounded-sm"><button class="inline-flex items-center gap-1 h-7 max-sm:h-7 px-2 max-sm:px-1.5 text-sm font-medium text-gray-800 border border-r-0 rounded-l-md max-sm:rounded-l-sm border-gray-200 bg-white hover:shadow-inner dark:border-gray-850 dark:bg-gray-950 dark:text-gray-200 dark:hover:bg-gray-800" aria-live="polite"><span class="inline-flex items-center justify-center rounded-md p-0.5 max-sm:p-0 hover:text-gray-800 dark:hover:text-gray-200"><svg class="sm:size-3.5 size-3" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg></span> <span>Copy page</span></button> <button class="inline-flex items-center justify-center w-6 max-sm:w-5 h-7 max-sm:h-7 disabled:pointer-events-none text-sm text-gray-500 hover:text-gray-700 dark:hover:text-white rounded-r-md max-sm:rounded-r-sm border border-l transition border-gray-200 bg-white hover:shadow-inner dark:border-gray-850 dark:bg-gray-950 dark:text-gray-200 dark:hover:bg-gray-800" aria-haspopup="menu" aria-expanded="false" aria-label="Open copy menu"><svg class="transition-transform text-gray-400 overflow-visible sm:size-3.5 size-3 rotate-0" width="1em" height="1em" viewBox="0 0 12 7" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L6 6L11 1" stroke="currentColor"></path></svg></button></div> </div> <h1 class="relative group"><a id="browsergym-environment" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#browsergym-environment"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>BrowserGym Environment</span></h1> <p data-svelte-h="svelte-rr0x3y">BrowserGym is a unified framework for web-based agent tasks that provides access to multiple benchmarks under a single Gymnasium-compatible API. This integration brings the complete training-to-evaluation pipeline for web agents into OpenEnv.</p> <h2 class="relative group"><a id="why-browsergym" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#why-browsergym"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Why BrowserGym?</span></h2> <p data-svelte-h="svelte-zm5un5">BrowserGym provides a complete pipeline for developing web agents: train on simple tasks, then evaluate on realistic websites.</p> <p data-svelte-h="svelte-ehewbv"><strong>What are these benchmarks?</strong></p> <ul data-svelte-h="svelte-1kpfgs9"><li><p><strong>MiniWoB++ (Training)</strong>: 100+ synthetic web tasks like โ€œclick this buttonโ€, โ€œfill out this formโ€, โ€œselect from dropdownโ€. Each task is a simple webpage with a clear objective. Fast resets, randomized variations, dense rewards. Perfect for learning basic web navigation skills. <strong>No external setup needed</strong> - tasks run in isolated browser sessions.</p></li> <li><p><strong>WebArena (Evaluation)</strong>: 812 tasks on real websites (e-commerce, forums, GitLab, Wikipedia). Tasks like โ€œfind the cheapest laptop and add to cartโ€ or โ€œcreate a merge request for bug #123โ€. Multistep, requires reasoning, sparse rewards. Tests if your agent can handle actual websites. <strong>Requires running 7 backend services</strong> (shopping site, GitLab instance, etc.).</p></li> <li><p><strong>VisualWebArena</strong>: Similar to WebArena but requires visual understanding - agents need to interpret images, identify UI elements visually, handle multimodal content.</p></li> <li><p><strong>WorkArena</strong>: Enterprise software tasks (CRM, project management, business workflows). Tests automation on corporate-style applications.</p></li></ul> <p data-svelte-h="svelte-q81ays"><strong>The training โ†’ evaluation pipeline:</strong></p> <ol data-svelte-h="svelte-lpvt5n"><li>Train on MiniWoB (simple, controlled, fast iterations)</li> <li>Evaluate on WebArena (complex, realistic, measures real-world capability)</li></ol> <p data-svelte-h="svelte-khdmf9"><strong>Key advantage</strong>: You can start training immediately with MiniWoB. No need to set up infrastructure just to test if your code works.</p> <h2 class="relative group"><a id="quick-start---training-miniwob" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#quick-start---training-miniwob"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Quick Start - Training (MiniWoB)</span></h2> <h3 class="relative group"><a id="no-setup-required-" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#no-setup-required-"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>No Setup Required! ๐ŸŽ‰</span></h3> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class="language-python "><!-- HTML_TAG_START --><span class="hljs-keyword">from</span> browsergym_env <span class="hljs-keyword">import</span> BrowserGymEnv, BrowserGymAction
<span class="hljs-comment"># Create environment for MiniWoB training task</span>
env = BrowserGymEnv.from_docker_image(
<span class="hljs-string">&quot;ghcr.io/openenv/browsergym-env:latest&quot;</span>,
environment={
<span class="hljs-string">&quot;BROWSERGYM_BENCHMARK&quot;</span>: <span class="hljs-string">&quot;miniwob&quot;</span>,
<span class="hljs-string">&quot;BROWSERGYM_TASK_NAME&quot;</span>: <span class="hljs-string">&quot;click-test&quot;</span>, <span class="hljs-comment"># or &quot;click-button&quot;, &quot;click-dialog&quot;, etc.</span>
}
)
<span class="hljs-comment"># Train your agent!</span>
<span class="hljs-keyword">for</span> episode <span class="hljs-keyword">in</span> <span class="hljs-built_in">range</span>(<span class="hljs-number">1000</span>):
result = env.reset()
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Goal: <span class="hljs-subst">{result.observation.goal}</span>&quot;</span>)
done = <span class="hljs-literal">False</span>
<span class="hljs-keyword">while</span> <span class="hljs-keyword">not</span> done:
<span class="hljs-comment"># Your agent decides what to do</span>
action_str = agent.get_action(result.observation.text)
action = BrowserGymAction(action_str=action_str)
result = env.step(action)
done = result.done
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Reward: <span class="hljs-subst">{result.reward}</span>&quot;</span>)
env.close()<!-- HTML_TAG_END --></pre></div> <h2 class="relative group"><a id="harness-sessions-for-trl" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#harness-sessions-for-trl"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Harness Sessions for TRL</span></h2> <p data-svelte-h="svelte-4qgzdv">If you want BrowserGym to participate in a tool-driven harness instead of a
hand-written <code>env.reset()</code> / <code>env.step()</code> loop, use the BrowserGym session
factory:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class="language-python "><!-- HTML_TAG_START --><span class="hljs-keyword">from</span> browsergym_env <span class="hljs-keyword">import</span> BrowserGymEnv
<span class="hljs-keyword">from</span> browsergym_env.harness <span class="hljs-keyword">import</span> BrowserGymSessionFactory
<span class="hljs-keyword">from</span> openenv.core.harness <span class="hljs-keyword">import</span> (
HarnessRunLimits,
MCPHarnessAdapter,
build_harness_rollout_func,
)
session_factory = BrowserGymSessionFactory(
client_factory=<span class="hljs-keyword">lambda</span>: BrowserGymEnv(base_url=<span class="hljs-string">&quot;https://openenv-browsergym-env.hf.space&quot;</span>),
)
rollout_func = build_harness_rollout_func(
session_factory=session_factory,
harness_adapter=MCPHarnessAdapter(),
model_step_builder=..., <span class="hljs-comment"># trainer-owned model sampling</span>
limits=HarnessRunLimits(max_turns=<span class="hljs-number">10</span>),
)<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-qidu5g">BrowserGym exposes <code>click</code>, <code>fill</code>, <code>send_keys</code>, <code>scroll</code>, and <code>noop</code> as MCP-style
tools while still translating them back into the underlying <code>BrowserGymAction</code>
strings. See <a href="https://github.com/huggingface/OpenEnv/blob/main/examples/browsergym_harness.py" rel="nofollow">examples/browsergym_harness.py</a>
for a full TRL-oriented example.</p> <h3 class="relative group"><a id="available-tasks-by-benchmark" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#available-tasks-by-benchmark"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Available Tasks by Benchmark</span></h3> <h4 class="relative group"><a id="miniwob-tasks-training---100-tasks" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#miniwob-tasks-training---100-tasks"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>MiniWoB++ Tasks (Training - 100+ tasks)</span></h4> <p data-svelte-h="svelte-1mytbch">MiniWoB tasks are organized by difficulty and type. Here are the main categories:</p> <p data-svelte-h="svelte-r5kqxs"><strong>Click Tasks</strong> (Basic interaction)</p> <table data-svelte-h="svelte-1w9h2nl"><thead><tr><th>Task Name</th> <th>Description</th> <th>Difficulty</th></tr></thead> <tbody><tr><td><code>click-test</code></td> <td>Click a single button</td> <td>โญ Easy</td></tr> <tr><td><code>click-button</code></td> <td>Click button with specific text</td> <td>โญ Easy</td></tr> <tr><td><code>click-button-sequence</code></td> <td>Click buttons in order</td> <td>โญโญ Medium</td></tr> <tr><td><code>click-checkboxes</code></td> <td>Select specific checkboxes</td> <td>โญโญ Medium</td></tr> <tr><td><code>click-checkboxes-soft</code></td> <td>Select checkboxes (multiple valid)</td> <td>โญโญ Medium</td></tr> <tr><td><code>click-checkboxes-large</code></td> <td>Many checkboxes to select from</td> <td>โญโญ Medium</td></tr> <tr><td><code>click-checkboxes-transfer</code></td> <td>Transfer learning variation</td> <td>โญโญ Medium</td></tr> <tr><td><code>click-dialog</code></td> <td>Click correct button in dialog</td> <td>โญ Easy</td></tr> <tr><td><code>click-dialog-2</code></td> <td>More complex dialog</td> <td>โญโญ Medium</td></tr> <tr><td><code>click-link</code></td> <td>Click on a link</td> <td>โญ Easy</td></tr> <tr><td><code>click-option</code></td> <td>Select from dropdown</td> <td>โญโญ Medium</td></tr> <tr><td><code>click-pie</code></td> <td>Click on pie chart slice</td> <td>โญโญ Medium</td></tr> <tr><td><code>click-scroll-list</code></td> <td>Click item in scrollable list</td> <td>โญโญโญ Hard</td></tr> <tr><td><code>click-shades</code></td> <td>Click on specific color shade</td> <td>โญโญ Medium</td></tr> <tr><td><code>click-shape</code></td> <td>Click on specific shape</td> <td>โญโญ Medium</td></tr> <tr><td><code>click-tab</code></td> <td>Switch between tabs</td> <td>โญโญ Medium</td></tr> <tr><td><code>click-tab-2</code></td> <td>More complex tab switching</td> <td>โญโญโญ Hard</td></tr> <tr><td><code>click-widget</code></td> <td>Click on UI widget</td> <td>โญโญ Medium</td></tr></tbody></table> <p data-svelte-h="svelte-1wl97ou"><strong>Text Entry Tasks</strong> (Typing and forms)</p> <table data-svelte-h="svelte-o8bbvh"><thead><tr><th>Task Name</th> <th>Description</th> <th>Difficulty</th></tr></thead> <tbody><tr><td><code>enter-text</code></td> <td>Type text into input field</td> <td>โญ Easy</td></tr> <tr><td><code>enter-text-dynamic</code></td> <td>Dynamic text entry</td> <td>โญโญ Medium</td></tr> <tr><td><code>enter-text-2</code></td> <td>Multiple text fields</td> <td>โญโญ Medium</td></tr> <tr><td><code>enter-password</code></td> <td>Fill password field</td> <td>โญ Easy</td></tr> <tr><td><code>enter-date</code></td> <td>Enter a date</td> <td>โญโญ Medium</td></tr> <tr><td><code>enter-time</code></td> <td>Enter a time</td> <td>โญโญ Medium</td></tr> <tr><td><code>login-user</code></td> <td>Complete login form</td> <td>โญโญ Medium</td></tr> <tr><td><code>login-user-popup</code></td> <td>Login via popup</td> <td>โญโญโญ Hard</td></tr></tbody></table> <p data-svelte-h="svelte-16p4sli"><strong>Navigation Tasks</strong> (Multi-step interaction)</p> <table data-svelte-h="svelte-b1tfo6"><thead><tr><th>Task Name</th> <th>Description</th> <th>Difficulty</th></tr></thead> <tbody><tr><td><code>navigate-tree</code></td> <td>Navigate through tree structure</td> <td>โญโญโญ Hard</td></tr> <tr><td><code>search-engine</code></td> <td>Use search interface</td> <td>โญโญ Medium</td></tr> <tr><td><code>use-autocomplete</code></td> <td>Interact with autocomplete</td> <td>โญโญโญ Hard</td></tr> <tr><td><code>book-flight</code></td> <td>Book a flight (complex form)</td> <td>โญโญโญโญ Very Hard</td></tr> <tr><td><code>choose-date</code></td> <td>Pick date from calendar</td> <td>โญโญโญ Hard</td></tr> <tr><td><code>choose-date-easy</code></td> <td>Simplified date picker</td> <td>โญโญ Medium</td></tr> <tr><td><code>choose-date-medium</code></td> <td>Medium difficulty date picker</td> <td>โญโญโญ Hard</td></tr> <tr><td><code>choose-list</code></td> <td>Select from long list</td> <td>โญโญ Medium</td></tr></tbody></table> <p data-svelte-h="svelte-ez6cur"><strong>Visual/Spatial Tasks</strong> (Requires visual understanding)</p> <table data-svelte-h="svelte-u8s9ay"><thead><tr><th>Task Name</th> <th>Description</th> <th>Difficulty</th></tr></thead> <tbody><tr><td><code>count-sides</code></td> <td>Count sides of shape</td> <td>โญโญ Medium</td></tr> <tr><td><code>count-shape</code></td> <td>Count specific shapes</td> <td>โญโญ Medium</td></tr> <tr><td><code>find-word</code></td> <td>Find word in text</td> <td>โญโญ Medium</td></tr> <tr><td><code>focus-text</code></td> <td>Focus on text element</td> <td>โญ Easy</td></tr> <tr><td><code>focus-text-2</code></td> <td>More complex focus task</td> <td>โญโญ Medium</td></tr> <tr><td><code>grid-coordinate</code></td> <td>Click grid coordinate</td> <td>โญโญ Medium</td></tr> <tr><td><code>guess-number</code></td> <td>Guess a number game</td> <td>โญโญโญ Hard</td></tr> <tr><td><code>identify-shape</code></td> <td>Identify shape type</td> <td>โญโญ Medium</td></tr> <tr><td><code>read-table</code></td> <td>Extract info from table</td> <td>โญโญโญ Hard</td></tr> <tr><td><code>read-table-2</code></td> <td>More complex table reading</td> <td>โญโญโญ Hard</td></tr></tbody></table> <p data-svelte-h="svelte-4td4c3"><strong>Email/Social Tasks</strong> (Realistic scenarios)</p> <table data-svelte-h="svelte-1umko5b"><thead><tr><th>Task Name</th> <th>Description</th> <th>Difficulty</th></tr></thead> <tbody><tr><td><code>email-inbox</code></td> <td>Manage email inbox</td> <td>โญโญโญโญ Very Hard</td></tr> <tr><td><code>email-inbox-forward</code></td> <td>Forward emails</td> <td>โญโญโญโญ Very Hard</td></tr> <tr><td><code>email-inbox-nl</code></td> <td>Natural language email task</td> <td>โญโญโญโญ Very Hard</td></tr> <tr><td><code>email-inbox-star-reply</code></td> <td>Star and reply to emails</td> <td>โญโญโญโญ Very Hard</td></tr> <tr><td><code>social-media</code></td> <td>Social media interaction</td> <td>โญโญโญโญ Very Hard</td></tr> <tr><td><code>social-media-some</code></td> <td>Partial social media task</td> <td>โญโญโญ Hard</td></tr></tbody></table> <p data-svelte-h="svelte-hg7net"><strong>Total:</strong> 100+ tasks across all categories</p> <p data-svelte-h="svelte-qbjyqk"><strong>Usage:</strong></p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class="language-python "><!-- HTML_TAG_START --><span class="hljs-comment"># Easy task for quick testing</span>
env = BrowserGymEnv(environment={<span class="hljs-string">&quot;BROWSERGYM_TASK_NAME&quot;</span>: <span class="hljs-string">&quot;click-test&quot;</span>})
<span class="hljs-comment"># Medium difficulty for training</span>
env = BrowserGymEnv(environment={<span class="hljs-string">&quot;BROWSERGYM_TASK_NAME&quot;</span>: <span class="hljs-string">&quot;click-checkboxes&quot;</span>})
<span class="hljs-comment"># Hard task for evaluation</span>
env = BrowserGymEnv(environment={<span class="hljs-string">&quot;BROWSERGYM_TASK_NAME&quot;</span>: <span class="hljs-string">&quot;email-inbox&quot;</span>})<!-- HTML_TAG_END --></pre></div> <h4 class="relative group"><a id="webarena-tasks-evaluation---812-tasks" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#webarena-tasks-evaluation---812-tasks"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>WebArena Tasks (Evaluation - 812 tasks)</span></h4> <p data-svelte-h="svelte-gm1lnx">WebArena tasks are organized by website and difficulty. Tasks are numbered 0-811.</p> <p data-svelte-h="svelte-cfbovv"><strong>By Website:</strong></p> <table data-svelte-h="svelte-xu9t75"><thead><tr><th>Website</th> <th>Task Count</th> <th>Description</th> <th>Example Tasks</th></tr></thead> <tbody><tr><td>Shopping</td> <td>~200</td> <td>E-commerce site</td> <td>Search products, add to cart, checkout</td></tr> <tr><td>Shopping Admin</td> <td>~150</td> <td>Admin panel</td> <td>Manage products, orders, customers</td></tr> <tr><td>Reddit</td> <td>~150</td> <td>Forum/social</td> <td>Post, comment, search discussions</td></tr> <tr><td>GitLab</td> <td>~200</td> <td>Code repository</td> <td>Create issues, merge requests, review code</td></tr> <tr><td>Wikipedia</td> <td>~100</td> <td>Knowledge base</td> <td>Search, read, extract information</td></tr> <tr><td>Map</td> <td>~12</td> <td>Location service</td> <td>Find places, get directions</td></tr></tbody></table> <p data-svelte-h="svelte-vx8nuh"><strong>By Difficulty:</strong></p> <table data-svelte-h="svelte-chdtdt"><thead><tr><th>Difficulty</th> <th>Task Count</th> <th>Steps Required</th> <th>Example</th></tr></thead> <tbody><tr><td>Easy</td> <td>~200</td> <td>1-5 steps</td> <td>โ€œFind the price of product Xโ€</td></tr> <tr><td>Medium</td> <td>~400</td> <td>5-15 steps</td> <td>โ€œAdd cheapest laptop to cartโ€</td></tr> <tr><td>Hard</td> <td>~212</td> <td>15+ steps</td> <td>โ€œCreate merge request for bug fixโ€</td></tr></tbody></table> <p data-svelte-h="svelte-qbjyqk"><strong>Usage:</strong></p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class="language-python "><!-- HTML_TAG_START --><span class="hljs-comment"># Task 0 (usually easy)</span>
env = BrowserGymEnv(environment={
<span class="hljs-string">&quot;BROWSERGYM_BENCHMARK&quot;</span>: <span class="hljs-string">&quot;webarena&quot;</span>,
<span class="hljs-string">&quot;BROWSERGYM_TASK_NAME&quot;</span>: <span class="hljs-string">&quot;0&quot;</span>,
<span class="hljs-string">&quot;SHOPPING&quot;</span>: <span class="hljs-string">&quot;http://your-server:7770&quot;</span>,
<span class="hljs-comment"># ... other URLs</span>
})
<span class="hljs-comment"># Task 156 (GitLab merge request)</span>
env = BrowserGymEnv(environment={
<span class="hljs-string">&quot;BROWSERGYM_BENCHMARK&quot;</span>: <span class="hljs-string">&quot;webarena&quot;</span>,
<span class="hljs-string">&quot;BROWSERGYM_TASK_NAME&quot;</span>: <span class="hljs-string">&quot;156&quot;</span>,
<span class="hljs-comment"># ... URLs</span>
})<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-lykok9"><strong>Note:</strong> WebArena tasks require the full backend infrastructure. See <a href="https://github.com/web-arena-x/webarena/tree/main/environment_docker" rel="nofollow">WebArena setup guide</a>.</p> <h4 class="relative group"><a id="visualwebarena-tasks-910-tasks" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#visualwebarena-tasks-910-tasks"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>VisualWebArena Tasks (910 tasks)</span></h4> <p data-svelte-h="svelte-p1wnan">Similar to WebArena but requires visual understanding. Tasks involve:</p> <ul data-svelte-h="svelte-13gv6ez"><li>Image-based reasoning</li> <li>Visual element identification</li> <li>Multimodal interaction (text + images)</li></ul> <h4 class="relative group"><a id="workarena-tasks" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#workarena-tasks"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>WorkArena Tasks</span></h4> <p data-svelte-h="svelte-p5p2p5">Enterprise software automation tasks:</p> <ul data-svelte-h="svelte-1aj3gtp"><li>CRM operations</li> <li>Project management</li> <li>Business workflows</li></ul> <p data-svelte-h="svelte-ghrv68"><strong>Full task lists:</strong></p> <ul data-svelte-h="svelte-1qj28u4"><li><a href="https://github.com/Farama-Foundation/miniwob-plusplus/tree/master/miniwob/environment" rel="nofollow">MiniWoB++ tasks</a></li> <li><a href="https://github.com/web-arena-x/webarena/blob/main/config_files/" rel="nofollow">WebArena tasks</a></li> <li><a href="https://github.com/ServiceNow/BrowserGym" rel="nofollow">BrowserGym documentation</a></li></ul> <h2 class="relative group"><a id="evaluation-webarena" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#evaluation-webarena"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Evaluation (WebArena)</span></h2> <h3 class="relative group"><a id="prerequisites" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#prerequisites"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Prerequisites</span></h3> <p data-svelte-h="svelte-1bru0hy">WebArena requires setting up backend infrastructure. See the <a href="https://github.com/web-arena-x/webarena/tree/main/environment_docker" rel="nofollow">WebArena documentation</a>.</p> <h3 class="relative group"><a id="usage" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#usage"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Usage</span></h3> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class="language-python "><!-- HTML_TAG_START --><span class="hljs-keyword">from</span> envs.browsergym_env <span class="hljs-keyword">import</span> BrowserGymEnv, BrowserGymAction
<span class="hljs-comment"># Create environment for WebArena evaluation</span>
env = BrowserGymEnv.from_docker_image(
<span class="hljs-string">&quot;ghcr.io/openenv/browsergym-env:latest&quot;</span>,
environment={
<span class="hljs-string">&quot;BROWSERGYM_BENCHMARK&quot;</span>: <span class="hljs-string">&quot;webarena&quot;</span>,
<span class="hljs-string">&quot;BROWSERGYM_TASK_NAME&quot;</span>: <span class="hljs-string">&quot;0&quot;</span>, <span class="hljs-comment"># Task ID</span>
<span class="hljs-comment"># WebArena backend URLs (required)</span>
<span class="hljs-string">&quot;SHOPPING&quot;</span>: <span class="hljs-string">&quot;http://your-server:7770&quot;</span>,
<span class="hljs-string">&quot;SHOPPING_ADMIN&quot;</span>: <span class="hljs-string">&quot;http://your-server:7780/admin&quot;</span>,
<span class="hljs-string">&quot;REDDIT&quot;</span>: <span class="hljs-string">&quot;http://your-server:9999&quot;</span>,
<span class="hljs-string">&quot;GITLAB&quot;</span>: <span class="hljs-string">&quot;http://your-server:8023&quot;</span>,
<span class="hljs-string">&quot;MAP&quot;</span>: <span class="hljs-string">&quot;http://your-server:3000&quot;</span>,
<span class="hljs-string">&quot;WIKIPEDIA&quot;</span>: <span class="hljs-string">&quot;http://your-server:8888/wikipedia_en_all_maxi_2022-05/A/User:The_other_Kiwix_guy/Landing&quot;</span>,
<span class="hljs-string">&quot;HOMEPAGE&quot;</span>: <span class="hljs-string">&quot;http://your-server:4399&quot;</span>,
}
)
<span class="hljs-comment"># Evaluate your trained agent</span>
result = env.reset()
<span class="hljs-keyword">while</span> <span class="hljs-keyword">not</span> result.done:
action_str = agent.get_action(result.observation)
action = BrowserGymAction(action_str=action_str)
result = env.step(action)
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Success: <span class="hljs-subst">{result.reward}</span>&quot;</span>)
env.close()<!-- HTML_TAG_END --></pre></div> <h2 class="relative group"><a id="building-the-docker-image" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#building-the-docker-image"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Building the Docker Image</span></h2> <h3 class="relative group"><a id="prerequisites" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#prerequisites"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Prerequisites</span></h3> <ol data-svelte-h="svelte-17xzk8o"><li><strong>Base Image</strong>: Build the OpenEnv base image first:</li></ol> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class="language-bash "><!-- HTML_TAG_START --><span class="hljs-comment"># From the OpenEnv repository root</span>
docker build -t openenv-base:latest -f src/openenv/core/containers/images/Dockerfile .<!-- HTML_TAG_END --></pre></div> <h3 class="relative group"><a id="build-the-browsergym-environment" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#build-the-browsergym-environment"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Build the BrowserGym Environment</span></h3> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class="language-bash "><!-- HTML_TAG_START --><span class="hljs-comment"># From the browsergym_env directory</span>
<span class="hljs-built_in">cd</span> envs/browsergym_env
docker build -t browsergym-env:latest -f server/Dockerfile .<!-- HTML_TAG_END --></pre></div> <h3 class="relative group"><a id="run-the-server" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#run-the-server"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Run the Server</span></h3> <h4 class="relative group"><a id="for-miniwob-training" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#for-miniwob-training"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>For MiniWoB (Training):</span></h4> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class="language-bash "><!-- HTML_TAG_START -->docker run -p 8000:8000 \
-e BROWSERGYM_BENCHMARK=<span class="hljs-string">&quot;miniwob&quot;</span> \
-e BROWSERGYM_TASK_NAME=<span class="hljs-string">&quot;click-test&quot;</span> \
browsergym-env:latest<!-- HTML_TAG_END --></pre></div> <h4 class="relative group"><a id="for-webarena-evaluation" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#for-webarena-evaluation"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>For WebArena (Evaluation):</span></h4> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class="language-bash "><!-- HTML_TAG_START -->docker run -p 8000:8000 \
-e BROWSERGYM_BENCHMARK=<span class="hljs-string">&quot;webarena&quot;</span> \
-e BROWSERGYM_TASK_NAME=<span class="hljs-string">&quot;0&quot;</span> \
-e SHOPPING=<span class="hljs-string">&quot;http://your-server:7770&quot;</span> \
-e SHOPPING_ADMIN=<span class="hljs-string">&quot;http://your-server:7780/admin&quot;</span> \
-e REDDIT=<span class="hljs-string">&quot;http://your-server:9999&quot;</span> \
-e GITLAB=<span class="hljs-string">&quot;http://your-server:8023&quot;</span> \
-e MAP=<span class="hljs-string">&quot;http://your-server:3000&quot;</span> \
-e WIKIPEDIA=<span class="hljs-string">&quot;http://your-server:8888/wikipedia_en_all_maxi_2022-05/A/User:The_other_Kiwix_guy/Landing&quot;</span> \
-e HOMEPAGE=<span class="hljs-string">&quot;http://your-server:4399&quot;</span> \
browsergym-env:latest<!-- HTML_TAG_END --></pre></div> <h2 class="relative group"><a id="environment-details" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#environment-details"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Environment Details</span></h2> <h3 class="relative group"><a id="action" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#action"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Action</span></h3> <p data-svelte-h="svelte-8z6dvw">Actions in BrowserGym are natural language strings that describe browser operations:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class="language-python "><!-- HTML_TAG_START --><span class="hljs-keyword">from</span> envs.browsergym_env <span class="hljs-keyword">import</span> BrowserGymAction
<span class="hljs-comment"># Click actions</span>
action = BrowserGymAction(action_str=<span class="hljs-string">&quot;click(&#x27;Submit button&#x27;)&quot;</span>)
action = BrowserGymAction(action_str=<span class="hljs-string">&quot;click(&#x27;element_id_123&#x27;)&quot;</span>)
<span class="hljs-comment"># Type actions</span>
action = BrowserGymAction(action_str=<span class="hljs-string">&quot;fill(&#x27;username&#x27;, &#x27;john@example.com&#x27;)&quot;</span>)
action = BrowserGymAction(action_str=<span class="hljs-string">&quot;fill(&#x27;password&#x27;, &#x27;secret123&#x27;)&quot;</span>)
<span class="hljs-comment"># Navigate actions</span>
action = BrowserGymAction(action_str=<span class="hljs-string">&quot;goto(&#x27;https://example.com&#x27;)&quot;</span>)
<span class="hljs-comment"># Keyboard actions</span>
action = BrowserGymAction(action_str=<span class="hljs-string">&quot;press(&#x27;Enter&#x27;)&quot;</span>)
action = BrowserGymAction(action_str=<span class="hljs-string">&quot;press(&#x27;Tab&#x27;)&quot;</span>)
<span class="hljs-comment"># Scroll actions</span>
action = BrowserGymAction(action_str=<span class="hljs-string">&quot;scroll(&#x27;down&#x27;)&quot;</span>)<!-- HTML_TAG_END --></pre></div> <h3 class="relative group"><a id="observation" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#observation"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Observation</span></h3> <p data-svelte-h="svelte-1ciua9u">Observations contain multiple modalities:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class="language-python "><!-- HTML_TAG_START -->result = env.step(action)
obs = result.observation
<span class="hljs-comment"># Text observations</span>
<span class="hljs-built_in">print</span>(obs.text) <span class="hljs-comment"># Primary text representation (AXTree or DOM)</span>
<span class="hljs-built_in">print</span>(obs.axtree_txt) <span class="hljs-comment"># Accessibility tree</span>
<span class="hljs-built_in">print</span>(obs.pruned_html) <span class="hljs-comment"># Pruned HTML (interactive elements only)</span>
<span class="hljs-comment"># Page metadata</span>
<span class="hljs-built_in">print</span>(obs.url) <span class="hljs-comment"># Current URL</span>
<span class="hljs-built_in">print</span>(obs.goal) <span class="hljs-comment"># Task goal/instruction</span>
<span class="hljs-comment"># Visual (if enabled)</span>
<span class="hljs-keyword">if</span> obs.screenshot <span class="hljs-keyword">is</span> <span class="hljs-keyword">not</span> <span class="hljs-literal">None</span>:
<span class="hljs-built_in">print</span>(obs.screenshot.shape) <span class="hljs-comment"># [height, width, channels]</span>
<span class="hljs-comment"># Error handling</span>
<span class="hljs-keyword">if</span> obs.last_action_error:
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Action failed: <span class="hljs-subst">{obs.error}</span>&quot;</span>)
<span class="hljs-comment"># Episode status</span>
<span class="hljs-built_in">print</span>(obs.done) <span class="hljs-comment"># True if episode ended</span>
<span class="hljs-built_in">print</span>(obs.reward) <span class="hljs-comment"># Reward for the step</span>
<span class="hljs-comment"># Access full BrowserGym data (includes timestamps, etc.)</span>
<span class="hljs-built_in">print</span>(obs.metadata[<span class="hljs-string">&quot;browsergym_obs&quot;</span>]) <span class="hljs-comment"># Full observation dict from BrowserGym</span>
<span class="hljs-built_in">print</span>(obs.metadata[<span class="hljs-string">&quot;browsergym_info&quot;</span>]) <span class="hljs-comment"># Full info dict (timestamps, page state, etc.)</span><!-- HTML_TAG_END --></pre></div> <h4 class="relative group"><a id="advanced-accessing-raw-browsergym-data" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#advanced-accessing-raw-browsergym-data"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Advanced: Accessing Raw BrowserGym Data</span></h4> <p data-svelte-h="svelte-700vob">For VisualWebArena or custom training, you may need additional data like timestamps or browser state. The full BrowserGym observation and info dicts are preserved in <code>metadata</code>:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class="language-python "><!-- HTML_TAG_START -->result = env.step(action)
<span class="hljs-comment"># Access timestamps (if available)</span>
info = result.observation.metadata[<span class="hljs-string">&quot;browsergym_info&quot;</span>]
<span class="hljs-keyword">if</span> <span class="hljs-string">&quot;timestamp&quot;</span> <span class="hljs-keyword">in</span> info:
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Action timestamp: <span class="hljs-subst">{info[<span class="hljs-string">&#x27;timestamp&#x27;</span>]}</span>&quot;</span>)
<span class="hljs-comment"># Access additional observation fields</span>
obs_dict = result.observation.metadata[<span class="hljs-string">&quot;browsergym_obs&quot;</span>]
<span class="hljs-keyword">if</span> <span class="hljs-string">&quot;dom_object&quot;</span> <span class="hljs-keyword">in</span> obs_dict:
dom = obs_dict[<span class="hljs-string">&quot;dom_object&quot;</span>]
<span class="hljs-comment"># Work with raw DOM object</span>
<span class="hljs-comment"># Access page performance data</span>
<span class="hljs-keyword">if</span> <span class="hljs-string">&quot;performance&quot;</span> <span class="hljs-keyword">in</span> info:
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Page load time: <span class="hljs-subst">{info[<span class="hljs-string">&#x27;performance&#x27;</span>]}</span>&quot;</span>)<!-- HTML_TAG_END --></pre></div> <h3 class="relative group"><a id="state" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#state"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>State</span></h3> <p data-svelte-h="svelte-onfcfm">The environment state tracks progress:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class="language-python "><!-- HTML_TAG_START -->state = env.state()
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Benchmark: <span class="hljs-subst">{state.benchmark}</span>&quot;</span>) <span class="hljs-comment"># &#x27;miniwob&#x27;, &#x27;webarena&#x27;, etc.</span>
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Task: <span class="hljs-subst">{state.task_name}</span>&quot;</span>) <span class="hljs-comment"># Task name/ID</span>
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Episode: <span class="hljs-subst">{state.episode_id}</span>&quot;</span>) <span class="hljs-comment"># Unique episode ID</span>
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Steps: <span class="hljs-subst">{state.step_count}</span>&quot;</span>) <span class="hljs-comment"># Number of steps taken</span>
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Total Reward: <span class="hljs-subst">{state.cum_reward}</span>&quot;</span>) <span class="hljs-comment"># Cumulative reward</span>
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Goal: <span class="hljs-subst">{state.goal}</span>&quot;</span>) <span class="hljs-comment"># Task instruction</span>
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;URL: <span class="hljs-subst">{state.current_url}</span>&quot;</span>) <span class="hljs-comment"># Current page URL</span><!-- HTML_TAG_END --></pre></div> <h2 class="relative group"><a id="configuration" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#configuration"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Configuration</span></h2> <p data-svelte-h="svelte-oyf8l6">Environment variables:</p> <h3 class="relative group"><a id="common-settings" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#common-settings"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Common Settings</span></h3> <ul data-svelte-h="svelte-1hnemjt"><li><code>BROWSERGYM_BENCHMARK</code>: Benchmark to use (<code>miniwob</code>, <code>webarena</code>, <code>visualwebarena</code>, <code>workarena</code>)</li> <li><code>BROWSERGYM_TASK_NAME</code>: Specific task name (optional, will use first available if not set)</li> <li><code>BROWSERGYM_HEADLESS</code>: Run browser in headless mode (default: <code>true</code>)</li> <li><code>BROWSERGYM_VIEWPORT_WIDTH</code>: Browser viewport width (default: <code>1280</code>)</li> <li><code>BROWSERGYM_VIEWPORT_HEIGHT</code>: Browser viewport height (default: <code>720</code>)</li> <li><code>BROWSERGYM_TIMEOUT</code>: Action timeout in milliseconds (default: <code>10000</code>)</li></ul> <h3 class="relative group"><a id="webarena-specific-only-needed-for-webarena-benchmark" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#webarena-specific-only-needed-for-webarena-benchmark"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>WebArena-Specific (only needed for WebArena benchmark)</span></h3> <ul data-svelte-h="svelte-6prvrb"><li><code>SHOPPING</code>: Shopping website URL</li> <li><code>SHOPPING_ADMIN</code>: Shopping admin panel URL</li> <li><code>REDDIT</code>: Reddit-like forum URL</li> <li><code>GITLAB</code>: GitLab instance URL</li> <li><code>MAP</code>: Map service URL</li> <li><code>WIKIPEDIA</code>: Wikipedia instance URL</li> <li><code>HOMEPAGE</code>: Homepage URL</li></ul> <h2 class="relative group"><a id="supported-benchmarks" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#supported-benchmarks"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Supported Benchmarks</span></h2> <h3 class="relative group"><a id="1-miniwob-training--recommended-for-training" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#1-miniwob-training--recommended-for-training"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>1. MiniWoB++ (Training) โœ… Recommended for Training</span></h3> <ul data-svelte-h="svelte-7w8uv4"><li><strong>100+ tasks</strong> ranging from simple (click buttons) to complex (form filling, navigation)</li> <li><strong>Fast</strong>: Instant resets, quick episodes</li> <li><strong>Randomized</strong>: Task variations for generalization</li> <li><strong>No setup</strong>: Works out-of-the-box</li> <li><strong>Dense rewards</strong>: Immediate feedback for learning</li></ul> <p data-svelte-h="svelte-1af4vl4"><strong>Use Case</strong>: Train agents on fundamental web navigation skills</p> <h3 class="relative group"><a id="2-webarena-evaluation--benchmark" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#2-webarena-evaluation--benchmark"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>2. WebArena (Evaluation) ๐Ÿ“Š Benchmark</span></h3> <ul data-svelte-h="svelte-1bfjgwe"><li><strong>812 realistic tasks</strong> across 6 websites</li> <li><strong>Complex</strong>: Multi-step reasoning, real web interfaces</li> <li><strong>Requires setup</strong>: Need to run 7 backend services</li> <li><strong>Sparse rewards</strong>: Binary success/failure</li> <li><strong>Evaluation-focused</strong>: Test real-world performance</li></ul> <p data-svelte-h="svelte-1x459lg"><strong>Use Case</strong>: Evaluate agents on realistic web tasks</p> <h3 class="relative group"><a id="3-visualwebarena-evaluation--visual-benchmark" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#3-visualwebarena-evaluation--visual-benchmark"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>3. VisualWebArena (Evaluation) ๐Ÿ‘๏ธ Visual Benchmark</span></h3> <ul data-svelte-h="svelte-161rl0i"><li><strong>910 tasks</strong> requiring visual understanding</li> <li><strong>Multimodal</strong>: Both text and visual observations</li> <li><strong>Requires setup</strong>: Similar to WebArena</li> <li><strong>Challenging</strong>: Requires visual reasoning</li></ul> <p data-svelte-h="svelte-1yu5tgm"><strong>Use Case</strong>: Test visual web navigation capabilities</p> <h3 class="relative group"><a id="4-workarena-evaluation--enterprise-benchmark" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#4-workarena-evaluation--enterprise-benchmark"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>4. WorkArena (Evaluation) ๐Ÿ’ผ Enterprise Benchmark</span></h3> <ul data-svelte-h="svelte-12jyl0y"><li><strong>Enterprise tasks</strong>: CRM, project management, etc.</li> <li><strong>Realistic workflows</strong>: Real enterprise software</li> <li><strong>Requires setup</strong>: Enterprise software instances</li></ul> <p data-svelte-h="svelte-1ehpgyd"><strong>Use Case</strong>: Evaluate on business automation tasks</p> <h2 class="relative group"><a id="typical-training-pipeline" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#typical-training-pipeline"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Typical Training Pipeline</span></h2> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class="language-python "><!-- HTML_TAG_START --><span class="hljs-keyword">from</span> envs.browsergym_env <span class="hljs-keyword">import</span> BrowserGymEnv, BrowserGymAction
<span class="hljs-comment"># Stage 1: Train on MiniWoB (simple tasks, fast)</span>
train_env = BrowserGymEnv.from_docker_image(
<span class="hljs-string">&quot;browsergym-env:latest&quot;</span>,
environment={
<span class="hljs-string">&quot;BROWSERGYM_BENCHMARK&quot;</span>: <span class="hljs-string">&quot;miniwob&quot;</span>,
<span class="hljs-string">&quot;BROWSERGYM_TASK_NAME&quot;</span>: <span class="hljs-string">&quot;click-button&quot;</span>,
}
)
<span class="hljs-comment"># Train your agent (RL, imitation learning, etc.)</span>
agent.train(train_env, num_episodes=<span class="hljs-number">10000</span>)
train_env.close()
<span class="hljs-comment"># Stage 2: Evaluate on WebArena (complex tasks, realistic)</span>
eval_env = BrowserGymEnv.from_docker_image(
<span class="hljs-string">&quot;browsergym-env:latest&quot;</span>,
environment={
<span class="hljs-string">&quot;BROWSERGYM_BENCHMARK&quot;</span>: <span class="hljs-string">&quot;webarena&quot;</span>,
<span class="hljs-string">&quot;BROWSERGYM_TASK_NAME&quot;</span>: <span class="hljs-string">&quot;0&quot;</span>,
<span class="hljs-comment"># ... WebArena URLs</span>
}
)
<span class="hljs-comment"># Test performance</span>
success_rate = agent.evaluate(eval_env, num_tasks=<span class="hljs-number">812</span>)
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;WebArena Success Rate: <span class="hljs-subst">{success_rate:<span class="hljs-number">.2</span>%}</span>&quot;</span>)
eval_env.close()<!-- HTML_TAG_END --></pre></div> <h2 class="relative group"><a id="development--testing" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#development--testing"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Development &amp; Testing</span></h2> <h3 class="relative group"><a id="running-tests" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#running-tests"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Running Tests</span></h3> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class="language-bash "><!-- HTML_TAG_START --><span class="hljs-comment"># From the OpenEnv repository root</span>
pytest tests/envs/test_browsergym_env.py<!-- HTML_TAG_END --></pre></div> <h3 class="relative group"><a id="local-development" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#local-development"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Local Development</span></h3> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class="language-bash "><!-- HTML_TAG_START --><span class="hljs-comment"># Install in development mode</span>
<span class="hljs-built_in">cd</span> /path/to/OpenEnv
pip install -e .
<span class="hljs-comment"># Install BrowserGym</span>
pip install browsergym browsergym-miniwob browsergym-webarena
<span class="hljs-comment"># Run the server locally</span>
<span class="hljs-built_in">cd</span> envs/browsergym_env/server
<span class="hljs-built_in">export</span> BROWSERGYM_BENCHMARK=miniwob
<span class="hljs-built_in">export</span> BROWSERGYM_TASK_NAME=click-test
python app.py<!-- HTML_TAG_END --></pre></div> <h2 class="relative group"><a id="project-structure" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#project-structure"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Project Structure</span></h2> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=" "><!-- HTML_TAG_START -->browsergym_env/
โ”œโ”€โ”€ __init__.py <span class="hljs-meta"># Module exports</span>
โ”œโ”€โ”€ models.py <span class="hljs-meta"># Action, Observation, State dataclasses</span>
โ”œโ”€โ”€ <span class="hljs-keyword">client</span>.py <span class="hljs-meta"># HTTPEnvClient implementation</span>
โ”œโ”€โ”€ README.md <span class="hljs-meta"># This file</span>
โ””โ”€โ”€ <span class="hljs-keyword">server</span>/
โ”œโ”€โ”€ __init__.py
โ”œโ”€โ”€ app.py <span class="hljs-meta"># FastAPI application</span>
โ”œโ”€โ”€ browsergym_environment.py <span class="hljs-meta"># Environment implementation</span>
โ”œโ”€โ”€ Dockerfile <span class="hljs-meta"># Container specification</span>
โ””โ”€โ”€ requirements.txt <span class="hljs-meta"># Python dependencies</span><!-- HTML_TAG_END --></pre></div> <h2 class="relative group"><a id="references" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#references"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>References</span></h2> <ul data-svelte-h="svelte-ezss8r"><li><a href="https://github.com/ServiceNow/BrowserGym" rel="nofollow">BrowserGym GitHub</a></li> <li><a href="https://arxiv.org/abs/1802.08802" rel="nofollow">MiniWoB++ Paper</a></li> <li><a href="https://arxiv.org/abs/2307.13854" rel="nofollow">WebArena Paper</a></li> <li><a href="https://webarena.dev/" rel="nofollow">WebArena Website</a></li> <li><a href="https://jykoh.com/vwa" rel="nofollow">VisualWebArena Paper</a></li> <li><a href="https://github.com/huggingface/OpenEnv" rel="nofollow">OpenEnv Documentation</a></li></ul> <a class="!text-gray-400 !no-underline text-sm flex items-center not-prose mt-4" href="https://github.com/huggingface/openenv/blob/main/docs/source/environments/browsergym.md" target="_blank"><svg class="mr-1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M31,16l-7,7l-1.41-1.41L28.17,16l-5.58-5.59L24,9l7,7z"></path><path d="M1,16l7-7l1.41,1.41L3.83,16l5.58,5.59L8,23l-7-7z"></path><path d="M12.419,25.484L17.639,6.552l1.932,0.518L14.351,26.002z"></path></svg> <span data-svelte-h="svelte-zjs2n5"><span class="underline">Update</span> on GitHub</span></a> <p></p>
<script>
{
__sveltekit_1l28dw0 = {
assets: "/docs/openenv/pr_813/en",
base: "/docs/openenv/pr_813/en",
env: {}
};
const element = document.currentScript.parentElement;
const data = [null,null];
Promise.all([
import("/docs/openenv/pr_813/en/_app/immutable/entry/start.9c9d6cdf.js"),
import("/docs/openenv/pr_813/en/_app/immutable/entry/app.b8b7485a.js")
]).then(([kit, app]) => {
kit.start(app, element, {
node_ids: [0, 6],
data,
form: null,
error: null
});
});
}
</script>

Xet Storage Details

Size:
113 kB
ยท
Xet hash:
e054202d09f099bc2d404afe0830f90475b150e90b3646d0b7004004ccf76db9

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.