File size: 2,144 Bytes
88ac8ef
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
"""BrowserGym Environment for OpenEnv.

BrowserGym is a unified framework for web-based agent tasks that provides
access to multiple benchmarks under a single Gymnasium-compatible API.

Included Benchmarks:
- **MiniWoB++**: 100+ simple web tasks for training (no external infrastructure!)
- **WebArena**: 812 realistic evaluation tasks (requires backend setup)
- **VisualWebArena**: Visual web navigation tasks
- **WorkArena**: Enterprise task automation

Key Features:
- Unified API across all benchmarks
- Gymnasium-compatible interface
- Support for multiple observation types (text, visual, DOM)
- Action spaces for natural language commands
- Perfect for training (MiniWoB) and evaluation (WebArena)

Training Example (MiniWoB - works immediately):
    ```python
    from envs.browsergym_env import BrowserGymEnv, BrowserGymAction

    # Create training environment - no backend setup needed!
    env = BrowserGymEnv.from_docker_image(
        "browsergym-env:latest",
        environment={
            "BROWSERGYM_BENCHMARK": "miniwob",
            "BROWSERGYM_TASK_NAME": "click-test",
        }
    )

    # Train your agent
    for episode in range(1000):
        result = env.reset()
        while not result.done:
            action = agent.get_action(result.observation)
            result = env.step(action)

    env.close()
    ```

Evaluation Example (WebArena - requires backend):
    ```python
    from envs.browsergym_env import BrowserGymEnv, BrowserGymAction

    # Create evaluation environment
    env = BrowserGymEnv.from_docker_image(
        "browsergym-env:latest",
        environment={
            "BROWSERGYM_BENCHMARK": "webarena",
            "BROWSERGYM_TASK_NAME": "0",
            "SHOPPING": "http://your-server:7770",
            # ... other backend URLs
        }
    )

    # Evaluate your trained agent
    result = env.reset()
    # ... run evaluation
    env.close()
    ```
"""

from .client import BrowserGymEnv
from .models import BrowserGymAction, BrowserGymObservation, BrowserGymState

__all__ = [
    "BrowserGymEnv",
    "BrowserGymAction",
    "BrowserGymObservation",
    "BrowserGymState",
]