(dataset)
Create a new dataset.
import os
from friendli import SyncFriendli
with SyncFriendli(
token=os.getenv("FRIENDLI_TOKEN", ""),
) as friendli:
res = friendli.dataset.create_dataset(
modality={}, name="<value>", project_id="<id>"
)
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
modality |
models.DedicatedDatasetModality |
✔️ |
Dataset modality. |
name |
str |
✔️ |
Name of the dataset. |
project_id |
str |
✔️ |
ID of the project. |
x_friendli_team |
OptionalNullable[str] |
➖ |
ID of team to run requests as (optional parameter). |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.DatasetInfo
| Error Type |
Status Code |
Content Type |
| models.HTTPValidationError |
422 |
application/json |
| models.SDKError |
4XX, 5XX |
*/* |
List datasets accessible to the user.
import os
from friendli import SyncFriendli
with SyncFriendli(
token=os.getenv("FRIENDLI_TOKEN", ""),
) as friendli:
res = friendli.dataset.list_datasets(project_id="<id>", limit=20)
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
project_id |
str |
✔️ |
N/A |
cursor |
OptionalNullable[Union[bytes, IO[bytes], io.BufferedReader]] |
➖ |
N/A |
limit |
OptionalNullable[int] |
➖ |
N/A |
direction |
OptionalNullable[models.Direction] |
➖ |
N/A |
name_search |
OptionalNullable[str] |
➖ |
N/A |
x_friendli_team |
OptionalNullable[str] |
➖ |
ID of team to run requests as (optional parameter). |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.ListDatasetsResponse
| Error Type |
Status Code |
Content Type |
| models.HTTPValidationError |
422 |
application/json |
| models.SDKError |
4XX, 5XX |
*/* |
Get information about a specific dataset.
import os
from friendli import SyncFriendli
with SyncFriendli(
token=os.getenv("FRIENDLI_TOKEN", ""),
) as friendli:
res = friendli.dataset.get_dataset(dataset_id="539201")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
dataset_id |
str |
✔️ |
ID of the dataset to retrieve. |
x_friendli_team |
OptionalNullable[str] |
➖ |
ID of team to run requests as (optional parameter). |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.DatasetInfo
| Error Type |
Status Code |
Content Type |
| models.HTTPValidationError |
422 |
application/json |
| models.SDKError |
4XX, 5XX |
*/* |
Delete a specific dataset.
import os
from friendli import SyncFriendli
with SyncFriendli(
token=os.getenv("FRIENDLI_TOKEN", ""),
) as friendli:
res = friendli.dataset.delete_dataset(dataset_id="195431")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
dataset_id |
str |
✔️ |
ID of the dataset to delete. |
x_friendli_team |
OptionalNullable[str] |
➖ |
ID of team to run requests as (optional parameter). |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
Any
| Error Type |
Status Code |
Content Type |
| models.HTTPValidationError |
422 |
application/json |
| models.SDKError |
4XX, 5XX |
*/* |
Create a version for the current state of the split.
import os
from friendli import SyncFriendli
with SyncFriendli(
token=os.getenv("FRIENDLI_TOKEN", ""),
) as friendli:
res = friendli.dataset.create_version(
dataset_id="224113",
comment="New range of formal shirts are designed keeping you in mind. With fits and styling that will make you stand apart",
)
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
dataset_id |
str |
✔️ |
ID of the dataset. |
comment |
str |
✔️ |
N/A |
x_friendli_team |
OptionalNullable[str] |
➖ |
ID of team to run requests as (optional parameter). |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.VersionInfo
| Error Type |
Status Code |
Content Type |
| models.HTTPValidationError |
422 |
application/json |
| models.SDKError |
4XX, 5XX |
*/* |
List versions for a dataset.
import os
from friendli import SyncFriendli
with SyncFriendli(
token=os.getenv("FRIENDLI_TOKEN", ""),
) as friendli:
res = friendli.dataset.list_versions(dataset_id="653403")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
dataset_id |
str |
✔️ |
ID of the dataset. |
x_friendli_team |
OptionalNullable[str] |
➖ |
ID of team to run requests as (optional parameter). |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.ListVersionsResponse
| Error Type |
Status Code |
Content Type |
| models.HTTPValidationError |
422 |
application/json |
| models.SDKError |
4XX, 5XX |
*/* |
Get a dataset version.
import os
from friendli import SyncFriendli
with SyncFriendli(
token=os.getenv("FRIENDLI_TOKEN", ""),
) as friendli:
res = friendli.dataset.get_version(dataset_id="665101", version_id="813303")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
dataset_id |
str |
✔️ |
ID of the dataset. |
version_id |
str |
✔️ |
ID of the version to get. |
x_friendli_team |
OptionalNullable[str] |
➖ |
ID of team to run requests as (optional parameter). |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.VersionInfo
| Error Type |
Status Code |
Content Type |
| models.HTTPValidationError |
422 |
application/json |
| models.SDKError |
4XX, 5XX |
*/* |
Delete a version from the dataset.
import os
from friendli import SyncFriendli
with SyncFriendli(
token=os.getenv("FRIENDLI_TOKEN", ""),
) as friendli:
res = friendli.dataset.delete_version(dataset_id="310482", version_id="434150")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
dataset_id |
str |
✔️ |
ID of the dataset. |
version_id |
str |
✔️ |
ID of the version to delete. |
x_friendli_team |
OptionalNullable[str] |
➖ |
ID of team to run requests as (optional parameter). |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
Any
| Error Type |
Status Code |
Content Type |
| models.HTTPValidationError |
422 |
application/json |
| models.SDKError |
4XX, 5XX |
*/* |
Create a new split in the dataset.
import os
from friendli import SyncFriendli
with SyncFriendli(
token=os.getenv("FRIENDLI_TOKEN", ""),
) as friendli:
res = friendli.dataset.create_split(dataset_id="334066", name="<value>")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
dataset_id |
str |
✔️ |
ID of the dataset. |
name |
str |
✔️ |
N/A |
x_friendli_team |
OptionalNullable[str] |
➖ |
ID of team to run requests as (optional parameter). |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.SplitInfo
| Error Type |
Status Code |
Content Type |
| models.HTTPValidationError |
422 |
application/json |
| models.SDKError |
4XX, 5XX |
*/* |
List splits in the dataset.
import os
from friendli import SyncFriendli
with SyncFriendli(
token=os.getenv("FRIENDLI_TOKEN", ""),
) as friendli:
res = friendli.dataset.list_splits(dataset_id="494482", limit=20)
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
dataset_id |
str |
✔️ |
ID of the dataset. |
cursor |
OptionalNullable[Union[bytes, IO[bytes], io.BufferedReader]] |
➖ |
N/A |
limit |
OptionalNullable[int] |
➖ |
N/A |
direction |
OptionalNullable[models.QueryParamDirection] |
➖ |
N/A |
version_id |
OptionalNullable[str] |
➖ |
N/A |
x_friendli_team |
OptionalNullable[str] |
➖ |
ID of team to run requests as (optional parameter). |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.ListSplitsResponse
| Error Type |
Status Code |
Content Type |
| models.HTTPValidationError |
422 |
application/json |
| models.SDKError |
4XX, 5XX |
*/* |
Get information about a specific split.
import os
from friendli import SyncFriendli
with SyncFriendli(
token=os.getenv("FRIENDLI_TOKEN", ""),
) as friendli:
res = friendli.dataset.get_split(dataset_id="84405", split_id="516409")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
dataset_id |
str |
✔️ |
ID of the dataset. |
split_id |
str |
✔️ |
ID of the split. |
x_friendli_team |
OptionalNullable[str] |
➖ |
ID of team to run requests as (optional parameter). |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.SplitInfo
| Error Type |
Status Code |
Content Type |
| models.HTTPValidationError |
422 |
application/json |
| models.SDKError |
4XX, 5XX |
*/* |
Delete a specific split.
import os
from friendli import SyncFriendli
with SyncFriendli(
token=os.getenv("FRIENDLI_TOKEN", ""),
) as friendli:
res = friendli.dataset.delete_split(dataset_id="724178", split_id="4400")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
dataset_id |
str |
✔️ |
ID of the dataset. |
split_id |
str |
✔️ |
ID of the split. |
x_friendli_team |
OptionalNullable[str] |
➖ |
ID of team to run requests as (optional parameter). |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
Any
| Error Type |
Status Code |
Content Type |
| models.HTTPValidationError |
422 |
application/json |
| models.SDKError |
4XX, 5XX |
*/* |
Add samples to the split.
import os
from friendli import SyncFriendli
with SyncFriendli(
token=os.getenv("FRIENDLI_TOKEN", ""),
) as friendli:
res = friendli.dataset.add_samples(
dataset_id="304268",
split_id="345943",
request_body=[
"0xA76F67a260",
"0x0274A1ADf1",
"0x626BF2e0Df",
],
)
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
dataset_id |
str |
✔️ |
ID of the dataset. |
split_id |
str |
✔️ |
ID of the split. |
request_body |
List[str] |
✔️ |
N/A |
x_friendli_team |
OptionalNullable[str] |
➖ |
ID of team to run requests as (optional parameter). |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.AddSamplesResponse
| Error Type |
Status Code |
Content Type |
| models.HTTPValidationError |
422 |
application/json |
| models.SDKError |
4XX, 5XX |
*/* |
List samples from the split.
import os
from friendli import SyncFriendli
with SyncFriendli(
token=os.getenv("FRIENDLI_TOKEN", ""),
) as friendli:
res = friendli.dataset.list_samples(
dataset_id="282743", split_id="505420", limit=20
)
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
dataset_id |
str |
✔️ |
ID of the dataset. |
split_id |
str |
✔️ |
ID of the split. |
cursor |
OptionalNullable[Union[bytes, IO[bytes], io.BufferedReader]] |
➖ |
N/A |
limit |
OptionalNullable[int] |
➖ |
N/A |
direction |
OptionalNullable[models.ListSamplesQueryParamDirection] |
➖ |
N/A |
version_id |
OptionalNullable[str] |
➖ |
N/A |
x_friendli_team |
OptionalNullable[str] |
➖ |
ID of team to run requests as (optional parameter). |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.ListSamplesResponse
| Error Type |
Status Code |
Content Type |
| models.HTTPValidationError |
422 |
application/json |
| models.SDKError |
4XX, 5XX |
*/* |
Update samples as raw file.
import os
from friendli import SyncFriendli
with SyncFriendli(
token=os.getenv("FRIENDLI_TOKEN", ""),
) as friendli:
res = friendli.dataset.update_samples(
dataset_id="<id>",
split_id="<id>",
file={
"file_name": "example.file",
"content": open("example.file", "rb"),
},
)
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
dataset_id |
str |
✔️ |
ID of the dataset. |
split_id |
str |
✔️ |
ID of the split. |
file |
models.BodyUploadRawSamplesFile |
✔️ |
File to update samples. |
x_friendli_team |
OptionalNullable[str] |
➖ |
ID of team to run requests as (optional parameter). |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.AddSamplesResponse
| Error Type |
Status Code |
Content Type |
| models.HTTPValidationError |
422 |
application/json |
| models.SDKError |
4XX, 5XX |
*/* |
Delete samples from the split.
import os
from friendli import SyncFriendli
with SyncFriendli(
token=os.getenv("FRIENDLI_TOKEN", ""),
) as friendli:
res = friendli.dataset.delete_samples(
dataset_id="658326",
split_id="581117",
request_body=[
"<value 1>",
"<value 2>",
],
)
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
dataset_id |
str |
✔️ |
ID of the dataset. |
split_id |
str |
✔️ |
ID of the split. |
request_body |
List[models.RequestBody] |
✔️ |
N/A |
x_friendli_team |
OptionalNullable[str] |
➖ |
ID of team to run requests as (optional parameter). |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.DeleteSamplesResponse
| Error Type |
Status Code |
Content Type |
| models.HTTPValidationError |
422 |
application/json |
| models.SDKError |
4XX, 5XX |
*/* |