You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Preserve full BrowserGym observation data in metadata
For VisualWebArena and advanced training scenarios, users may need access
to additional data like timestamps, browser state, or custom fields that
BrowserGym provides.
Changes:
- Store full 'obs' and 'info' dicts from BrowserGym in observation.metadata
- Accessible via metadata['browsergym_obs'] and metadata['browsergym_info']
- Common fields still extracted to top-level for convenience
- Added documentation showing how to access timestamps, DOM objects, etc.
This ensures no information loss while maintaining a clean API.
The environment exposes everything BrowserGym provides - users can access
whatever they need for training.
Copy file name to clipboardExpand all lines: src/envs/browsergym_env/README.md
+27Lines changed: 27 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -348,6 +348,33 @@ if obs.last_action_error:
348
348
# Episode status
349
349
print(obs.done) # True if episode ended
350
350
print(obs.reward) # Reward for the step
351
+
352
+
# Access full BrowserGym data (includes timestamps, etc.)
353
+
print(obs.metadata["browsergym_obs"]) # Full observation dict from BrowserGym
354
+
print(obs.metadata["browsergym_info"]) # Full info dict (timestamps, page state, etc.)
355
+
```
356
+
357
+
#### Advanced: Accessing Raw BrowserGym Data
358
+
359
+
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 `metadata`:
360
+
361
+
```python
362
+
result = env.step(action)
363
+
364
+
# Access timestamps (if available)
365
+
info = result.observation.metadata["browsergym_info"]
0 commit comments