datasets
Dataset Objects
get_content
Gets and returns the content of the dataset.
Also refreshes the content of the local dataset instance.
Raises:
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.
Returns:
Union[None, DatasetContent]
: The content of the dataset
add_rows
Adds rows to the dataset.
Arguments:
row_data
(list[Dict[str, Any]]
): The rows to add to the dataset.
Raises:
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.
Returns:
Dataset
: The updated dataset with the new rows.
Datasets Objects
list
Lists all datasets.
Arguments:
limit
(Union[Unset, int]
): The maximum number of datasets to return. Default is 100.
Raises:
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.
Returns:
list[Dataset]
: A list of datasets.
get
Retrieves a dataset by id or name (exactly one of id
or name
must be provided).
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.
Raises:
ValueError
: If neither or bothid
andname
are provided.name
1: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.name
2: If the request takes longer than Client.timeout.
Returns:
name
3: The dataset.
delete
Deletes a dataset by id or name.
Arguments:
id
(str
): The id of the dataset.name
(str
): The name of the dataset.
Raises:
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.
create
Creates a new dataset.
Arguments:
name
(str
): The name of the dataset.content
(DatasetType
): The content of the dataset.
Raises:
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.
Returns:
Dataset
: The created dataset.
get_dataset
Retrieves a dataset by id or name (exactly one of id
or name
must be provided).
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.
Raises:
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.
Returns:
name
0: The dataset.
list_datasets
Lists all datasets.
Arguments:
limit
(Union[Unset, int]
): The maximum number of datasets to return. Default is 100.
Raises:
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.
Returns:
list[Dataset]
: A list of datasets.
delete_dataset
Deletes a dataset by id or name (exactly one of id
or name
must be provided).
Arguments:
id
(str
): The id of the dataset.name
(str
): The name of the dataset.
Raises:
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.
create_dataset
Creates a new dataset.
Arguments:
name
(str
): The name of the dataset.content
(DatasetType
): The content of the dataset.
Raises:
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.
Returns:
Dataset
: The created dataset.
get_dataset_version_history
Retrieves a dataset version history by dataset name or dataset id.
Arguments:
dataset_name
(str
): The name of the dataset.dataset_id
(str
): The id of the dataset.
Raises:
HTTPValidationError
: None
Returns:
ListDatasetVersionResponse
:
get_dataset_version
Retrieves a dataset version by dataset name or dataset id.
Arguments:
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.
Returns:
DatasetContent
: