Dataset

@dataclass(repr=False)
class Dataset(Utils)

create_item

def create_item(input: Dict,
                expected_output: Optional[Dict] = None,
                metadata: Optional[Dict] = None) -> DatasetItem

Create a new dataset item and add it to this dataset.

Arguments:

  • input: The input data for the dataset item.
  • expected_output: The output data for the dataset item (optional).
  • metadata: Metadata for the dataset item (optional).

Returns:

The created DatasetItem instance.

create_experiment

def create_experiment(name: str,
                      prompt_id: Optional[str] = None,
                      params: Optional[Dict] = None) -> DatasetExperiment

Creates a new dataset experiment based on this dataset.

Arguments:

  • name: The name of the experiment .
  • prompt_id: The Prompt ID used on LLM calls (optional).
  • params: The params used on the experiment.

Returns:

The created DatasetExperiment instance.

delete_item

def delete_item(item_id: str)

Delete a dataset item from this dataset.

Arguments:

  • api: An instance of the DatasetAPI to make the call.
  • item_id: The ID of the dataset item to delete.

add_step

def add_step(step_id: str, metadata: Optional[Dict] = None) -> DatasetItem

Create a new dataset item based on a step and add it to this dataset.

Arguments:

  • step_id: The id of the step to add to the dataset.
  • metadata: Metadata for the dataset item (optional).

Returns:

The created DatasetItem instance.

add_generation

def add_generation(generation_id: str,
                   metadata: Optional[Dict] = None) -> DatasetItem

Create a new dataset item based on a generation and add it to this dataset.

Arguments:

  • generation_id: The id of the generation to add to the dataset.
  • metadata: Metadata for the dataset item (optional).

Returns:

The created DatasetItem instance.