Skip to content

Commit

Permalink
Merge branch 'main' into wd/prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
clementsirieix committed Mar 6, 2024
2 parents d05cc19 + b64eaf6 commit 7747a69
Show file tree
Hide file tree
Showing 4 changed files with 726 additions and 1 deletion.
69 changes: 69 additions & 0 deletions concepts/dataset.mdx
@@ -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>


8 changes: 7 additions & 1 deletion mint.json
Expand Up @@ -49,6 +49,7 @@
"group": "Concepts",
"pages": [
"concepts/prompt",
"concepts/dataset",
{
"group": "Observability",
"pages": [
Expand Down Expand Up @@ -99,10 +100,15 @@
"python-client/api-reference/step",
"python-client/api-reference/attachment",
"python-client/api-reference/feedback",
"python-client/api-reference/generation"
"python-client/api-reference/generation",
"python-client/api-reference/dataset"
]
},
{ "group": "Get Started", "pages": ["typescript-client/introduction"] },
{
"group": "API Reference",
"pages": ["typescript-client/api-reference/dataset"]
},
{ "group": "Self Hosting", "pages": ["self-hosting/deployment"] }
],
"footerSocials": {
Expand Down

0 comments on commit 7747a69

Please sign in to comment.