API Reference
hud.taskset
API reference for TaskSet collections
The hud.taskset
module provides the TaskSet
class and functions for working with collections of Tasks.
Module Functions
load_taskset
Loads a TaskSet
and its associated Task
objects from the HUD platform by its ID.
Parameters:
taskset_id
(str): The unique identifier of the TaskSet to load.api_key
(str | None, optional): HUD API key. IfNone
, uses the key fromhud.settings
.
Returns:
TaskSet
: The loaded TaskSet instance containing a list ofTask
objects.
load_from_inspect
Creates a TaskSet
instance from an inspect-ai
dataset object.
(Note: Requires inspect-ai
library to be installed).
Parameters:
dataset
(inspect_ai.dataset.Dataset
): Aninspect-ai
dataset instance.
Returns:
TaskSet
: A new TaskSet instance populated withTask
objects converted from the dataset’s samples.
Classes
TaskSet
Represents a collection of related Task objects. Primarily used as a container when loading predefined sets using hud.load_taskset()
.
See the Tasks and TaskSets Concepts page for more details and usage examples.
Attributes:
id
(str | None): Optional unique identifier, usually populated when loaded viaload_taskset
.description
(str | None): Optional description of the taskset.tasks
(list[Task
]): The list ofTask
objects belonging to this set.
Methods:
__len__(self)
: Returns the number of tasks in thetasks
list. Allows usinglen(taskset)
.__getitem__(self, index)
: Returns theTask
at the specified index. Allows usingtaskset[index]
.