API Reference
hud.trajectory
API reference for Trajectory and TrajectoryStep classes
The hud.trajectory
module provides classes for representing recorded environment interactions.
See the Trajectory Concepts page for explanations and usage examples, particularly how trajectories are accessed via Job.load_trajectories()
.
Classes
Trajectory
Represents the complete record of a single environment run, typically associated with a Job. Contains metadata about the run and a list of individual steps.
Attributes:
id
(str): Unique identifier for this trajectory run.reward
(float | None): The final evaluation score returned byenv.evaluate()
for this run.logs
(str | None): Captured logs from the environment run.error
(str | None): Error message if the run terminated unexpectedly.trajectory
(list[TrajectoryStep
]): A list containing the data for each step recorded during the run.
Methods:
display(self)
: Renders a basic visualization of the trajectory steps within a Jupyter environment (attempts to display images and actions).
TrajectoryStep
Represents the data captured for a single step within a Trajectory
.
Attributes:
observation_url
(str | None): URL to the screenshot image captured as the observation for this step.observation_text
(str | None): Text captured as the observation for this step.actions
(list[dict]): List of action(s) (in dictionary format) that were executed by the agent leading into this step’s observation.start_timestamp
(str | None): ISO format timestamp when the step started.end_timestamp
(str | None): ISO format timestamp when the step ended.