curl --request POST \
--url https://api.vainona.ai/v1/namespaces/{ns}/judgments/{name}/activate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"version": 2,
"force": false
}
'import requests
url = "https://api.vainona.ai/v1/namespaces/{ns}/judgments/{name}/activate"
payload = {
"version": 2,
"force": 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({version: 2, force: false})
};
fetch('https://api.vainona.ai/v1/namespaces/{ns}/judgments/{name}/activate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.vainona.ai/v1/namespaces/{ns}/judgments/{name}/activate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'version' => 2,
'force' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.vainona.ai/v1/namespaces/{ns}/judgments/{name}/activate"
payload := strings.NewReader("{\n \"version\": 2,\n \"force\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.vainona.ai/v1/namespaces/{ns}/judgments/{name}/activate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"version\": 2,\n \"force\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vainona.ai/v1/namespaces/{ns}/judgments/{name}/activate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"version\": 2,\n \"force\": false\n}"
response = http.request(request)
puts response.read_body{
"name": "<string>",
"active_version": 2,
"freshness": {
"policy": "on_read",
"debounce_ms": 0,
"interval": "<string>",
"max_wait_ms": 2,
"fanout": {
"scope": {
"created_within": "<string>",
"where": {}
},
"debounce_ms": 600000,
"max_wait_ms": 2,
"job_above": 1,
"confirm_jobs": true,
"auto_daily_limit": 100000
}
},
"thresholds": {},
"versions": [
{
"version": 2,
"created_at": "2023-11-07T05:31:56Z",
"definition": {
"name": "<string>",
"question": "<string>",
"type": "bool",
"criteria": "<string>",
"context": {
"fields": [
"<string>"
],
"last_n": {},
"window": {},
"max_tokens": 2,
"related": {}
},
"engine": {
"name": "jev",
"version": "<string>"
},
"horizon": "0s",
"applies_to": {},
"thresholds": {},
"parts": [
{
"name": "<string>",
"question": "<string>"
}
],
"features": [
"<string>"
]
}
}
],
"template": "<string>",
"overrides": [
"thresholds"
],
"fanout_sources": {
"scope": {
"created_within": "judgment",
"where": "judgment"
},
"debounce_ms": "judgment",
"max_wait_ms": "judgment",
"job_above": "judgment",
"confirm_jobs": "judgment",
"auto_daily_limit": "judgment"
}
}{
"id": "<string>",
"type": "backfill",
"status": "estimating",
"namespace": "<string>",
"spend_usd": 1,
"progress": {
"documents_done": 1
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"judgment": "<string>",
"estimate": {
"documents": 1,
"tokens": 1,
"judgment_units": 1,
"cost_usd": 1,
"duration_s": 1
},
"estimated_completion_at": "2023-11-07T05:31:56Z",
"error": "<string>",
"attribute": "<string>",
"referenced": {
"relation": "<string>",
"document_id": "<string>",
"revision": 1
},
"version": 2,
"report": {
"documents": 1,
"current": {
"type": "bool",
"mean": 123,
"histogram": [
{
"lower": 123,
"upper": 123,
"count": 1
}
]
},
"candidate": {
"type": "bool",
"mean": 123,
"histogram": [
{
"lower": 123,
"upper": 123,
"count": 1
}
]
},
"threshold_flips": {},
"recompute": {
"documents": 1,
"tokens": 1,
"judgment_units": 1,
"cost_usd": 1,
"duration_s": 1
}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}Make a version the one new evaluations use
Existing answers keep their judgment_version until recomputed.
Activating a version whose engine or definition differs from the active
one without force returns a shadow job in awaiting_confirm
(202). The job evaluates a random sample of 1,000 documents under the
new version, never producing answers, and its report compares old and
new (§7.3.11). POST /jobs/{id}/confirm completes the switch, at any
point; cancelling the job leaves the active version as it was. With
force: true, or when nothing differs, the version is active at once
(200).
On a prefix path the sample is drawn across every namespace under the
prefix, and confirming switches them all. A namespace cannot activate a
version of a judgment it inherits (conflict): it follows the
template’s active version (§7.7).
Activating a composite version (§6.5.1) always returns the shadow job,
even with force. Its sample is up to 1,000 documents with outcomes
for this judgment; it fits the combiner with 5-fold cross-validation
and compares it with the fair baseline (CompositeShadowReport).
Fewer than 50 labelled documents, or fewer than 10 of either answer,
fail the job with insufficient_labels. confirm activates the
version with the combiner fitted on all of them, whatever the
verdict.
curl --request POST \
--url https://api.vainona.ai/v1/namespaces/{ns}/judgments/{name}/activate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"version": 2,
"force": false
}
'import requests
url = "https://api.vainona.ai/v1/namespaces/{ns}/judgments/{name}/activate"
payload = {
"version": 2,
"force": 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({version: 2, force: false})
};
fetch('https://api.vainona.ai/v1/namespaces/{ns}/judgments/{name}/activate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.vainona.ai/v1/namespaces/{ns}/judgments/{name}/activate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'version' => 2,
'force' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.vainona.ai/v1/namespaces/{ns}/judgments/{name}/activate"
payload := strings.NewReader("{\n \"version\": 2,\n \"force\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.vainona.ai/v1/namespaces/{ns}/judgments/{name}/activate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"version\": 2,\n \"force\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vainona.ai/v1/namespaces/{ns}/judgments/{name}/activate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"version\": 2,\n \"force\": false\n}"
response = http.request(request)
puts response.read_body{
"name": "<string>",
"active_version": 2,
"freshness": {
"policy": "on_read",
"debounce_ms": 0,
"interval": "<string>",
"max_wait_ms": 2,
"fanout": {
"scope": {
"created_within": "<string>",
"where": {}
},
"debounce_ms": 600000,
"max_wait_ms": 2,
"job_above": 1,
"confirm_jobs": true,
"auto_daily_limit": 100000
}
},
"thresholds": {},
"versions": [
{
"version": 2,
"created_at": "2023-11-07T05:31:56Z",
"definition": {
"name": "<string>",
"question": "<string>",
"type": "bool",
"criteria": "<string>",
"context": {
"fields": [
"<string>"
],
"last_n": {},
"window": {},
"max_tokens": 2,
"related": {}
},
"engine": {
"name": "jev",
"version": "<string>"
},
"horizon": "0s",
"applies_to": {},
"thresholds": {},
"parts": [
{
"name": "<string>",
"question": "<string>"
}
],
"features": [
"<string>"
]
}
}
],
"template": "<string>",
"overrides": [
"thresholds"
],
"fanout_sources": {
"scope": {
"created_within": "judgment",
"where": "judgment"
},
"debounce_ms": "judgment",
"max_wait_ms": "judgment",
"job_above": "judgment",
"confirm_jobs": "judgment",
"auto_daily_limit": "judgment"
}
}{
"id": "<string>",
"type": "backfill",
"status": "estimating",
"namespace": "<string>",
"spend_usd": 1,
"progress": {
"documents_done": 1
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"judgment": "<string>",
"estimate": {
"documents": 1,
"tokens": 1,
"judgment_units": 1,
"cost_usd": 1,
"duration_s": 1
},
"estimated_completion_at": "2023-11-07T05:31:56Z",
"error": "<string>",
"attribute": "<string>",
"referenced": {
"relation": "<string>",
"document_id": "<string>",
"revision": 1
},
"version": 2,
"report": {
"documents": 1,
"current": {
"type": "bool",
"mean": 123,
"histogram": [
{
"lower": 123,
"upper": 123,
"count": 1
}
]
},
"candidate": {
"type": "bool",
"mean": 123,
"histogram": [
{
"lower": 123,
"upper": 123,
"count": 1
}
]
},
"threshold_flips": {},
"recompute": {
"documents": 1,
"tokens": 1,
"judgment_units": 1,
"cost_usd": 1,
"duration_s": 1
}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}Authorizations
An organization API key. Keys carry a role (read_write or
read_only) and may be restricted to a namespace prefix such as
acme/*, or to one namespace such as acme/prod/tenant_1. A prefix
matches on a / boundary: acme/prod/tenant_1* covers
acme/prod/tenant_1 and everything under acme/prod/tenant_1/,
never acme/prod/tenant_12.
Headers
Returns the original response verbatim while the node still caches it. Correctness never depends on it.
1Path Parameters
A namespace name, or a template prefix ending in /* (§7.7), with any
/ sent as %2F: acme%2Fprod%2Ftenant_123 or acme%2Fprod%2F*.
A namespace name, or a template prefix: a namespace path ending in
/*, such as acme/prod/*, which every namespace under acme/prod/
inherits judgments from (§7.7). Up to 256 bytes.
1 - 256^[A-Za-z0-9._:/-]+(/\*)?$A judgment, attribute or threshold name. Names are path segments in field references, so they never contain ..
1 - 128^[A-Za-z0-9_-]+$Body
Response
The version is active.
A judgment, attribute or threshold name. Names are path segments in field references, so they never contain ..
1 - 128^[A-Za-z0-9_-]+$Null once the judgment is deactivated.
x >= 1Settings, not part of the definition. Changing them creates no version.
Show child attributes
Show child attributes
The judgment's named thresholds, a setting rather than part of a
version (§6.5). Each is a number for a bool judgment (true when p is
at least it) or a score judgment (true when score is at least it),
and {value, gte} for a choice judgment (true when dist[value] is at
least gte). They are evaluated at read time against the raw fields,
never the calibrated ones. A threshold that does not fit the
judgment's type is invalid_request.
Show child attributes
Show child attributes
Every version, oldest first. Versions are retained forever.
Show child attributes
Show child attributes
Present when the judgment is inherited, the template prefix it comes from, such as acme/prod/* (§7.7).
1 - 256^[A-Za-z0-9._:/-]+(/\*)?$Present when the judgment is inherited. The settings this namespace overrides; the others follow the template (§7.7).
thresholds, freshness Entities, E3a (§6.5.2). Where each value in freshness.fanout comes
from, key for key. Present exactly when freshness.fanout is. A
where removed with null is the default, no filter; any other
null the judgment set, such as created_within: null, is the
judgment's.
Show child attributes
Show child attributes