Add rows to a dataset
Add rows to a dataset as its next version, as create sends them: examples, whose
sides the split picks, or training and evaluation. They ask the dataset’s own
decisions, worded as it words them, with its kind of supervision; with
allow_new_decision_ids they may also ask decisions it doesn’t ask yet. Rows it holds already
are left out, and a context it holds keeps its side: sent in the other part, it is
refused. Earlier versions stay as they were. max_price_usd is the most you agree to
pay for a first day of storage, which rows that take the dataset past the free size hold.
curl --request POST \
--url https://api.sqwish.ai/v1/datasets/{dataset_id}/versions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"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>",
"allow_new_decision_ids": false
}
'import requests
url = "https://api.sqwish.ai/v1/datasets/{dataset_id}/versions"
payload = {
"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>",
"allow_new_decision_ids": False
}
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({
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>',
allow_new_decision_ids: false
})
};
fetch('https://api.sqwish.ai/v1/datasets/{dataset_id}/versions', 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,
"zdr": true,
"storage_state": "reachable"
}{
"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 rows of a dataset's next version, in one of two modes: examples, whose sides the
split picks, or training and evaluation, whose rows take the side of the part they are in.
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
For a dataset in your own storage, whether OneHot can read it there: reachable; not_reachable, while the storage can't be reached or refuses OneHot; or in_a_disconnected_storage, until that storage is connected again. Null for a dataset in OneHot's storage.
reachable, not_reachable, in_a_disconnected_storage curl --request POST \
--url https://api.sqwish.ai/v1/datasets/{dataset_id}/versions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"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>",
"allow_new_decision_ids": false
}
'import requests
url = "https://api.sqwish.ai/v1/datasets/{dataset_id}/versions"
payload = {
"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>",
"allow_new_decision_ids": False
}
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({
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>',
allow_new_decision_ids: false
})
};
fetch('https://api.sqwish.ai/v1/datasets/{dataset_id}/versions', 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,
"zdr": true,
"storage_state": "reachable"
}{
"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>"
}
]
}
}