Prompt tuning
Create prompt-tuning job
Start tuning one decision’s wording. The job page shows its progress.
POST
/
v1
/
prompt-tuning
/
jobs
Create prompt-tuning job
curl --request POST \
--url https://console.sqwish.ai/v1/prompt-tuning/jobs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"dataset_id": "<string>",
"decision": "<string>",
"model": "<string>",
"effort": "standard"
}
'import requests
url = "https://console.sqwish.ai/v1/prompt-tuning/jobs"
payload = {
"dataset_id": "<string>",
"decision": "<string>",
"model": "<string>",
"effort": "standard"
}
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({
dataset_id: '<string>',
decision: '<string>',
model: '<string>',
effort: 'standard'
})
};
fetch('https://console.sqwish.ai/v1/prompt-tuning/jobs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"object": "prompt_tuning.job",
"status": "queued",
"dataset_id": "<string>",
"model": "<string>",
"decision": "<string>",
"wording_variants": 123,
"effort": "standard",
"price_cents": 123,
"refunded": true,
"test_looks": 123,
"progress": {
"phase": "<string>",
"round": 123,
"rounds": 123,
"original_loss": 123,
"best_loss": 123,
"candidates": 123
},
"result": {
"verdict": "improved",
"tuned": {
"id": "<string>",
"question": "<string>",
"kind": "single",
"outcomes": "<unknown>",
"rubric": [
"<unknown>"
],
"weights": {},
"costs": {},
"abstain": {
"min_probability": 0.5,
"cost": 123
}
},
"candidate": {
"id": "<string>",
"question": "<string>",
"kind": "single",
"outcomes": "<unknown>",
"rubric": [
"<unknown>"
],
"weights": {},
"costs": {},
"abstain": {
"min_probability": 0.5,
"cost": 123
}
},
"changes": [
{
"part": "<string>",
"before": "<string>",
"after": "<string>"
}
],
"label_issues": [
{
"row": 123,
"reason": "<string>"
}
],
"original": {
"id": "<string>",
"question": "<string>",
"kind": "single",
"outcomes": "<unknown>",
"rubric": [
"<unknown>"
],
"weights": {},
"costs": {},
"abstain": {
"min_probability": 0.5,
"cost": 123
}
},
"decision": "<string>",
"rows": 123,
"rows_left_out": 123,
"noise_band": 123,
"candidates": 123,
"rounds": [
{}
],
"history": [
{}
],
"reflections": 123,
"skipped_reflections": [
{}
],
"row_scorings": 123,
"reasons": [
"<string>"
],
"test": {},
"cost": {}
},
"created_at": 123,
"updated_at": 123,
"error": "<string>"
}{
"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:
"prompt_tuning.job"Available options:
queued, running, cancelling, succeeded, failed, cancelled Available options:
standard, thorough Show child attributes
Show child attributes
Show child attributes
Show child attributes
Create prompt-tuning job
curl --request POST \
--url https://console.sqwish.ai/v1/prompt-tuning/jobs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"dataset_id": "<string>",
"decision": "<string>",
"model": "<string>",
"effort": "standard"
}
'import requests
url = "https://console.sqwish.ai/v1/prompt-tuning/jobs"
payload = {
"dataset_id": "<string>",
"decision": "<string>",
"model": "<string>",
"effort": "standard"
}
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({
dataset_id: '<string>',
decision: '<string>',
model: '<string>',
effort: 'standard'
})
};
fetch('https://console.sqwish.ai/v1/prompt-tuning/jobs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"object": "prompt_tuning.job",
"status": "queued",
"dataset_id": "<string>",
"model": "<string>",
"decision": "<string>",
"wording_variants": 123,
"effort": "standard",
"price_cents": 123,
"refunded": true,
"test_looks": 123,
"progress": {
"phase": "<string>",
"round": 123,
"rounds": 123,
"original_loss": 123,
"best_loss": 123,
"candidates": 123
},
"result": {
"verdict": "improved",
"tuned": {
"id": "<string>",
"question": "<string>",
"kind": "single",
"outcomes": "<unknown>",
"rubric": [
"<unknown>"
],
"weights": {},
"costs": {},
"abstain": {
"min_probability": 0.5,
"cost": 123
}
},
"candidate": {
"id": "<string>",
"question": "<string>",
"kind": "single",
"outcomes": "<unknown>",
"rubric": [
"<unknown>"
],
"weights": {},
"costs": {},
"abstain": {
"min_probability": 0.5,
"cost": 123
}
},
"changes": [
{
"part": "<string>",
"before": "<string>",
"after": "<string>"
}
],
"label_issues": [
{
"row": 123,
"reason": "<string>"
}
],
"original": {
"id": "<string>",
"question": "<string>",
"kind": "single",
"outcomes": "<unknown>",
"rubric": [
"<unknown>"
],
"weights": {},
"costs": {},
"abstain": {
"min_probability": 0.5,
"cost": 123
}
},
"decision": "<string>",
"rows": 123,
"rows_left_out": 123,
"noise_band": 123,
"candidates": 123,
"rounds": [
{}
],
"history": [
{}
],
"reflections": 123,
"skipped_reflections": [
{}
],
"row_scorings": 123,
"reasons": [
"<string>"
],
"test": {},
"cost": {}
},
"created_at": 123,
"updated_at": 123,
"error": "<string>"
}{
"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>"
}
]
}
}