Create dataset
Create a dataset with its first version. Send examples, and we hold out
evaluation_fraction of their contexts for evaluation, 0.2 by default. Or send training
and evaluation, and each row takes the side of its part: evaluation alone makes a
dataset for evaluation only. A JSON body carries the rows as arrays, up to 1 MiB. A
multipart/form-data body carries them as JSONL file parts, up to your tier’s upload limit
(upload_bytes in GET /v1/account’s effective_limits), beside text parts for name,
evaluation_fraction and max_price_usd.
curl --request POST \
--url https://api.sqwish.ai/v1/datasets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"examples": [
{
"decisions": [
{
"id": "<string>",
"question": "<string>",
"kind": "single",
"outcomes": "<unknown>",
"rubric": [
"<unknown>"
],
"policy": {
"action_costs": {},
"abstain_below": 0.5
}
}
],
"model": "<string>",
"context": "",
"images": [
{
"id": 32,
"data": "<string>"
}
],
"temperature": 2.6,
"targets": {},
"rewards": {}
}
],
"training": [
{
"decisions": [
{
"id": "<string>",
"question": "<string>",
"kind": "single",
"outcomes": "<unknown>",
"rubric": [
"<unknown>"
],
"policy": {
"action_costs": {},
"abstain_below": 0.5
}
}
],
"model": "<string>",
"context": "",
"images": [
{
"id": 32,
"data": "<string>"
}
],
"temperature": 2.6,
"targets": {},
"rewards": {}
}
],
"evaluation": [
{
"decisions": [
{
"id": "<string>",
"question": "<string>",
"kind": "single",
"outcomes": "<unknown>",
"rubric": [
"<unknown>"
],
"policy": {
"action_costs": {},
"abstain_below": 0.5
}
}
],
"model": "<string>",
"context": "",
"images": [
{
"id": 32,
"data": "<string>"
}
],
"temperature": 2.6,
"targets": {},
"rewards": {}
}
],
"evaluation_fraction": 0.55,
"max_price_usd": "<string>"
}
'import requests
url = "https://api.sqwish.ai/v1/datasets"
payload = {
"name": "<string>",
"examples": [
{
"decisions": [
{
"id": "<string>",
"question": "<string>",
"kind": "single",
"outcomes": "<unknown>",
"rubric": ["<unknown>"],
"policy": {
"action_costs": {},
"abstain_below": 0.5
}
}
],
"model": "<string>",
"context": "",
"images": [
{
"id": 32,
"data": "<string>"
}
],
"temperature": 2.6,
"targets": {},
"rewards": {}
}
],
"training": [
{
"decisions": [
{
"id": "<string>",
"question": "<string>",
"kind": "single",
"outcomes": "<unknown>",
"rubric": ["<unknown>"],
"policy": {
"action_costs": {},
"abstain_below": 0.5
}
}
],
"model": "<string>",
"context": "",
"images": [
{
"id": 32,
"data": "<string>"
}
],
"temperature": 2.6,
"targets": {},
"rewards": {}
}
],
"evaluation": [
{
"decisions": [
{
"id": "<string>",
"question": "<string>",
"kind": "single",
"outcomes": "<unknown>",
"rubric": ["<unknown>"],
"policy": {
"action_costs": {},
"abstain_below": 0.5
}
}
],
"model": "<string>",
"context": "",
"images": [
{
"id": 32,
"data": "<string>"
}
],
"temperature": 2.6,
"targets": {},
"rewards": {}
}
],
"evaluation_fraction": 0.55,
"max_price_usd": "<string>"
}
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: [
{
decisions: [
{
id: '<string>',
question: '<string>',
kind: 'single',
outcomes: '<unknown>',
rubric: ['<unknown>'],
policy: {action_costs: {}, abstain_below: 0.5}
}
],
model: '<string>',
context: '',
images: [{id: 32, data: '<string>'}],
temperature: 2.6,
targets: {},
rewards: {}
}
],
training: [
{
decisions: [
{
id: '<string>',
question: '<string>',
kind: 'single',
outcomes: '<unknown>',
rubric: ['<unknown>'],
policy: {action_costs: {}, abstain_below: 0.5}
}
],
model: '<string>',
context: '',
images: [{id: 32, data: '<string>'}],
temperature: 2.6,
targets: {},
rewards: {}
}
],
evaluation: [
{
decisions: [
{
id: '<string>',
question: '<string>',
kind: 'single',
outcomes: '<unknown>',
rubric: ['<unknown>'],
policy: {action_costs: {}, abstain_below: 0.5}
}
],
model: '<string>',
context: '',
images: [{id: 32, data: '<string>'}],
temperature: 2.6,
targets: {},
rewards: {}
}
],
evaluation_fraction: 0.55,
max_price_usd: '<string>'
})
};
fetch('https://api.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>",
"version": 123,
"rows": 123,
"contexts": 123,
"duplicates_removed": 123,
"method": "sft",
"archived_at": 123,
"used_at": 123,
"evaluation_only": true,
"evaluation_fraction": 123,
"split": {},
"prompt_tuning": {
"decisions": [
{
"decision": {
"id": "<string>",
"question": "<string>",
"kind": "single",
"outcomes": "<unknown>",
"rubric": [
"<unknown>"
],
"policy": {
"action_costs": {},
"abstain_below": 0.5
}
},
"outcomes": [
"<string>"
],
"rows": 123,
"labels": {},
"reason": "conflicting_decision"
}
],
"unlisted": 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"
},
"storage_window": {
"started_at": 123,
"ends_at": 123,
"reserved_usd": "<string>"
},
"labels_to_check": 123
}{
"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>"
}
]
}
}Body
The most you agree to pay for its first day of storage, which a dataset above the free size holds, in USD, such as the price you were shown. It is a decimal string, such as "2.500000000", never a JSON number, so no precision is lost: a number is refused with invalid_request, naming this field. If it costs more when it is admitted, it is refused with price_changed and nothing is held.
^\d{1,9}(\.\d{1,9})?$Response
Successful Response
curl --request POST \
--url https://api.sqwish.ai/v1/datasets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"examples": [
{
"decisions": [
{
"id": "<string>",
"question": "<string>",
"kind": "single",
"outcomes": "<unknown>",
"rubric": [
"<unknown>"
],
"policy": {
"action_costs": {},
"abstain_below": 0.5
}
}
],
"model": "<string>",
"context": "",
"images": [
{
"id": 32,
"data": "<string>"
}
],
"temperature": 2.6,
"targets": {},
"rewards": {}
}
],
"training": [
{
"decisions": [
{
"id": "<string>",
"question": "<string>",
"kind": "single",
"outcomes": "<unknown>",
"rubric": [
"<unknown>"
],
"policy": {
"action_costs": {},
"abstain_below": 0.5
}
}
],
"model": "<string>",
"context": "",
"images": [
{
"id": 32,
"data": "<string>"
}
],
"temperature": 2.6,
"targets": {},
"rewards": {}
}
],
"evaluation": [
{
"decisions": [
{
"id": "<string>",
"question": "<string>",
"kind": "single",
"outcomes": "<unknown>",
"rubric": [
"<unknown>"
],
"policy": {
"action_costs": {},
"abstain_below": 0.5
}
}
],
"model": "<string>",
"context": "",
"images": [
{
"id": 32,
"data": "<string>"
}
],
"temperature": 2.6,
"targets": {},
"rewards": {}
}
],
"evaluation_fraction": 0.55,
"max_price_usd": "<string>"
}
'import requests
url = "https://api.sqwish.ai/v1/datasets"
payload = {
"name": "<string>",
"examples": [
{
"decisions": [
{
"id": "<string>",
"question": "<string>",
"kind": "single",
"outcomes": "<unknown>",
"rubric": ["<unknown>"],
"policy": {
"action_costs": {},
"abstain_below": 0.5
}
}
],
"model": "<string>",
"context": "",
"images": [
{
"id": 32,
"data": "<string>"
}
],
"temperature": 2.6,
"targets": {},
"rewards": {}
}
],
"training": [
{
"decisions": [
{
"id": "<string>",
"question": "<string>",
"kind": "single",
"outcomes": "<unknown>",
"rubric": ["<unknown>"],
"policy": {
"action_costs": {},
"abstain_below": 0.5
}
}
],
"model": "<string>",
"context": "",
"images": [
{
"id": 32,
"data": "<string>"
}
],
"temperature": 2.6,
"targets": {},
"rewards": {}
}
],
"evaluation": [
{
"decisions": [
{
"id": "<string>",
"question": "<string>",
"kind": "single",
"outcomes": "<unknown>",
"rubric": ["<unknown>"],
"policy": {
"action_costs": {},
"abstain_below": 0.5
}
}
],
"model": "<string>",
"context": "",
"images": [
{
"id": 32,
"data": "<string>"
}
],
"temperature": 2.6,
"targets": {},
"rewards": {}
}
],
"evaluation_fraction": 0.55,
"max_price_usd": "<string>"
}
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: [
{
decisions: [
{
id: '<string>',
question: '<string>',
kind: 'single',
outcomes: '<unknown>',
rubric: ['<unknown>'],
policy: {action_costs: {}, abstain_below: 0.5}
}
],
model: '<string>',
context: '',
images: [{id: 32, data: '<string>'}],
temperature: 2.6,
targets: {},
rewards: {}
}
],
training: [
{
decisions: [
{
id: '<string>',
question: '<string>',
kind: 'single',
outcomes: '<unknown>',
rubric: ['<unknown>'],
policy: {action_costs: {}, abstain_below: 0.5}
}
],
model: '<string>',
context: '',
images: [{id: 32, data: '<string>'}],
temperature: 2.6,
targets: {},
rewards: {}
}
],
evaluation: [
{
decisions: [
{
id: '<string>',
question: '<string>',
kind: 'single',
outcomes: '<unknown>',
rubric: ['<unknown>'],
policy: {action_costs: {}, abstain_below: 0.5}
}
],
model: '<string>',
context: '',
images: [{id: 32, data: '<string>'}],
temperature: 2.6,
targets: {},
rewards: {}
}
],
evaluation_fraction: 0.55,
max_price_usd: '<string>'
})
};
fetch('https://api.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>",
"version": 123,
"rows": 123,
"contexts": 123,
"duplicates_removed": 123,
"method": "sft",
"archived_at": 123,
"used_at": 123,
"evaluation_only": true,
"evaluation_fraction": 123,
"split": {},
"prompt_tuning": {
"decisions": [
{
"decision": {
"id": "<string>",
"question": "<string>",
"kind": "single",
"outcomes": "<unknown>",
"rubric": [
"<unknown>"
],
"policy": {
"action_costs": {},
"abstain_below": 0.5
}
},
"outcomes": [
"<string>"
],
"rows": 123,
"labels": {},
"reason": "conflicting_decision"
}
],
"unlisted": 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"
},
"storage_window": {
"started_at": 123,
"ends_at": 123,
"reserved_usd": "<string>"
},
"labels_to_check": 123
}{
"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>"
}
]
}
}