Buckets:
| <meta charset="utf-8" /><meta name="hf:doc:metadata" content="{"title":"BrowserGym Environment","local":"browsergym-environment","sections":[{"title":"Why BrowserGym?","local":"why-browsergym","sections":[],"depth":2},{"title":"Quick Start - Training (MiniWoB)","local":"quick-start---training-miniwob","sections":[{"title":"No Setup Required! ๐","local":"no-setup-required-","sections":[],"depth":3}],"depth":2},{"title":"Harness Sessions for TRL","local":"harness-sessions-for-trl","sections":[{"title":"Available Tasks by Benchmark","local":"available-tasks-by-benchmark","sections":[{"title":"MiniWoB++ Tasks (Training - 100+ tasks)","local":"miniwob-tasks-training---100-tasks","sections":[],"depth":4},{"title":"WebArena Tasks (Evaluation - 812 tasks)","local":"webarena-tasks-evaluation---812-tasks","sections":[],"depth":4},{"title":"VisualWebArena Tasks (910 tasks)","local":"visualwebarena-tasks-910-tasks","sections":[],"depth":4},{"title":"WorkArena Tasks","local":"workarena-tasks","sections":[],"depth":4}],"depth":3}],"depth":2},{"title":"Evaluation (WebArena)","local":"evaluation-webarena","sections":[{"title":"Prerequisites","local":"prerequisites","sections":[],"depth":3},{"title":"Usage","local":"usage","sections":[],"depth":3}],"depth":2},{"title":"Building the Docker Image","local":"building-the-docker-image","sections":[{"title":"Prerequisites","local":"prerequisites","sections":[],"depth":3},{"title":"Build the BrowserGym Environment","local":"build-the-browsergym-environment","sections":[],"depth":3},{"title":"Run the Server","local":"run-the-server","sections":[{"title":"For MiniWoB (Training):","local":"for-miniwob-training","sections":[],"depth":4},{"title":"For WebArena (Evaluation):","local":"for-webarena-evaluation","sections":[],"depth":4}],"depth":3}],"depth":2},{"title":"Environment Details","local":"environment-details","sections":[{"title":"Action","local":"action","sections":[],"depth":3},{"title":"Observation","local":"observation","sections":[{"title":"Advanced: Accessing Raw BrowserGym Data","local":"advanced-accessing-raw-browsergym-data","sections":[],"depth":4}],"depth":3},{"title":"State","local":"state","sections":[],"depth":3}],"depth":2},{"title":"Configuration","local":"configuration","sections":[{"title":"Common Settings","local":"common-settings","sections":[],"depth":3},{"title":"WebArena-Specific (only needed for WebArena benchmark)","local":"webarena-specific-only-needed-for-webarena-benchmark","sections":[],"depth":3}],"depth":2},{"title":"Supported Benchmarks","local":"supported-benchmarks","sections":[{"title":"1. MiniWoB++ (Training) โ Recommended for Training","local":"1-miniwob-training--recommended-for-training","sections":[],"depth":3},{"title":"2. WebArena (Evaluation) ๐ Benchmark","local":"2-webarena-evaluation--benchmark","sections":[],"depth":3},{"title":"3. VisualWebArena (Evaluation) ๐๏ธ Visual Benchmark","local":"3-visualwebarena-evaluation--visual-benchmark","sections":[],"depth":3},{"title":"4. WorkArena (Evaluation) ๐ผ Enterprise Benchmark","local":"4-workarena-evaluation--enterprise-benchmark","sections":[],"depth":3}],"depth":2},{"title":"Typical Training Pipeline","local":"typical-training-pipeline","sections":[],"depth":2},{"title":"Development & Testing","local":"development--testing","sections":[{"title":"Running Tests","local":"running-tests","sections":[],"depth":3},{"title":"Local Development","local":"local-development","sections":[],"depth":3}],"depth":2},{"title":"Project Structure","local":"project-structure","sections":[],"depth":2},{"title":"References","local":"references","sections":[],"depth":2}],"depth":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="{"title":"BrowserGym Environment","local":"browsergym-environment","sections":[{"title":"Why BrowserGym?","local":"why-browsergym","sections":[],"depth":2},{"title":"Quick Start - Training (MiniWoB)","local":"quick-start---training-miniwob","sections":[{"title":"No Setup Required! ๐","local":"no-setup-required-","sections":[],"depth":3}],"depth":2},{"title":"Harness Sessions for TRL","local":"harness-sessions-for-trl","sections":[{"title":"Available Tasks by Benchmark","local":"available-tasks-by-benchmark","sections":[{"title":"MiniWoB++ Tasks (Training - 100+ tasks)","local":"miniwob-tasks-training---100-tasks","sections":[],"depth":4},{"title":"WebArena Tasks (Evaluation - 812 tasks)","local":"webarena-tasks-evaluation---812-tasks","sections":[],"depth":4},{"title":"VisualWebArena Tasks (910 tasks)","local":"visualwebarena-tasks-910-tasks","sections":[],"depth":4},{"title":"WorkArena Tasks","local":"workarena-tasks","sections":[],"depth":4}],"depth":3}],"depth":2},{"title":"Evaluation (WebArena)","local":"evaluation-webarena","sections":[{"title":"Prerequisites","local":"prerequisites","sections":[],"depth":3},{"title":"Usage","local":"usage","sections":[],"depth":3}],"depth":2},{"title":"Building the Docker Image","local":"building-the-docker-image","sections":[{"title":"Prerequisites","local":"prerequisites","sections":[],"depth":3},{"title":"Build the BrowserGym Environment","local":"build-the-browsergym-environment","sections":[],"depth":3},{"title":"Run the Server","local":"run-the-server","sections":[{"title":"For MiniWoB (Training):","local":"for-miniwob-training","sections":[],"depth":4},{"title":"For WebArena (Evaluation):","local":"for-webarena-evaluation","sections":[],"depth":4}],"depth":3}],"depth":2},{"title":"Environment Details","local":"environment-details","sections":[{"title":"Action","local":"action","sections":[],"depth":3},{"title":"Observation","local":"observation","sections":[{"title":"Advanced: Accessing Raw BrowserGym Data","local":"advanced-accessing-raw-browsergym-data","sections":[],"depth":4}],"depth":3},{"title":"State","local":"state","sections":[],"depth":3}],"depth":2},{"title":"Configuration","local":"configuration","sections":[{"title":"Common Settings","local":"common-settings","sections":[],"depth":3},{"title":"WebArena-Specific (only needed for WebArena benchmark)","local":"webarena-specific-only-needed-for-webarena-benchmark","sections":[],"depth":3}],"depth":2},{"title":"Supported Benchmarks","local":"supported-benchmarks","sections":[{"title":"1. MiniWoB++ (Training) โ Recommended for Training","local":"1-miniwob-training--recommended-for-training","sections":[],"depth":3},{"title":"2. WebArena (Evaluation) ๐ Benchmark","local":"2-webarena-evaluation--benchmark","sections":[],"depth":3},{"title":"3. VisualWebArena (Evaluation) ๐๏ธ Visual Benchmark","local":"3-visualwebarena-evaluation--visual-benchmark","sections":[],"depth":3},{"title":"4. WorkArena (Evaluation) ๐ผ Enterprise Benchmark","local":"4-workarena-evaluation--enterprise-benchmark","sections":[],"depth":3}],"depth":2},{"title":"Typical Training Pipeline","local":"typical-training-pipeline","sections":[],"depth":2},{"title":"Development & Testing","local":"development--testing","sections":[{"title":"Running Tests","local":"running-tests","sections":[],"depth":3},{"title":"Local Development","local":"local-development","sections":[],"depth":3}],"depth":2},{"title":"Project Structure","local":"project-structure","sections":[],"depth":2},{"title":"References","local":"references","sections":[],"depth":2}],"depth":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">"ghcr.io/openenv/browsergym-env:latest"</span>, | |
| environment={ | |
| <span class="hljs-string">"BROWSERGYM_BENCHMARK"</span>: <span class="hljs-string">"miniwob"</span>, | |
| <span class="hljs-string">"BROWSERGYM_TASK_NAME"</span>: <span class="hljs-string">"click-test"</span>, <span class="hljs-comment"># or "click-button", "click-dialog", 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"Goal: <span class="hljs-subst">{result.observation.goal}</span>"</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"Reward: <span class="hljs-subst">{result.reward}</span>"</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">"https://openenv-browsergym-env.hf.space"</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">"BROWSERGYM_TASK_NAME"</span>: <span class="hljs-string">"click-test"</span>}) | |
| <span class="hljs-comment"># Medium difficulty for training</span> | |
| env = BrowserGymEnv(environment={<span class="hljs-string">"BROWSERGYM_TASK_NAME"</span>: <span class="hljs-string">"click-checkboxes"</span>}) | |
| <span class="hljs-comment"># Hard task for evaluation</span> | |
| env = BrowserGymEnv(environment={<span class="hljs-string">"BROWSERGYM_TASK_NAME"</span>: <span class="hljs-string">"email-inbox"</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">"BROWSERGYM_BENCHMARK"</span>: <span class="hljs-string">"webarena"</span>, | |
| <span class="hljs-string">"BROWSERGYM_TASK_NAME"</span>: <span class="hljs-string">"0"</span>, | |
| <span class="hljs-string">"SHOPPING"</span>: <span class="hljs-string">"http://your-server:7770"</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">"BROWSERGYM_BENCHMARK"</span>: <span class="hljs-string">"webarena"</span>, | |
| <span class="hljs-string">"BROWSERGYM_TASK_NAME"</span>: <span class="hljs-string">"156"</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">"ghcr.io/openenv/browsergym-env:latest"</span>, | |
| environment={ | |
| <span class="hljs-string">"BROWSERGYM_BENCHMARK"</span>: <span class="hljs-string">"webarena"</span>, | |
| <span class="hljs-string">"BROWSERGYM_TASK_NAME"</span>: <span class="hljs-string">"0"</span>, <span class="hljs-comment"># Task ID</span> | |
| <span class="hljs-comment"># WebArena backend URLs (required)</span> | |
| <span class="hljs-string">"SHOPPING"</span>: <span class="hljs-string">"http://your-server:7770"</span>, | |
| <span class="hljs-string">"SHOPPING_ADMIN"</span>: <span class="hljs-string">"http://your-server:7780/admin"</span>, | |
| <span class="hljs-string">"REDDIT"</span>: <span class="hljs-string">"http://your-server:9999"</span>, | |
| <span class="hljs-string">"GITLAB"</span>: <span class="hljs-string">"http://your-server:8023"</span>, | |
| <span class="hljs-string">"MAP"</span>: <span class="hljs-string">"http://your-server:3000"</span>, | |
| <span class="hljs-string">"WIKIPEDIA"</span>: <span class="hljs-string">"http://your-server:8888/wikipedia_en_all_maxi_2022-05/A/User:The_other_Kiwix_guy/Landing"</span>, | |
| <span class="hljs-string">"HOMEPAGE"</span>: <span class="hljs-string">"http://your-server:4399"</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"Success: <span class="hljs-subst">{result.reward}</span>"</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">"miniwob"</span> \ | |
| -e BROWSERGYM_TASK_NAME=<span class="hljs-string">"click-test"</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">"webarena"</span> \ | |
| -e BROWSERGYM_TASK_NAME=<span class="hljs-string">"0"</span> \ | |
| -e SHOPPING=<span class="hljs-string">"http://your-server:7770"</span> \ | |
| -e SHOPPING_ADMIN=<span class="hljs-string">"http://your-server:7780/admin"</span> \ | |
| -e REDDIT=<span class="hljs-string">"http://your-server:9999"</span> \ | |
| -e GITLAB=<span class="hljs-string">"http://your-server:8023"</span> \ | |
| -e MAP=<span class="hljs-string">"http://your-server:3000"</span> \ | |
| -e WIKIPEDIA=<span class="hljs-string">"http://your-server:8888/wikipedia_en_all_maxi_2022-05/A/User:The_other_Kiwix_guy/Landing"</span> \ | |
| -e HOMEPAGE=<span class="hljs-string">"http://your-server:4399"</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">"click('Submit button')"</span>) | |
| action = BrowserGymAction(action_str=<span class="hljs-string">"click('element_id_123')"</span>) | |
| <span class="hljs-comment"># Type actions</span> | |
| action = BrowserGymAction(action_str=<span class="hljs-string">"fill('username', 'john@example.com')"</span>) | |
| action = BrowserGymAction(action_str=<span class="hljs-string">"fill('password', 'secret123')"</span>) | |
| <span class="hljs-comment"># Navigate actions</span> | |
| action = BrowserGymAction(action_str=<span class="hljs-string">"goto('https://example.com')"</span>) | |
| <span class="hljs-comment"># Keyboard actions</span> | |
| action = BrowserGymAction(action_str=<span class="hljs-string">"press('Enter')"</span>) | |
| action = BrowserGymAction(action_str=<span class="hljs-string">"press('Tab')"</span>) | |
| <span class="hljs-comment"># Scroll actions</span> | |
| action = BrowserGymAction(action_str=<span class="hljs-string">"scroll('down')"</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"Action failed: <span class="hljs-subst">{obs.error}</span>"</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">"browsergym_obs"</span>]) <span class="hljs-comment"># Full observation dict from BrowserGym</span> | |
| <span class="hljs-built_in">print</span>(obs.metadata[<span class="hljs-string">"browsergym_info"</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">"browsergym_info"</span>] | |
| <span class="hljs-keyword">if</span> <span class="hljs-string">"timestamp"</span> <span class="hljs-keyword">in</span> info: | |
| <span class="hljs-built_in">print</span>(<span class="hljs-string">f"Action timestamp: <span class="hljs-subst">{info[<span class="hljs-string">'timestamp'</span>]}</span>"</span>) | |
| <span class="hljs-comment"># Access additional observation fields</span> | |
| obs_dict = result.observation.metadata[<span class="hljs-string">"browsergym_obs"</span>] | |
| <span class="hljs-keyword">if</span> <span class="hljs-string">"dom_object"</span> <span class="hljs-keyword">in</span> obs_dict: | |
| dom = obs_dict[<span class="hljs-string">"dom_object"</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">"performance"</span> <span class="hljs-keyword">in</span> info: | |
| <span class="hljs-built_in">print</span>(<span class="hljs-string">f"Page load time: <span class="hljs-subst">{info[<span class="hljs-string">'performance'</span>]}</span>"</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"Benchmark: <span class="hljs-subst">{state.benchmark}</span>"</span>) <span class="hljs-comment"># 'miniwob', 'webarena', etc.</span> | |
| <span class="hljs-built_in">print</span>(<span class="hljs-string">f"Task: <span class="hljs-subst">{state.task_name}</span>"</span>) <span class="hljs-comment"># Task name/ID</span> | |
| <span class="hljs-built_in">print</span>(<span class="hljs-string">f"Episode: <span class="hljs-subst">{state.episode_id}</span>"</span>) <span class="hljs-comment"># Unique episode ID</span> | |
| <span class="hljs-built_in">print</span>(<span class="hljs-string">f"Steps: <span class="hljs-subst">{state.step_count}</span>"</span>) <span class="hljs-comment"># Number of steps taken</span> | |
| <span class="hljs-built_in">print</span>(<span class="hljs-string">f"Total Reward: <span class="hljs-subst">{state.cum_reward}</span>"</span>) <span class="hljs-comment"># Cumulative reward</span> | |
| <span class="hljs-built_in">print</span>(<span class="hljs-string">f"Goal: <span class="hljs-subst">{state.goal}</span>"</span>) <span class="hljs-comment"># Task instruction</span> | |
| <span class="hljs-built_in">print</span>(<span class="hljs-string">f"URL: <span class="hljs-subst">{state.current_url}</span>"</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">"browsergym-env:latest"</span>, | |
| environment={ | |
| <span class="hljs-string">"BROWSERGYM_BENCHMARK"</span>: <span class="hljs-string">"miniwob"</span>, | |
| <span class="hljs-string">"BROWSERGYM_TASK_NAME"</span>: <span class="hljs-string">"click-button"</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">"browsergym-env:latest"</span>, | |
| environment={ | |
| <span class="hljs-string">"BROWSERGYM_BENCHMARK"</span>: <span class="hljs-string">"webarena"</span>, | |
| <span class="hljs-string">"BROWSERGYM_TASK_NAME"</span>: <span class="hljs-string">"0"</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"WebArena Success Rate: <span class="hljs-subst">{success_rate:<span class="hljs-number">.2</span>%}</span>"</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 & 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.