curl --request POST \
--url https://api.vainona.ai/v1/namespaces/{ns}/judgments/{name}/labelling-queue \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"count": 50,
"seed": 0
}
'import requests
url = "https://api.vainona.ai/v1/namespaces/{ns}/judgments/{name}/labelling-queue"
payload = {
"count": 50,
"seed": 0
}
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({count: 50, seed: 0})
};
fetch('https://api.vainona.ai/v1/namespaces/{ns}/judgments/{name}/labelling-queue', 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}/labelling-queue",
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([
'count' => 50,
'seed' => 0
]),
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}/labelling-queue"
payload := strings.NewReader("{\n \"count\": 50,\n \"seed\": 0\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}/labelling-queue")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"count\": 50,\n \"seed\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vainona.ai/v1/namespaces/{ns}/judgments/{name}/labelling-queue")
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 \"count\": 50,\n \"seed\": 0\n}"
response = http.request(request)
puts response.read_body{
"judgment": "<string>",
"version": 2,
"engine": "<string>",
"engine_version": "<string>",
"seed": 1,
"lease_expires_at": "2023-11-07T05:31:56Z",
"items": [
{
"queue_item_id": "<string>",
"document_id": "<string>",
"band": {
"index": 4,
"lower": 0.5,
"upper": 0.5
},
"probability": 0.5,
"value": "<string>",
"evaluation_id": "<string>",
"document": {
"id": "<string>",
"revision": 1,
"attributes": {},
"state": {}
}
}
]
}{
"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": {}
}
}Draw documents to label
Draws up to count documents to label (§6.10), a random sample
stratified across the 10 probability bands: count is split evenly
over the bands with documents to give, and what a band cannot fill
goes to the others. Within a band, documents come in an order fixed
by seed, so the same state and seed give the same items. Documents
already labelled from the queue for their current answer, and those
leased to someone else, are skipped.
Each draw leases its documents for 7 days, so two people are not
given the same one. Post each label as an ordinary outcome with the
item’s queue_item_id: it counts as source: queue. Once an
epoch’s queue labels alone meet the calibration minimums, the epoch
is fitted on them, each weighted by its band’s share of the answers,
so the rare bands the queue oversamples count for what they are in
real traffic.
Drawing is part of the learning loop, on the Team plan and above:
below it, plan_required (§9). The preview (GET) is on every
plan. A judgment with a non-zero horizon has no queue
(invalid_request).
curl --request POST \
--url https://api.vainona.ai/v1/namespaces/{ns}/judgments/{name}/labelling-queue \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"count": 50,
"seed": 0
}
'import requests
url = "https://api.vainona.ai/v1/namespaces/{ns}/judgments/{name}/labelling-queue"
payload = {
"count": 50,
"seed": 0
}
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({count: 50, seed: 0})
};
fetch('https://api.vainona.ai/v1/namespaces/{ns}/judgments/{name}/labelling-queue', 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}/labelling-queue",
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([
'count' => 50,
'seed' => 0
]),
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}/labelling-queue"
payload := strings.NewReader("{\n \"count\": 50,\n \"seed\": 0\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}/labelling-queue")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"count\": 50,\n \"seed\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vainona.ai/v1/namespaces/{ns}/judgments/{name}/labelling-queue")
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 \"count\": 50,\n \"seed\": 0\n}"
response = http.request(request)
puts response.read_body{
"judgment": "<string>",
"version": 2,
"engine": "<string>",
"engine_version": "<string>",
"seed": 1,
"lease_expires_at": "2023-11-07T05:31:56Z",
"items": [
{
"queue_item_id": "<string>",
"document_id": "<string>",
"band": {
"index": 4,
"lower": 0.5,
"upper": 0.5
},
"probability": 0.5,
"value": "<string>",
"evaluation_id": "<string>",
"document": {
"id": "<string>",
"revision": 1,
"attributes": {},
"state": {}
}
}
]
}{
"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.
Path Parameters
The namespace name, with any / sent as %2F.
Up to 256 bytes. / separates levels of the hierarchy, as in acme/prod/tenant_123.
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 items drawn and leased; none when nothing is available.
Documents drawn from the labelling queue and leased (§6.10).
A judgment, attribute or threshold name. Names are path segments in field references, so they never contain ..
1 - 128^[A-Za-z0-9_-]+$x >= 1The epoch drawn from. Null while the version has no answers.
x >= 0When the items go back into the queue if not labelled. Null when nothing was drawn.
Lowest band first; within a band, in the seed's order.
200Show child attributes
Show child attributes