curl --request POST \
--url https://api.galtea.ai/metrics/preview-prompt \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"definition": "custom_judge",
"judgePrompt": "<string>",
"evaluationParams": [],
"areEvalParamsTop": true
}
'import requests
url = "https://api.galtea.ai/metrics/preview-prompt"
payload = {
"definition": "custom_judge",
"judgePrompt": "<string>",
"evaluationParams": [],
"areEvalParamsTop": True
}
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({
definition: 'custom_judge',
judgePrompt: '<string>',
evaluationParams: [],
areEvalParamsTop: true
})
};
fetch('https://api.galtea.ai/metrics/preview-prompt', 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.galtea.ai/metrics/preview-prompt",
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([
'definition' => 'custom_judge',
'judgePrompt' => '<string>',
'evaluationParams' => [
],
'areEvalParamsTop' => true
]),
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.galtea.ai/metrics/preview-prompt"
payload := strings.NewReader("{\n \"definition\": \"custom_judge\",\n \"judgePrompt\": \"<string>\",\n \"evaluationParams\": [],\n \"areEvalParamsTop\": true\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.galtea.ai/metrics/preview-prompt")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"definition\": \"custom_judge\",\n \"judgePrompt\": \"<string>\",\n \"evaluationParams\": [],\n \"areEvalParamsTop\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galtea.ai/metrics/preview-prompt")
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 \"definition\": \"custom_judge\",\n \"judgePrompt\": \"<string>\",\n \"evaluationParams\": [],\n \"areEvalParamsTop\": true\n}"
response = http.request(request)
puts response.read_body{
"prompts": [
{
"turnScope": "one_turn",
"systemPrompt": "<string>",
"userPrompt": "<string>",
"outputSchema": {}
}
]
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}Preview the prompt a judge configuration produces
Assembles the prompt for a configuration that has not been saved, with {placeholders} in place of a test case. Reads no model and calls none, so it consumes no credits. A configuration usually produces two shapes, because turn count comes from the session.
curl --request POST \
--url https://api.galtea.ai/metrics/preview-prompt \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"definition": "custom_judge",
"judgePrompt": "<string>",
"evaluationParams": [],
"areEvalParamsTop": true
}
'import requests
url = "https://api.galtea.ai/metrics/preview-prompt"
payload = {
"definition": "custom_judge",
"judgePrompt": "<string>",
"evaluationParams": [],
"areEvalParamsTop": True
}
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({
definition: 'custom_judge',
judgePrompt: '<string>',
evaluationParams: [],
areEvalParamsTop: true
})
};
fetch('https://api.galtea.ai/metrics/preview-prompt', 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.galtea.ai/metrics/preview-prompt",
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([
'definition' => 'custom_judge',
'judgePrompt' => '<string>',
'evaluationParams' => [
],
'areEvalParamsTop' => true
]),
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.galtea.ai/metrics/preview-prompt"
payload := strings.NewReader("{\n \"definition\": \"custom_judge\",\n \"judgePrompt\": \"<string>\",\n \"evaluationParams\": [],\n \"areEvalParamsTop\": true\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.galtea.ai/metrics/preview-prompt")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"definition\": \"custom_judge\",\n \"judgePrompt\": \"<string>\",\n \"evaluationParams\": [],\n \"areEvalParamsTop\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galtea.ai/metrics/preview-prompt")
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 \"definition\": \"custom_judge\",\n \"judgePrompt\": \"<string>\",\n \"evaluationParams\": [],\n \"areEvalParamsTop\": true\n}"
response = http.request(request)
puts response.read_body{
"prompts": [
{
"turnScope": "one_turn",
"systemPrompt": "<string>",
"userPrompt": "<string>",
"outputSchema": {}
}
]
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}Authorizations
API key authorization. Pass your API key in the Authorization header as a Bearer token. Both new (gsk_*) and legacy (gsk-) API keys are accepted, e.g. Authorization: Bearer gsk_... or Authorization: Bearer gsk-....
Body
Only the sources whose judge prompt Galtea builds can be previewed.
FULL_PROMPT, PARTIAL_PROMPT Selects the evaluator implementation. Absent means a custom judge.
1"custom_judge"
Required by a custom judge. An empty one is refused with a 400.
20000201 - 64Whether the parameters block precedes the judge prompt.
Response
Assembled prompts
Show child attributes
Show child attributes