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
| Name | Type | Description |
|---|---|---|
KnowledgatorAPI-Key | String | Your API key |
Content-Type | String | application/json |
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
prompt | String | Yes | Natural 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 Code | Description |
|---|---|
200 | OK – Plan generated successfully. |
400 | Bad Request – Missing or invalid prompt. |
401 | Unauthorized – Invalid API key. |
500 | Internal 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"
}'