Environment
Understanding HUD Environments
Environment
An Environment
in the HUD SDK represents a running instance where an agent can interact with a task. It provides methods for observation, action, and built-in telemetry to record the agent’s interactions.
Overview
Environments are the core runtime instances where agents perform tasks. Key features include:
- Gymnasium-compatible interface for agent interaction
- Built-in telemetry to record actions and observations
- Methods to evaluate agent performance
- Support for video generation of agent interactions
- Automatic trajectory creation for later analysis
Initialization
Environments are created using the gym module:
Key Methods
The Environment
class provides several key methods:
Reset
Resets the environment to a specific task:
Step
Takes an action in the environment and returns the new state:
Evaluate
Evaluates the current task:
Get Trajectory
Retrieves the trajectory record of the agent’s interactions:
Close
Closes the environment:
Observations
Observations from the environment include:
screenshot
: A base64-encoded PNG image of the current screentext
: Text observation from the environmentstate
: Additional state information specific to the environment type
Environment States
An environment can be in one of several states:
creating
: The environment is being createdrunning
: The environment is running and ready for interactionerror
: An error occurred during environment creation or executionclosed
: The environment has been closed
VNC Access
For debugging purposes, you can view the environment directly via VNC:
Related Concepts
- Task - The configuration that defines what the agent needs to accomplish
- Trajectory - The record of agent interactions in the environment
- Job - Groups of related trajectories across multiple tasks