Dataset
add_rows
row_data(List[Dict[str, Any]]): The rows to add to the dataset.
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.httpx.TimeoutException: If the request takes longer than Client.timeout.
Dataset: The updated dataset with the new rows.
get_content
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.httpx.TimeoutException: If the request takes longer than Client.timeout.
Union[None, DatasetContent]: The content of the dataset
list_projects
limit(Union[Unset, int]): The maximum number of projects to return. Default is 100.
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.httpx.TimeoutException: If the request takes longer than Client.timeout.
List[DatasetProject]: A list of projects this dataset is used in.
Datasets
create
name(str): The name of the dataset.content(DatasetType): The content of the dataset.project_id(str): Associate the dataset with this project by ID. Mutually exclusive with project_name.project_name(str): Associate the dataset with this project by name. Mutually exclusive with project_id.
ValueError: If both project_id and project_name are provided, or if the specified project does not exist.errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.httpx.TimeoutException: If the request takes longer than Client.timeout.
Dataset: The created dataset.
delete
id(str): The id of the dataset.name(str): The name of the dataset.project_id(str): Validate that the dataset is used in this project by ID before deletion. Mutually exclusive with project_name.project_name(str): Validate that the dataset is used in this project by name before deletion. Mutually exclusive with project_id.
ValueError: If neither or bothidandnameare provided, if both project_id and project_name are provided, or if the specified project does not exist, or if the dataset is not used in the specified project.errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.httpx.TimeoutException: If the request takes longer than Client.timeout.
extend
prompt_settings(Dict[str, Any]): Settings for the prompt generation. Should contain ‘model_alias’ key. Example:{'model_alias': 'GPT-4o mini'}prompt(str): A description of the assistant’s role.instructions(str): Instructions for the assistant.examples(List[str]): Examples of user prompts.data_types(List[str]): The types of data to generate. Possible values are: ‘General Query’, ‘Prompt Injection’, ‘Off-Topic Query’, ‘Toxic Content in Query’, ‘Multiple Questions in Query’, ‘Sexist Content in Query’.count(int, default 10): The number of synthetic examples to generate.
DatasetAPIException: If the request to extend the dataset fails.errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.httpx.TimeoutException: If the request takes longer than Client.timeout.
List[DatasetRow]: A list of rows from the extended dataset.
get
id or name must be provided).
Optionally validates that the dataset is used in a specific project.
Arguments
id(str): The id of the dataset.name(str): The name of the dataset.with_content(bool): Whether to return the content of the dataset. Default is False.project_id(str): Validate that the dataset is used in this project by ID. Mutually exclusive with project_name.project_name(str): Validate that the dataset is used in this project by name. Mutually exclusive with project_id.
ValueError: If neither or bothidandnameare provided, if both project_id and project_name are provided, or if the specified project does not exist, or if the dataset is not used in the specified project.errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.httpx.TimeoutException: If the request takes longer than Client.timeout.
Dataset: The dataset.
list
limit(Union[Unset, int]): The maximum number of datasets to return. Default is 100.project_id(str): Filter datasets used in this project by ID. Mutually exclusive with project_name.project_name(str): Filter datasets used in this project by name. Mutually exclusive with project_id.
ValueError: If both project_id and project_name are provided, or if the specified project does not exist.errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.httpx.TimeoutException: If the request takes longer than Client.timeout.
List[Dataset]: A list of datasets.
convert_dataset_row_to_record
dataset_row(DatasetRow): The dataset row to convert.
ValueError: If the dataset row does not have an input field.
DatasetRecord: The converted dataset record.
create_dataset
name(str): The name of the dataset.content(DatasetType): The content of the dataset.project_id(str): Associate the dataset with this project by ID. Mutually exclusive with project_name.project_name(str): Associate the dataset with this project by name. Mutually exclusive with project_id.
ValueError: If both project_id and project_name are provided, or if the specified project does not exist.errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.httpx.TimeoutException: If the request takes longer than Client.timeout.
Dataset: The created dataset.
delete_dataset
id or name must be provided).
Optionally validates that the dataset is used in a specific project before deletion.
Arguments
id(str): The id of the dataset.name(str): The name of the dataset.project_id(str): Validate that the dataset is used in this project by ID before deletion. Mutually exclusive with project_name.project_name(str): Validate that the dataset is used in this project by name before deletion. Mutually exclusive with project_id.
ValueError: If neither or bothidandnameare provided, if both project_id and project_name are provided, or if the specified project does not exist, or if the dataset is not used in the specified project.errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.httpx.TimeoutException: If the request takes longer than Client.timeout.
extend_dataset
prompt_settings(Dict[str, Any]): Settings for the prompt generation. Should contain ‘model_alias’ key. Example:{'model_alias': 'GPT-4o mini'}prompt(str): A description of the assistant’s role.instructions(str): Instructions for the assistant.examples(List[str]): Examples of user prompts.data_types(List[str]): The types of data to generate. Possible values are: ‘General Query’, ‘Prompt Injection’, ‘Off-Topic Query’, ‘Toxic Content in Query’, ‘Multiple Questions in Query’, ‘Sexist Content in Query’.count(int, default 10): The number of synthetic examples to generate.
DatasetAPIException: If the request to extend the dataset fails.errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.httpx.TimeoutException: If the request takes longer than Client.timeout.
List[DatasetRow]: A list of rows from the extended dataset.
get_dataset
id or name must be provided).
Optionally validates that the dataset is used in a specific project.
Arguments
id(str): The id of the dataset.name(str): The name of the dataset.project_id(str): Validate that the dataset is used in this project by ID. Mutually exclusive with project_name.project_name(str): Validate that the dataset is used in this project by name. Mutually exclusive with project_id.
ValueError: If neither or bothidandnameare provided, if both project_id and project_name are provided, or if the specified project does not exist, or if the dataset is not used in the specified project.errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.httpx.TimeoutException: If the request takes longer than Client.timeout.
Dataset: The dataset.
get_dataset_version
version_index(int): The version of the dataset.dataset_name(Optional[str]): The name of the dataset.dataset_id(Optional[str]): The id of the dataset.
DatasetContent:
get_dataset_version_history
dataset_name(str): The name of the dataset.dataset_id(str): The id of the dataset.
HTTPValidationError:
ListDatasetVersionResponse:
list_dataset_projects
dataset_id(str): The ID of the dataset.dataset_name(str): The name of the dataset.limit(Union[Unset, int]): The maximum number of projects to return. Default is 100.
ValueError: If neither or bothdataset_idanddataset_nameare provided, or if the dataset does not exist.errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.httpx.TimeoutException: If the request takes longer than Client.timeout.
List[DatasetProject]: A list of projects the dataset is used in.
list_datasets
limit(Union[Unset, int]): The maximum number of datasets to return. Default is 100.project_id(str): Filter datasets used in this project by ID. Mutually exclusive with project_name.project_name(str): Filter datasets used in this project by name. Mutually exclusive with project_id.
ValueError: If both project_id and project_name are provided, or if the specified project does not exist.errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.httpx.TimeoutException: If the request takes longer than Client.timeout.
List[Dataset]: A list of datasets.