OTEL
Testing
Prompts
Datasets
Human Review
Datasets
Create a dataset
Create a new dataset
POST
/
apps
/
{appSlug}
/
datasets
Copy
Ask AI
from autoblocks.api.app_client import AutoblocksAppClient
from autoblocks.datasets.models import SchemaPropertyType
client = AutoblocksAppClient(
api_key="<YOUR_API_KEY>",
app_slug="my-app",
)
schema = [
{
"name": "title",
"type": SchemaPropertyType.STRING.value,
"required": True,
"defaultValue": "Default Title" # Default values cannot be empty
},
{
"name": "content",
"type": SchemaPropertyType.STRING.value,
"required": True,
}
]
dataset = client.datasets.create(
name="my-dataset",
description="A dataset for testing",
schema=schema
)
Copy
Ask AI
{
"id": "<string>",
"name": "<string>",
"externalId": "<string>",
"latestRevisionId": "<string>",
"schema": [
{
"id": "<string>",
"name": "<string>",
"required": false,
"type": "<string>",
"defaultValue": "<string>"
}
],
"schemaVersion": 123
}
Authorizations
API Key created in the Autoblocks Webapp
Path Parameters
Body
application/json
Response
200 - application/json
The dataset was created successfully
The response is of type object
.
Copy
Ask AI
from autoblocks.api.app_client import AutoblocksAppClient
from autoblocks.datasets.models import SchemaPropertyType
client = AutoblocksAppClient(
api_key="<YOUR_API_KEY>",
app_slug="my-app",
)
schema = [
{
"name": "title",
"type": SchemaPropertyType.STRING.value,
"required": True,
"defaultValue": "Default Title" # Default values cannot be empty
},
{
"name": "content",
"type": SchemaPropertyType.STRING.value,
"required": True,
}
]
dataset = client.datasets.create(
name="my-dataset",
description="A dataset for testing",
schema=schema
)
Copy
Ask AI
{
"id": "<string>",
"name": "<string>",
"externalId": "<string>",
"latestRevisionId": "<string>",
"schema": [
{
"id": "<string>",
"name": "<string>",
"required": false,
"type": "<string>",
"defaultValue": "<string>"
}
],
"schemaVersion": 123
}
Assistant
Responses are generated using AI and may contain mistakes.