# The block comes with the pack, in the same round trip
context = conversation.context(include=["constraints"])
block = context.constraints # hard, soft, attributes, exclude, ask// The block comes with the pack, in the same round trip
const ctx = await convo.context({ include: ["constraints"] });
const block = ctx.constraints; // hard, soft, attributes, exclude, askcurl --request POST \
--url https://{space}.{region}.api.niadra.com/v1/constraints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"subject": {
"value": "<string>",
"scope": "<string>"
},
"conversation_id": "<string>",
"for": "self",
"tool": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
subject: {value: '<string>', scope: '<string>'},
conversation_id: '<string>',
for: 'self',
tool: '<string>'
})
};
fetch('https://{space}.{region}.api.niadra.com/v1/constraints', 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/constraints",
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([
'subject' => [
'value' => '<string>',
'scope' => '<string>'
],
'conversation_id' => '<string>',
'for' => 'self',
'tool' => '<string>'
]),
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://{space}.{region}.api.niadra.com/v1/constraints"
payload := strings.NewReader("{\n \"subject\": {\n \"value\": \"<string>\",\n \"scope\": \"<string>\"\n },\n \"conversation_id\": \"<string>\",\n \"for\": \"self\",\n \"tool\": \"<string>\"\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://{space}.{region}.api.niadra.com/v1/constraints")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"subject\": {\n \"value\": \"<string>\",\n \"scope\": \"<string>\"\n },\n \"conversation_id\": \"<string>\",\n \"for\": \"self\",\n \"tool\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{space}.{region}.api.niadra.com/v1/constraints")
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 \"subject\": {\n \"value\": \"<string>\",\n \"scope\": \"<string>\"\n },\n \"conversation_id\": \"<string>\",\n \"for\": \"self\",\n \"tool\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"text": "<string>",
"version": "<string>",
"already_presented": [
{
"ref": "<string>",
"times": 2,
"last_at": "2023-11-07T05:31:56Z"
}
],
"ask": [
"<string>"
],
"attributes": [
{
"apply": "always",
"confidence": 0.5,
"id": "<string>",
"name": "<string>",
"source": "stated",
"value": true,
"category": "<string>",
"system": "<string>"
}
],
"conflicts": [
{
"by": "current_utterance",
"ids": [
"<string>"
],
"kept": "<string>"
}
],
"exclude": [
"<string>"
],
"hard": [
{
"attr": "<string>",
"id": "<string>",
"op": "in",
"origin": {
"kind": "stated",
"event_key": "<string>",
"turn_id": "<string>"
},
"scope": "turn",
"source": "stated",
"values": [
true
],
"category": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"relax": "never"
}
],
"precedence": [
"current_utterance"
],
"relaxation_order": [
"<string>"
],
"rendered": {
"args": {},
"mode": "advisory",
"tool": "<string>",
"post_filter": [
"<string>"
],
"residual": [
"<string>"
]
},
"rules": [
{
"id": "<string>",
"origin": "<string>",
"rank": 50,
"attr": "<string>",
"op": "in",
"values": [
true
]
}
],
"soft": [
{
"attr": "<string>",
"confidence": 0.5,
"id": "<string>",
"source": "inferred",
"value": true,
"weight": 0.5,
"category": "<string>",
"polarity": "prefer"
}
],
"subject": {
"for": "self"
}
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"request_id": "<string>",
"type": "about:blank"
}Bloco de restrições
O que um cliente quer, recusa e é, para as ferramentas deste turno; o mesmo bloco que include: ["constraints"] acrescenta a uma leitura de contexto, aqui renderizável para uma ferramenta. Funcionalidade signals.
# The block comes with the pack, in the same round trip
context = conversation.context(include=["constraints"])
block = context.constraints # hard, soft, attributes, exclude, ask// The block comes with the pack, in the same round trip
const ctx = await convo.context({ include: ["constraints"] });
const block = ctx.constraints; // hard, soft, attributes, exclude, askcurl --request POST \
--url https://{space}.{region}.api.niadra.com/v1/constraints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"subject": {
"value": "<string>",
"scope": "<string>"
},
"conversation_id": "<string>",
"for": "self",
"tool": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
subject: {value: '<string>', scope: '<string>'},
conversation_id: '<string>',
for: 'self',
tool: '<string>'
})
};
fetch('https://{space}.{region}.api.niadra.com/v1/constraints', 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/constraints",
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([
'subject' => [
'value' => '<string>',
'scope' => '<string>'
],
'conversation_id' => '<string>',
'for' => 'self',
'tool' => '<string>'
]),
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://{space}.{region}.api.niadra.com/v1/constraints"
payload := strings.NewReader("{\n \"subject\": {\n \"value\": \"<string>\",\n \"scope\": \"<string>\"\n },\n \"conversation_id\": \"<string>\",\n \"for\": \"self\",\n \"tool\": \"<string>\"\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://{space}.{region}.api.niadra.com/v1/constraints")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"subject\": {\n \"value\": \"<string>\",\n \"scope\": \"<string>\"\n },\n \"conversation_id\": \"<string>\",\n \"for\": \"self\",\n \"tool\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{space}.{region}.api.niadra.com/v1/constraints")
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 \"subject\": {\n \"value\": \"<string>\",\n \"scope\": \"<string>\"\n },\n \"conversation_id\": \"<string>\",\n \"for\": \"self\",\n \"tool\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"text": "<string>",
"version": "<string>",
"already_presented": [
{
"ref": "<string>",
"times": 2,
"last_at": "2023-11-07T05:31:56Z"
}
],
"ask": [
"<string>"
],
"attributes": [
{
"apply": "always",
"confidence": 0.5,
"id": "<string>",
"name": "<string>",
"source": "stated",
"value": true,
"category": "<string>",
"system": "<string>"
}
],
"conflicts": [
{
"by": "current_utterance",
"ids": [
"<string>"
],
"kept": "<string>"
}
],
"exclude": [
"<string>"
],
"hard": [
{
"attr": "<string>",
"id": "<string>",
"op": "in",
"origin": {
"kind": "stated",
"event_key": "<string>",
"turn_id": "<string>"
},
"scope": "turn",
"source": "stated",
"values": [
true
],
"category": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"relax": "never"
}
],
"precedence": [
"current_utterance"
],
"relaxation_order": [
"<string>"
],
"rendered": {
"args": {},
"mode": "advisory",
"tool": "<string>",
"post_filter": [
"<string>"
],
"residual": [
"<string>"
]
},
"rules": [
{
"id": "<string>",
"origin": "<string>",
"rank": 50,
"attr": "<string>",
"op": "in",
"values": [
true
]
}
],
"soft": [
{
"attr": "<string>",
"confidence": 0.5,
"id": "<string>",
"source": "inferred",
"value": true,
"weight": 0.5,
"category": "<string>",
"polarity": "prefer"
}
],
"subject": {
"for": "self"
}
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"request_id": "<string>",
"type": "about:blank"
}Autorizações
nia_sk_...
Corpo
Um identificador de um sujeito num canal ou sistema: um telefone, um e-mail, um id do CRM.
Show child attributes
Show child attributes
1 - 512^(?:self|gift|beneficiary:[A-Za-z0-9_-]{1,64})$Renderizado para as vinculações desta ferramenta.
1 - 256Resposta
Resposta de sucesso.
O que um cliente quer, recusa e é, para as ferramentas deste turno (constraints.v0).
O bloco em linhas para um modelo, no idioma do espaço, cada campo pelo rótulo dele e cada operador em palavras; uma string vazia quando o bloco não tem nada a dizer. Não entra em version.
Um digest do bloco, que o registro do turno cita.
^cv_[0-9a-f]{8,64}$200Show child attributes
Show child attributes
Perguntas que o agente deve fazer, como for_whom, antes de presumir.
1 - 25650Show child attributes
Show child attributes
50Show child attributes
Show child attributes
200^[a-z][a-z0-9_]{0,39}:[^:\s]{1,256}:\S{1,512}$100Show child attributes
Show child attributes
current_utterance, stated_persistent, inferred O que cede primeiro quando uma busca não acha nada: soft, ids.
O bloco para uma ferramenta, pelas vinculações dela (constraints.v0, renderização).
Show child attributes
Show child attributes
50Show child attributes
Show child attributes
100Show child attributes
Show child attributes
Show child attributes
Show child attributes

