# 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"
}Constraints block
What a customer wants, refuses and is, for this turn’s tools; the same block include: ["constraints"] adds to a context read, here renderable for one tool. The signals feature.
# 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"
}Authorizations
nia_sk_...
Body
An identifier of a subject in some channel or system: a phone, an e-mail, a CRM id.
Show child attributes
Show child attributes
1 - 512^(?:self|gift|beneficiary:[A-Za-z0-9_-]{1,64})$Rendered for this tool's bindings.
1 - 256Response
Successful Response
What one subject wants, refuses and is, for the tools of this turn (constraints.v0).
The block as lines for a model, in the space's language, each field by its label and each operator in words; an empty string when the block has nothing to say. Not part of version.
A digest of the block, which the turn record cites.
^cv_[0-9a-f]{8,64}$200Show child attributes
Show child attributes
Questions the agent should ask, as for_whom, before assuming.
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 What gives way first when a search finds nothing: soft, ids.
The block for one tool, through its bindings (constraints.v0, rendering).
Show child attributes
Show child attributes
50Show child attributes
Show child attributes
100Show child attributes
Show child attributes
Show child attributes
Show child attributes

