# Read once at start and again when valid_for_s runs out; the last profile stays in use when Niadra is down
profile = niadra.profile()
if profile and "turns" in profile.features:
...// Read once at start and again when valid_for_s runs out; the last profile stays in use when Niadra is down
const profile = await niadra.profile();
if (profile?.features.includes("turns")) {
// ...
}curl --request GET \
--url https://{space}.{region}.api.niadra.com/v1/sdk/profileconst options = {method: 'GET'};
fetch('https://{space}.{region}.api.niadra.com/v1/sdk/profile', 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://{space}.{region}.api.niadra.com/v1/sdk/profile",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{space}.{region}.api.niadra.com/v1/sdk/profile"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{space}.{region}.api.niadra.com/v1/sdk/profile")
.asString();require 'uri'
require 'net/http'
url = URI("https://{space}.{region}.api.niadra.com/v1/sdk/profile")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"features": [
"turns"
],
"valid_for_s": 123,
"claim_contract": {
"languages": [
"pt"
],
"version": "<string>",
"categories": [
{
"actions": {
"default": "block",
"contexts": {},
"replace_with": "<string>"
},
"detect": {
"classes": [
"money"
],
"document_sections": [
"<string>"
],
"patterns": [
"article_citation"
],
"roles": {},
"terms": [
"<string>"
]
},
"evidence": {
"anchor": {
"coverage": "fact",
"min_match": 0.9
},
"tool": "<string>",
"tool_any": [
"<string>"
],
"value": {
"fresh_for": "claim",
"gap_terms": {},
"must_state_gaps": false,
"same_role": false,
"type": "<string>",
"value": "<string>"
}
},
"id": "<string>",
"agents": [
"<string>"
],
"natures": {
"computed": "check",
"model": "block",
"quoted": "verbatim"
}
}
],
"internal_text": {
"redact": "<string>",
"shingle_hashes_ref": "<string>",
"n": 8
},
"negative_corpus_version": "<string>",
"outputs": {
"immutable": [
"<string>"
],
"mutable": [
"<string>"
]
}
},
"recording": {
"content_mode": "stored",
"required_pins": [
"prompts"
]
},
"tool_bindings": [
{
"tool": "<string>",
"args": [
{
"attr": "<string>",
"param": "<string>",
"negation": {
"param": "<string>"
},
"ops": [
"in"
],
"transform": "lower"
}
],
"capabilities": {
"dry_run_param": "<string>",
"mask_output": false,
"overfetch": false,
"relax_flag": "<string>"
},
"results": [
{
"namespace": "<string>",
"type": "<string>",
"fields": {},
"id": "id",
"path": "$"
}
]
}
],
"types": [
{}
]
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"request_id": "<string>",
"type": "about:blank"
}Perfil do SDK
O que o SDK guarda no cache local: as funcionalidades ligadas, as vinculações de ferramenta da fonte, o registro de tipos resumido, o contrato de afirmação e o modo de gravação dos turnos. Com ETag.
# Read once at start and again when valid_for_s runs out; the last profile stays in use when Niadra is down
profile = niadra.profile()
if profile and "turns" in profile.features:
...// Read once at start and again when valid_for_s runs out; the last profile stays in use when Niadra is down
const profile = await niadra.profile();
if (profile?.features.includes("turns")) {
// ...
}curl --request GET \
--url https://{space}.{region}.api.niadra.com/v1/sdk/profileconst options = {method: 'GET'};
fetch('https://{space}.{region}.api.niadra.com/v1/sdk/profile', 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://{space}.{region}.api.niadra.com/v1/sdk/profile",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{space}.{region}.api.niadra.com/v1/sdk/profile"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{space}.{region}.api.niadra.com/v1/sdk/profile")
.asString();require 'uri'
require 'net/http'
url = URI("https://{space}.{region}.api.niadra.com/v1/sdk/profile")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"features": [
"turns"
],
"valid_for_s": 123,
"claim_contract": {
"languages": [
"pt"
],
"version": "<string>",
"categories": [
{
"actions": {
"default": "block",
"contexts": {},
"replace_with": "<string>"
},
"detect": {
"classes": [
"money"
],
"document_sections": [
"<string>"
],
"patterns": [
"article_citation"
],
"roles": {},
"terms": [
"<string>"
]
},
"evidence": {
"anchor": {
"coverage": "fact",
"min_match": 0.9
},
"tool": "<string>",
"tool_any": [
"<string>"
],
"value": {
"fresh_for": "claim",
"gap_terms": {},
"must_state_gaps": false,
"same_role": false,
"type": "<string>",
"value": "<string>"
}
},
"id": "<string>",
"agents": [
"<string>"
],
"natures": {
"computed": "check",
"model": "block",
"quoted": "verbatim"
}
}
],
"internal_text": {
"redact": "<string>",
"shingle_hashes_ref": "<string>",
"n": 8
},
"negative_corpus_version": "<string>",
"outputs": {
"immutable": [
"<string>"
],
"mutable": [
"<string>"
]
}
},
"recording": {
"content_mode": "stored",
"required_pins": [
"prompts"
]
},
"tool_bindings": [
{
"tool": "<string>",
"args": [
{
"attr": "<string>",
"param": "<string>",
"negation": {
"param": "<string>"
},
"ops": [
"in"
],
"transform": "lower"
}
],
"capabilities": {
"dry_run_param": "<string>",
"mask_output": false,
"overfetch": false,
"relax_flag": "<string>"
},
"results": [
{
"namespace": "<string>",
"type": "<string>",
"fields": {},
"id": "id",
"path": "$"
}
]
}
],
"types": [
{}
]
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"request_id": "<string>",
"type": "about:blank"
}Cabeçalhos
Resposta
Resposta de sucesso.
O que o SDK guarda no cache local: as funcionalidades ligadas, as vinculações de ferramenta da fonte, o registro de tipos resumido, o contrato de afirmação e a gravação de turnos.
As funcionalidades de agente que um espaço liga: tudo fica desligado até o documento features do espaço listar a funcionalidade, e GET /v1/sdk/profile anuncia o que está ligado.
turns, state, agent_state, signals, claims, coordination, measurement, notifications, legal_holds O contrato como o SDK o guarda: tudo menos as frases do corpus negativo, que só o niadra contract test do CI lê, da cópia da própria empresa.
Show child attributes
Show child attributes
Como esta fonte grava turnos, quando o espaço os grava.
Show child attributes
Show child attributes
As vinculações das ferramentas que os agentes desta fonte chamam.
Show child attributes
Show child attributes

