Save a regression test for an agent
curl --request POST \
--url https://api.orbit.devotel.io/api/v1/agents/{id}/regression-tests \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Refund policy stays accurate",
"description": "Agent must cite the 30-day refund window.",
"conversation_json": [
{
"role": "user",
"content": "What is your refund policy?"
}
],
"expected_outputs": {
"contains": [
"30 days"
],
"excludes": [
"no refunds"
]
}
}
'import requests
url = "https://api.orbit.devotel.io/api/v1/agents/{id}/regression-tests"
payload = {
"name": "Refund policy stays accurate",
"description": "Agent must cite the 30-day refund window.",
"conversation_json": [
{
"role": "user",
"content": "What is your refund policy?"
}
],
"expected_outputs": {
"contains": ["30 days"],
"excludes": ["no refunds"]
}
}
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({
name: 'Refund policy stays accurate',
description: 'Agent must cite the 30-day refund window.',
conversation_json: [{role: 'user', content: 'What is your refund policy?'}],
expected_outputs: {contains: ['30 days'], excludes: ['no refunds']}
})
};
fetch('https://api.orbit.devotel.io/api/v1/agents/{id}/regression-tests', 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.orbit.devotel.io/api/v1/agents/{id}/regression-tests",
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([
'name' => 'Refund policy stays accurate',
'description' => 'Agent must cite the 30-day refund window.',
'conversation_json' => [
[
'role' => 'user',
'content' => 'What is your refund policy?'
]
],
'expected_outputs' => [
'contains' => [
'30 days'
],
'excludes' => [
'no refunds'
]
]
]),
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.orbit.devotel.io/api/v1/agents/{id}/regression-tests"
payload := strings.NewReader("{\n \"name\": \"Refund policy stays accurate\",\n \"description\": \"Agent must cite the 30-day refund window.\",\n \"conversation_json\": [\n {\n \"role\": \"user\",\n \"content\": \"What is your refund policy?\"\n }\n ],\n \"expected_outputs\": {\n \"contains\": [\n \"30 days\"\n ],\n \"excludes\": [\n \"no refunds\"\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.orbit.devotel.io/api/v1/agents/{id}/regression-tests")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Refund policy stays accurate\",\n \"description\": \"Agent must cite the 30-day refund window.\",\n \"conversation_json\": [\n {\n \"role\": \"user\",\n \"content\": \"What is your refund policy?\"\n }\n ],\n \"expected_outputs\": {\n \"contains\": [\n \"30 days\"\n ],\n \"excludes\": [\n \"no refunds\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.orbit.devotel.io/api/v1/agents/{id}/regression-tests")
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 \"name\": \"Refund policy stays accurate\",\n \"description\": \"Agent must cite the 30-day refund window.\",\n \"conversation_json\": [\n {\n \"role\": \"user\",\n \"content\": \"What is your refund policy?\"\n }\n ],\n \"expected_outputs\": {\n \"contains\": [\n \"30 days\"\n ],\n \"excludes\": [\n \"no refunds\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"agent_id": "<string>",
"name": "<string>"
},
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"docs_url": "<string>"
}
}Agents
Save a regression test for an agent
Save a conversation as a regression test for an agent. Provide a name, the conversation turns, and declarative expected_outputs (contains, contains_any, excludes, or verbatim). The test is replayed whenever the prompt, model, or tools change to prove the agent still passes. Requires owner, admin, or developer role.
POST
/
api
/
v1
/
agents
/
{id}
/
regression-tests
Save a regression test for an agent
curl --request POST \
--url https://api.orbit.devotel.io/api/v1/agents/{id}/regression-tests \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Refund policy stays accurate",
"description": "Agent must cite the 30-day refund window.",
"conversation_json": [
{
"role": "user",
"content": "What is your refund policy?"
}
],
"expected_outputs": {
"contains": [
"30 days"
],
"excludes": [
"no refunds"
]
}
}
'import requests
url = "https://api.orbit.devotel.io/api/v1/agents/{id}/regression-tests"
payload = {
"name": "Refund policy stays accurate",
"description": "Agent must cite the 30-day refund window.",
"conversation_json": [
{
"role": "user",
"content": "What is your refund policy?"
}
],
"expected_outputs": {
"contains": ["30 days"],
"excludes": ["no refunds"]
}
}
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({
name: 'Refund policy stays accurate',
description: 'Agent must cite the 30-day refund window.',
conversation_json: [{role: 'user', content: 'What is your refund policy?'}],
expected_outputs: {contains: ['30 days'], excludes: ['no refunds']}
})
};
fetch('https://api.orbit.devotel.io/api/v1/agents/{id}/regression-tests', 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.orbit.devotel.io/api/v1/agents/{id}/regression-tests",
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([
'name' => 'Refund policy stays accurate',
'description' => 'Agent must cite the 30-day refund window.',
'conversation_json' => [
[
'role' => 'user',
'content' => 'What is your refund policy?'
]
],
'expected_outputs' => [
'contains' => [
'30 days'
],
'excludes' => [
'no refunds'
]
]
]),
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.orbit.devotel.io/api/v1/agents/{id}/regression-tests"
payload := strings.NewReader("{\n \"name\": \"Refund policy stays accurate\",\n \"description\": \"Agent must cite the 30-day refund window.\",\n \"conversation_json\": [\n {\n \"role\": \"user\",\n \"content\": \"What is your refund policy?\"\n }\n ],\n \"expected_outputs\": {\n \"contains\": [\n \"30 days\"\n ],\n \"excludes\": [\n \"no refunds\"\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.orbit.devotel.io/api/v1/agents/{id}/regression-tests")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Refund policy stays accurate\",\n \"description\": \"Agent must cite the 30-day refund window.\",\n \"conversation_json\": [\n {\n \"role\": \"user\",\n \"content\": \"What is your refund policy?\"\n }\n ],\n \"expected_outputs\": {\n \"contains\": [\n \"30 days\"\n ],\n \"excludes\": [\n \"no refunds\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.orbit.devotel.io/api/v1/agents/{id}/regression-tests")
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 \"name\": \"Refund policy stays accurate\",\n \"description\": \"Agent must cite the 30-day refund window.\",\n \"conversation_json\": [\n {\n \"role\": \"user\",\n \"content\": \"What is your refund policy?\"\n }\n ],\n \"expected_outputs\": {\n \"contains\": [\n \"30 days\"\n ],\n \"excludes\": [\n \"no refunds\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"agent_id": "<string>",
"name": "<string>"
},
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"docs_url": "<string>"
}
}Authorizations
BearerApiKey
Dashboard JWT token from Clerk
Path Parameters
Identifier of the agent the test belongs to.
Body
application/json
Human-readable name for the saved test.
Required string length:
1 - 200The saved conversation turns to replay.
Required array length:
1 - 40 elementsShow child attributes
Show child attributes
Optional note describing what the test covers.
Maximum string length:
1000Declarative assertions the replayed reply must satisfy.
Show child attributes
Show child attributes
⌘I