Datasets
Create dataset
Create a dataset from JSON examples. The default request body limit is 1 MiB.
POST
/
v1
/
datasets
Create dataset
curl --request POST \
--url https://console.sqwish.ai/v1/datasets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"examples": [
{
"context": "<string>",
"decisions": [
{
"id": "<string>",
"question": "<string>",
"kind": "single",
"outcomes": "<unknown>",
"rubric": [
"<unknown>"
],
"weights": {},
"costs": {},
"abstain": {
"min_probability": 0.5,
"cost": 123
}
}
],
"model": "<string>",
"independent": false,
"store": true,
"metadata": {},
"targets": {},
"rewards": {}
}
]
}
'import requests
url = "https://console.sqwish.ai/v1/datasets"
payload = {
"name": "<string>",
"examples": [
{
"context": "<string>",
"decisions": [
{
"id": "<string>",
"question": "<string>",
"kind": "single",
"outcomes": "<unknown>",
"rubric": ["<unknown>"],
"weights": {},
"costs": {},
"abstain": {
"min_probability": 0.5,
"cost": 123
}
}
],
"model": "<string>",
"independent": False,
"store": True,
"metadata": {},
"targets": {},
"rewards": {}
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
examples: [
{
context: '<string>',
decisions: [
{
id: '<string>',
question: '<string>',
kind: 'single',
outcomes: '<unknown>',
rubric: ['<unknown>'],
weights: {},
costs: {},
abstain: {min_probability: 0.5, cost: 123}
}
],
model: '<string>',
independent: false,
store: true,
metadata: {},
targets: {},
rewards: {}
}
]
})
};
fetch('https://console.sqwish.ai/v1/datasets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"name": "<string>",
"created_at": 123,
"sha256": "<string>",
"status": "validated",
"rows": 123,
"contexts": 123,
"duplicates_removed": 123,
"method": "sft",
"augmentation": "none",
"deleted_at": 123,
"input": {
"format": "json",
"sha256": "<string>",
"bytes": 123
},
"labeling": {
"job_id": "<string>",
"source_id": "<string>",
"source_sha256": "<string>",
"source_input_sha256": "<string>",
"spec_sha256": "<string>",
"prompt_version": "<string>",
"teacher_models": [
"<string>"
],
"row_indices": [
123
],
"selection_sha256": "<string>",
"target_method": "mean_one_hot_teacher_votes"
},
"source": "<string>",
"metadata_filter": {}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"details": [
{
"path": [
"<string>"
],
"message": "<string>",
"type": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"details": [
{
"path": [
"<string>"
],
"message": "<string>",
"type": "<string>"
}
]
}
}Authorizations
Create an API key in the console. Required when accounts are enabled.
Headers
Body
application/json
Response
Successful Response
Allowed value:
"validated"Available options:
sft, reward Allowed value:
"none"Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Create dataset
curl --request POST \
--url https://console.sqwish.ai/v1/datasets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"examples": [
{
"context": "<string>",
"decisions": [
{
"id": "<string>",
"question": "<string>",
"kind": "single",
"outcomes": "<unknown>",
"rubric": [
"<unknown>"
],
"weights": {},
"costs": {},
"abstain": {
"min_probability": 0.5,
"cost": 123
}
}
],
"model": "<string>",
"independent": false,
"store": true,
"metadata": {},
"targets": {},
"rewards": {}
}
]
}
'import requests
url = "https://console.sqwish.ai/v1/datasets"
payload = {
"name": "<string>",
"examples": [
{
"context": "<string>",
"decisions": [
{
"id": "<string>",
"question": "<string>",
"kind": "single",
"outcomes": "<unknown>",
"rubric": ["<unknown>"],
"weights": {},
"costs": {},
"abstain": {
"min_probability": 0.5,
"cost": 123
}
}
],
"model": "<string>",
"independent": False,
"store": True,
"metadata": {},
"targets": {},
"rewards": {}
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
examples: [
{
context: '<string>',
decisions: [
{
id: '<string>',
question: '<string>',
kind: 'single',
outcomes: '<unknown>',
rubric: ['<unknown>'],
weights: {},
costs: {},
abstain: {min_probability: 0.5, cost: 123}
}
],
model: '<string>',
independent: false,
store: true,
metadata: {},
targets: {},
rewards: {}
}
]
})
};
fetch('https://console.sqwish.ai/v1/datasets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"name": "<string>",
"created_at": 123,
"sha256": "<string>",
"status": "validated",
"rows": 123,
"contexts": 123,
"duplicates_removed": 123,
"method": "sft",
"augmentation": "none",
"deleted_at": 123,
"input": {
"format": "json",
"sha256": "<string>",
"bytes": 123
},
"labeling": {
"job_id": "<string>",
"source_id": "<string>",
"source_sha256": "<string>",
"source_input_sha256": "<string>",
"spec_sha256": "<string>",
"prompt_version": "<string>",
"teacher_models": [
"<string>"
],
"row_indices": [
123
],
"selection_sha256": "<string>",
"target_method": "mean_one_hot_teacher_votes"
},
"source": "<string>",
"metadata_filter": {}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"details": [
{
"path": [
"<string>"
],
"message": "<string>",
"type": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"details": [
{
"path": [
"<string>"
],
"message": "<string>",
"type": "<string>"
}
]
}
}