Create Dataset
Create a new dataset record with optional file upload and version control using the Knowledgator TypeScript SDK.
Example Usage
import { createClient } from '@knowledgator/typescript-sdk';
const kg = createClient();
const dataset = await kg.datasets.create({
name: 'my_entity_dataset',
type: 'ner',
format: 'jsonl',
short_description: 'Fine-tuning dataset for custom NER',
parent_dataset_id: '73a078ff-360a-48ea-bb2f-fe6add05289e', // Links to parent dataset for version control
});
console.log('Created dataset ID:', dataset.id);
console.log('Status:', dataset.status);
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Dataset name. |
type | string | Yes | Dataset task type (e.g., 'ner', 'text_classification', 'relation_extraction'). |
format | string | Yes | Dataset file format (e.g., 'jsonl', 'json'). |
short_description | string | No | Short description of the dataset (maximum 1024 characters). |
parent_dataset_id | string | No | UUID of the parent dataset for version tracking and dataset revisions. |
file | Buffer | Blob | Uint8Array | No | Optional dataset file payload to upload immediately. |
Response Structure
The response returns a DatasetCreationResponse containing the assigned dataset identifier and initial status:
{
id: "73a078ff-360a-48ea-bb2f-fe6add05289e",
status: "created"
}