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

class Trajectory(pydantic.BaseModel):
    id: str
    reward: float | None = None
    logs: str | None = None
    error: str | None = None
    trajectory: list[TrajectoryStep] = []

    def display(self) -> None: ...

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 by env.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

class TrajectoryStep(pydantic.BaseModel):
    observation_url: str | None = None
    observation_text: str | None = None
    actions: list[dict]
    start_timestamp: str | None = None
    end_timestamp: str | None = None

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.