Judgeval Python-v1 SDKResponse Types

Dataset

Class instances for dataset management

Class instances returned by DatasetFactory.create() and DatasetFactory.get() that provide both data access and additional methods for dataset management.

Usage Pattern

from judgeval import Judgeval

client = Judgeval(project_name="default_project")

# Factory methods return Dataset instances
dataset = client.datasets.create(name="my_dataset")
retrieved_dataset = client.datasets.get(name="my_dataset")

# Both return Dataset instances with properties and methods
print(dataset.name)  # Access properties
dataset.add_examples([...])  # Call instance methods

Properties

name

:str

Name of the dataset

project_name

:str

Name of the project the dataset belongs to

dataset_kind

:str

Type of dataset ("example" or "trace")

Default: "example"

examples

:Optional[List[Example]]

List of examples in the dataset (if loaded)

Methods

add_examples(examples: Iterable[Example], batch_size: int = 100)

:None

Add examples to the dataset. Examples are uploaded in batches for efficiency.

add_from_json(file_path: str, batch_size: int = 100)

:None

Load examples from a JSON file and add them to the dataset.

add_from_yaml(file_path: str, batch_size: int = 100)

:None

Load examples from a YAML file and add them to the dataset.

save_as(file_type: Literal["json", "yaml"], dir_path: str, save_name: Optional[str] = None)

:None

Save the dataset examples to a file in the specified format.

display(max_examples: int = 5)

:None

Display a formatted table of dataset examples in the console.

Documentation

See Dataset for complete API documentation including:

  • Factory methods (DatasetFactory.create(), DatasetFactory.get())
  • Instance methods (.add_examples(), .add_from_json(), .save_as(), etc.)
  • Instance properties (.name, .examples, .dataset_kind, etc.)