Skip to main content

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​

ParameterTypeRequiredDescription
namestringYesDataset name.
typestringYesDataset task type (e.g., 'ner', 'text_classification', 'relation_extraction').
formatstringYesDataset file format (e.g., 'jsonl', 'json').
short_descriptionstringNoShort description of the dataset (maximum 1024 characters).
parent_dataset_idstringNoUUID of the parent dataset for version tracking and dataset revisions.
fileBuffer | Blob | Uint8ArrayNoOptional 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"
}