curl --request POST \
--url https://api.platform.infino.ws/v1/validate/{database} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"table_name": "code",
"field_name": "content",
"statement": "SELECT path FROM code WHERE content ILIKE '%write_pointer%'",
"rows": [
{
"path": "README.md"
}
],
"question": "Where is `write_pointer` called?"
}
EOFimport requests
url = "https://api.platform.infino.ws/v1/validate/{database}"
payload = {
"table_name": "code",
"field_name": "content",
"statement": "SELECT path FROM code WHERE content ILIKE '%write_pointer%'",
"rows": [{ "path": "README.md" }],
"question": "Where is `write_pointer` called?"
}
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({
table_name: 'code',
field_name: 'content',
statement: 'SELECT path FROM code WHERE content ILIKE \'%write_pointer%\'',
rows: [{path: 'README.md'}],
question: 'Where is `write_pointer` called?'
})
};
fetch('https://api.platform.infino.ws/v1/validate/{database}', 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.platform.infino.ws/v1/validate/{database}",
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([
'table_name' => 'code',
'field_name' => 'content',
'statement' => 'SELECT path FROM code WHERE content ILIKE \'%write_pointer%\'',
'rows' => [
[
'path' => 'README.md'
]
],
'question' => 'Where is `write_pointer` called?'
]),
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.platform.infino.ws/v1/validate/{database}"
payload := strings.NewReader("{\n \"table_name\": \"code\",\n \"field_name\": \"content\",\n \"statement\": \"SELECT path FROM code WHERE content ILIKE '%write_pointer%'\",\n \"rows\": [\n {\n \"path\": \"README.md\"\n }\n ],\n \"question\": \"Where is `write_pointer` called?\"\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.platform.infino.ws/v1/validate/{database}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"table_name\": \"code\",\n \"field_name\": \"content\",\n \"statement\": \"SELECT path FROM code WHERE content ILIKE '%write_pointer%'\",\n \"rows\": [\n {\n \"path\": \"README.md\"\n }\n ],\n \"question\": \"Where is `write_pointer` called?\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.platform.infino.ws/v1/validate/{database}")
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 \"table_name\": \"code\",\n \"field_name\": \"content\",\n \"statement\": \"SELECT path FROM code WHERE content ILIKE '%write_pointer%'\",\n \"rows\": [\n {\n \"path\": \"README.md\"\n }\n ],\n \"question\": \"Where is `write_pointer` called?\"\n}"
response = http.request(request)
puts response.read_body{
"valid": false,
"reason": "the rows do not mention `write_pointer`, which the question names",
"check": "anchors",
"anchors": [
"write_pointer"
],
"rows": 1
}Validate a result
The same verdict the sub-agent reaches on every query it runs, for a caller writing its own queries: did these rows answer this question? A refusal is diagnosed against the index, naming which of the question’s terms occur nowhere in the searched column.
Preview: this route may change between releases. It needs the agent APIs enabled on your account, and answers 403 until they are.
curl --request POST \
--url https://api.platform.infino.ws/v1/validate/{database} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"table_name": "code",
"field_name": "content",
"statement": "SELECT path FROM code WHERE content ILIKE '%write_pointer%'",
"rows": [
{
"path": "README.md"
}
],
"question": "Where is `write_pointer` called?"
}
EOFimport requests
url = "https://api.platform.infino.ws/v1/validate/{database}"
payload = {
"table_name": "code",
"field_name": "content",
"statement": "SELECT path FROM code WHERE content ILIKE '%write_pointer%'",
"rows": [{ "path": "README.md" }],
"question": "Where is `write_pointer` called?"
}
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({
table_name: 'code',
field_name: 'content',
statement: 'SELECT path FROM code WHERE content ILIKE \'%write_pointer%\'',
rows: [{path: 'README.md'}],
question: 'Where is `write_pointer` called?'
})
};
fetch('https://api.platform.infino.ws/v1/validate/{database}', 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.platform.infino.ws/v1/validate/{database}",
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([
'table_name' => 'code',
'field_name' => 'content',
'statement' => 'SELECT path FROM code WHERE content ILIKE \'%write_pointer%\'',
'rows' => [
[
'path' => 'README.md'
]
],
'question' => 'Where is `write_pointer` called?'
]),
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.platform.infino.ws/v1/validate/{database}"
payload := strings.NewReader("{\n \"table_name\": \"code\",\n \"field_name\": \"content\",\n \"statement\": \"SELECT path FROM code WHERE content ILIKE '%write_pointer%'\",\n \"rows\": [\n {\n \"path\": \"README.md\"\n }\n ],\n \"question\": \"Where is `write_pointer` called?\"\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.platform.infino.ws/v1/validate/{database}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"table_name\": \"code\",\n \"field_name\": \"content\",\n \"statement\": \"SELECT path FROM code WHERE content ILIKE '%write_pointer%'\",\n \"rows\": [\n {\n \"path\": \"README.md\"\n }\n ],\n \"question\": \"Where is `write_pointer` called?\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.platform.infino.ws/v1/validate/{database}")
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 \"table_name\": \"code\",\n \"field_name\": \"content\",\n \"statement\": \"SELECT path FROM code WHERE content ILIKE '%write_pointer%'\",\n \"rows\": [\n {\n \"path\": \"README.md\"\n }\n ],\n \"question\": \"Where is `write_pointer` called?\"\n}"
response = http.request(request)
puts response.read_body{
"valid": false,
"reason": "the rows do not mention `write_pointer`, which the question names",
"check": "anchors",
"anchors": [
"write_pointer"
],
"rows": 1
}Authorizations
Body
POST /v1/validate/{database}: a result, the statement it came from and
the question it is meant to answer. An unknown field is refused.
The question the rows are meant to answer. Its anchors (tokens holding a digit, quoted or backticked spans, capitalized words past the first, identifier-shaped tokens) are what a row-returning result must mention, and what is looked up in the index on a refusal. Omitted, or a question naming nothing of that shape, leaves a non-empty result standing on its own.
Response
The verdict as JSON: valid, the check that decided, the question's anchors, and on a refusal the reason in the sub-agent's own words, the anchors absent from the searched column (no query over it will find them) and, for a line-window statement that matched nothing, the overlap suggestion to run instead. This route answers four of the five check values: no_rows (the statement returned nothing), aggregate (an aggregate, valid when it returned a non-zero number), anchors (the rows were held to the question's terms) and unchecked (rows came back and the question named nothing to hold them to). The fifth, graded, is a verdict a grading model reached; this route judges by the words alone and never returns it. For an aggregate over a search grouped by a column, group_column, groups and note add the facts about each group. Sent with empty rows, the check is the diagnosis alone, which of the question's terms the data holds, before any query is spent. valid means the result answers the question's terms, not that it is correct.
The verdict. valid is the bar the sub-agent holds its own queries to;
reason is what the sub-agent would have handed its model to query
again after, so a caller can show or act on the same words. valid
means the result answers the question's terms, not that it is correct.
Was this page helpful?
