Skip to main content

Generate Dataset Plan

Generate a structured dataset generation plan (taxonomy, sample schema, and distribution) from a natural language prompt before running the full generation pipeline.


Endpoint​

POST https://api.platform.knowledgator.com/datasets/generate/plan/


Headers​

NameTypeDescription
KnowledgatorAPI-KeyStringYour API key
Content-TypeStringapplication/json

Request Body​

ParameterTypeRequiredDescription
promptStringYesNatural language prompt describing the dataset scope, domain, and entity/class requirements.

Example Request Body​

{
"prompt": "Create an NER dataset for financial SEC filings extracting revenue, operating income, and dates"
}

Response​

{
"status": "success",
"plan": {
"domain": "Finance / Regulatory",
"suggested_types": ["revenue", "operating_income", "reporting_date"],
"distribution": {
"revenue": 0.4,
"operating_income": 0.35,
"reporting_date": 0.25
},
"guidelines": "Ensure numerical entities include unit context."
}
}

Error Codes​

Status CodeDescription
200OK – Plan generated successfully.
400Bad Request – Missing or invalid prompt.
401Unauthorized – Invalid API key.
500Internal Server Error – Server-side generation error.

Example Usage​

SDK Usage​

💡 Dedicated SDK Guides: See Python SDK | TypeScript SDK

TypeScript/JavaScript​

import { createClient } from '@knowledgator/typescript-sdk';

const kg = createClient('YOUR_API_KEY');

const plan = await kg.datasets.generatePlan({
prompt: "Create an NER dataset for financial SEC filings extracting revenue, operating income, and dates"
});

console.log(plan);

Python​

from knowledgator import Knowledgator

kg = Knowledgator(api_key="YOUR_API_KEY")

plan = kg.datasets.generate_plan(
prompt="Create an NER dataset for financial SEC filings extracting revenue, operating income, and dates"
)

print(plan)

cURL​

curl -X POST "https://api.platform.knowledgator.com/datasets/generate/plan/" \
-H "KnowledgatorAPI-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Create an NER dataset for financial SEC filings extracting revenue, operating income, and dates"
}'