generated from mintlify/starter
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
726 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
--- | ||
title: "Dataset" | ||
--- | ||
|
||
A dataset is an essential component in refining your LLM application's performance. It comprises a collection of input/output samples for conducting tests and validations. | ||
|
||
Our SDK facilitates dataset management, enabling both manual handling and the transformation of existing steps into actionable samples. This feature is designed for iterative development and fine-tuning of your application. | ||
|
||
### Create a dataset | ||
|
||
<CodeGroup> | ||
```python Python | ||
dataset = await sdk.api.create_dataset( | ||
name="Foo", description="A dataset to store samples.", metadata={"isDemo": True} | ||
) | ||
``` | ||
```typescript TypeScript | ||
const dataset = await client.api.createDataset({ | ||
name: 'Foo', | ||
description: 'A dataset to store samples.', | ||
metadata: { isDemo: true } | ||
}); | ||
``` | ||
</CodeGroup> | ||
|
||
### Create a dataset item | ||
|
||
<CodeGroup> | ||
```python Python | ||
dataset_item = await dataset.create_dataset_item( | ||
dataset_id=dataset.id, | ||
input={ "content": "What is literal?" }, | ||
output={ "content": "Literal is an observability solution." } | ||
) | ||
|
||
step_item = await dataset.add_step_to_dataset(dataset.id, step.id) | ||
``` | ||
```typescript TypeScript | ||
const datasetItem = await dataset.createDatasetItem( | ||
dataset.id, | ||
{ | ||
input: { "content": "What is literal?" }, | ||
output: { "content": "Literal is an observability solution." }, | ||
} | ||
); | ||
|
||
const stepItem = await dataset.addStepToDataset(dataset.id, step.id); | ||
``` | ||
</CodeGroup> | ||
|
||
### Get a dataset | ||
|
||
<CodeGroup> | ||
```python Python | ||
dataset = await sdk.api.get_dataset(id="dataset_id") | ||
|
||
for item in dataset.items: | ||
pass | ||
``` | ||
```typescript TypeScript | ||
const dataset = await client.api.getDataset("dataset_id"); | ||
|
||
dataset.items.forEach((item) => { | ||
// ... | ||
}); | ||
``` | ||
</CodeGroup> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.