API Reference
hud.gym
API reference for creating environments
The hud.gym
module provides the core function for creating Environment instances.
Module Functions
make
Creates and initializes an Environment instance based on a specification.
This function handles selecting the correct client (local docker, remote docker, remote direct) based on the env_src
, automatically linking to an active Job (from @job
decorator or the job
parameter), and running the initial Task setup if env_src
is a Task
.
Parameters:
env_src
(Gym
|Task
): The source specification for the environment.- If a
str
(Gym ID like"hud-browser"
,"OSWorld-Ubuntu"
), creates a standard remote environment. - If a
CustomGym
object, creates a custom environment based on its definition (local or remote docker). - If a
Task
object, uses thetask.gym
attribute to determine the environment type and automatically runstask.setup
after creation.
- If a
job
(Job
| None, optional): A specific Job object to associate this environment run with. IfNone
, it attempts to find an active job created by the@job
decorator.metadata
(dict[str, Any] | None, optional): Additional metadata to attach to the environment instance and its resulting trajectory.
Returns:
Environment
: An initialized environment instance ready for interaction (e.g., callingenv.step()
).