Preview agent prompt
curl --request POST \
--url https://api.sidenet.ai/v1/agents/{id}/instructions/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"version": "draft",
"variables": {
"locale": "French",
"instance": {
"store_count": 12
}
}
}
'import requests
url = "https://api.sidenet.ai/v1/agents/{id}/instructions/preview"
payload = {
"version": "draft",
"variables": {
"locale": "French",
"instance": { "store_count": 12 }
}
}
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({version: 'draft', variables: {locale: 'French', instance: {store_count: 12}}})
};
fetch('https://api.sidenet.ai/v1/agents/{id}/instructions/preview', 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.sidenet.ai/v1/agents/{id}/instructions/preview",
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([
'version' => 'draft',
'variables' => [
'locale' => 'French',
'instance' => [
'store_count' => 12
]
]
]),
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.sidenet.ai/v1/agents/{id}/instructions/preview"
payload := strings.NewReader("{\n \"version\": \"draft\",\n \"variables\": {\n \"locale\": \"French\",\n \"instance\": {\n \"store_count\": 12\n }\n }\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.sidenet.ai/v1/agents/{id}/instructions/preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"version\": \"draft\",\n \"variables\": {\n \"locale\": \"French\",\n \"instance\": {\n \"store_count\": 12\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sidenet.ai/v1/agents/{id}/instructions/preview")
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 \"version\": \"draft\",\n \"variables\": {\n \"locale\": \"French\",\n \"instance\": {\n \"store_count\": 12\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"authoredPrompt": "You are a support agent for Acme.\n\nAnswer in English.",
"usesBlocks": true,
"blocks": [
{
"blockId": "d41a8f6b-9c27-4b13-a5e8-2f60c1d7b394",
"blockVersionId": "7e2b5a90-3c48-4d61-b9f7-05a8c2e14d6f",
"name": "Brand voice",
"included": true,
"rendered": "You are a support agent for Acme.",
"missingVariables": []
},
{
"blockId": "1f5c8b23-6d94-4e07-a2b8-9c31e5d70a46",
"blockVersionId": "8a04d7e2-1b63-4c95-8e27-5f9b0a6c3d18",
"name": "Enterprise addendum",
"included": false,
"reason": "display condition not met",
"rendered": "",
"missingVariables": []
}
],
"droppedVariables": []
}Agents
Preview agent prompt
Resolves the agent’s prompt blocks and renders them with the supplied variables, returning the final prompt plus a per-block breakdown: whether each block was included (and why not), what it rendered to, and which of its {{variables}} had no value. version selects which instructions to render — “draft” (default), a published version number, or a version id. Unresolvable block references are an error here (422) rather than being skipped, so you see problems before publishing. Variables rejected by the size/type limits come back in droppedVariables.
POST
/
v1
/
agents
/
{id}
/
instructions
/
preview
Preview agent prompt
curl --request POST \
--url https://api.sidenet.ai/v1/agents/{id}/instructions/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"version": "draft",
"variables": {
"locale": "French",
"instance": {
"store_count": 12
}
}
}
'import requests
url = "https://api.sidenet.ai/v1/agents/{id}/instructions/preview"
payload = {
"version": "draft",
"variables": {
"locale": "French",
"instance": { "store_count": 12 }
}
}
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({version: 'draft', variables: {locale: 'French', instance: {store_count: 12}}})
};
fetch('https://api.sidenet.ai/v1/agents/{id}/instructions/preview', 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.sidenet.ai/v1/agents/{id}/instructions/preview",
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([
'version' => 'draft',
'variables' => [
'locale' => 'French',
'instance' => [
'store_count' => 12
]
]
]),
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.sidenet.ai/v1/agents/{id}/instructions/preview"
payload := strings.NewReader("{\n \"version\": \"draft\",\n \"variables\": {\n \"locale\": \"French\",\n \"instance\": {\n \"store_count\": 12\n }\n }\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.sidenet.ai/v1/agents/{id}/instructions/preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"version\": \"draft\",\n \"variables\": {\n \"locale\": \"French\",\n \"instance\": {\n \"store_count\": 12\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sidenet.ai/v1/agents/{id}/instructions/preview")
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 \"version\": \"draft\",\n \"variables\": {\n \"locale\": \"French\",\n \"instance\": {\n \"store_count\": 12\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"authoredPrompt": "You are a support agent for Acme.\n\nAnswer in English.",
"usesBlocks": true,
"blocks": [
{
"blockId": "d41a8f6b-9c27-4b13-a5e8-2f60c1d7b394",
"blockVersionId": "7e2b5a90-3c48-4d61-b9f7-05a8c2e14d6f",
"name": "Brand voice",
"included": true,
"rendered": "You are a support agent for Acme.",
"missingVariables": []
},
{
"blockId": "1f5c8b23-6d94-4e07-a2b8-9c31e5d70a46",
"blockVersionId": "8a04d7e2-1b63-4c95-8e27-5f9b0a6c3d18",
"name": "Enterprise addendum",
"included": false,
"reason": "display condition not met",
"rendered": "",
"missingVariables": []
}
],
"droppedVariables": []
}Authorizations
Body
application/json
Response
The rendered prompt, and what each block contributed