Evaluation
Compare
Pairwise comparison for preference-based training (DPO). Compare two responses and determine which is better.
POST
/
api
/
v1
/
compare
cURL
curl --request POST \
--url https://labs.tacitintelligence.co/api/v1/compare \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"collection_slug": "<string>",
"scenario_slug": "<string>",
"response_a": {
"messages": [
{
"content": "<string>",
"tool_calls": [
{
"name": "<string>",
"input": {}
}
]
}
]
},
"response_b": {
"messages": [
{
"content": "<string>",
"tool_calls": [
{
"name": "<string>",
"input": {}
}
]
}
]
}
}
'import requests
url = "https://labs.tacitintelligence.co/api/v1/compare"
payload = {
"collection_slug": "<string>",
"scenario_slug": "<string>",
"response_a": { "messages": [
{
"content": "<string>",
"tool_calls": [
{
"name": "<string>",
"input": {}
}
]
}
] },
"response_b": { "messages": [
{
"content": "<string>",
"tool_calls": [
{
"name": "<string>",
"input": {}
}
]
}
] }
}
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({
collection_slug: '<string>',
scenario_slug: '<string>',
response_a: {messages: [{content: '<string>', tool_calls: [{name: '<string>', input: {}}]}]},
response_b: {messages: [{content: '<string>', tool_calls: [{name: '<string>', input: {}}]}]}
})
};
fetch('https://labs.tacitintelligence.co/api/v1/compare', 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://labs.tacitintelligence.co/api/v1/compare",
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([
'collection_slug' => '<string>',
'scenario_slug' => '<string>',
'response_a' => [
'messages' => [
[
'content' => '<string>',
'tool_calls' => [
[
'name' => '<string>',
'input' => [
]
]
]
]
]
],
'response_b' => [
'messages' => [
[
'content' => '<string>',
'tool_calls' => [
[
'name' => '<string>',
'input' => [
]
]
]
]
]
]
]),
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://labs.tacitintelligence.co/api/v1/compare"
payload := strings.NewReader("{\n \"collection_slug\": \"<string>\",\n \"scenario_slug\": \"<string>\",\n \"response_a\": {\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"tool_calls\": [\n {\n \"name\": \"<string>\",\n \"input\": {}\n }\n ]\n }\n ]\n },\n \"response_b\": {\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"tool_calls\": [\n {\n \"name\": \"<string>\",\n \"input\": {}\n }\n ]\n }\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://labs.tacitintelligence.co/api/v1/compare")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"collection_slug\": \"<string>\",\n \"scenario_slug\": \"<string>\",\n \"response_a\": {\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"tool_calls\": [\n {\n \"name\": \"<string>\",\n \"input\": {}\n }\n ]\n }\n ]\n },\n \"response_b\": {\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"tool_calls\": [\n {\n \"name\": \"<string>\",\n \"input\": {}\n }\n ]\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://labs.tacitintelligence.co/api/v1/compare")
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 \"collection_slug\": \"<string>\",\n \"scenario_slug\": \"<string>\",\n \"response_a\": {\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"tool_calls\": [\n {\n \"name\": \"<string>\",\n \"input\": {}\n }\n ]\n }\n ]\n },\n \"response_b\": {\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"tool_calls\": [\n {\n \"name\": \"<string>\",\n \"input\": {}\n }\n ]\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"reward_a": 0.5,
"reward_b": 0.5,
"margin": 123,
"scoring_version": "<string>"
}{
"error": "<string>",
"details": {}
}Authorizations
API key obtained from Labs Portal
Body
application/json
Response
Success
Which response won: a, b, or tie
Available options:
a, b, tie Reward score for response_a from 0 to 1
Required range:
0 <= x <= 1Reward score for response_b from 0 to 1
Required range:
0 <= x <= 1Absolute difference between reward_a and reward_b
Version of the scoring algorithm used
Previous
Get Key InfoGet information about the current API key including expiration and rate limits
Next
⌘I
cURL
curl --request POST \
--url https://labs.tacitintelligence.co/api/v1/compare \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"collection_slug": "<string>",
"scenario_slug": "<string>",
"response_a": {
"messages": [
{
"content": "<string>",
"tool_calls": [
{
"name": "<string>",
"input": {}
}
]
}
]
},
"response_b": {
"messages": [
{
"content": "<string>",
"tool_calls": [
{
"name": "<string>",
"input": {}
}
]
}
]
}
}
'import requests
url = "https://labs.tacitintelligence.co/api/v1/compare"
payload = {
"collection_slug": "<string>",
"scenario_slug": "<string>",
"response_a": { "messages": [
{
"content": "<string>",
"tool_calls": [
{
"name": "<string>",
"input": {}
}
]
}
] },
"response_b": { "messages": [
{
"content": "<string>",
"tool_calls": [
{
"name": "<string>",
"input": {}
}
]
}
] }
}
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({
collection_slug: '<string>',
scenario_slug: '<string>',
response_a: {messages: [{content: '<string>', tool_calls: [{name: '<string>', input: {}}]}]},
response_b: {messages: [{content: '<string>', tool_calls: [{name: '<string>', input: {}}]}]}
})
};
fetch('https://labs.tacitintelligence.co/api/v1/compare', 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://labs.tacitintelligence.co/api/v1/compare",
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([
'collection_slug' => '<string>',
'scenario_slug' => '<string>',
'response_a' => [
'messages' => [
[
'content' => '<string>',
'tool_calls' => [
[
'name' => '<string>',
'input' => [
]
]
]
]
]
],
'response_b' => [
'messages' => [
[
'content' => '<string>',
'tool_calls' => [
[
'name' => '<string>',
'input' => [
]
]
]
]
]
]
]),
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://labs.tacitintelligence.co/api/v1/compare"
payload := strings.NewReader("{\n \"collection_slug\": \"<string>\",\n \"scenario_slug\": \"<string>\",\n \"response_a\": {\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"tool_calls\": [\n {\n \"name\": \"<string>\",\n \"input\": {}\n }\n ]\n }\n ]\n },\n \"response_b\": {\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"tool_calls\": [\n {\n \"name\": \"<string>\",\n \"input\": {}\n }\n ]\n }\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://labs.tacitintelligence.co/api/v1/compare")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"collection_slug\": \"<string>\",\n \"scenario_slug\": \"<string>\",\n \"response_a\": {\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"tool_calls\": [\n {\n \"name\": \"<string>\",\n \"input\": {}\n }\n ]\n }\n ]\n },\n \"response_b\": {\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"tool_calls\": [\n {\n \"name\": \"<string>\",\n \"input\": {}\n }\n ]\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://labs.tacitintelligence.co/api/v1/compare")
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 \"collection_slug\": \"<string>\",\n \"scenario_slug\": \"<string>\",\n \"response_a\": {\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"tool_calls\": [\n {\n \"name\": \"<string>\",\n \"input\": {}\n }\n ]\n }\n ]\n },\n \"response_b\": {\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"tool_calls\": [\n {\n \"name\": \"<string>\",\n \"input\": {}\n }\n ]\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"reward_a": 0.5,
"reward_b": 0.5,
"margin": 123,
"scoring_version": "<string>"
}{
"error": "<string>",
"details": {}
}