Edit a submitted human evaluation
curl --request POST \
--url https://api.galtea.ai/evaluations/{id}/edit-human \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"score": 0.95,
"reason": "Evaluation reason"
}
'import requests
url = "https://api.galtea.ai/evaluations/{id}/edit-human"
payload = {
"score": 0.95,
"reason": "Evaluation reason"
}
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({score: 0.95, reason: 'Evaluation reason'})
};
fetch('https://api.galtea.ai/evaluations/{id}/edit-human', 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/evaluations/{id}/edit-human",
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([
'score' => 0.95,
'reason' => 'Evaluation reason'
]),
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/evaluations/{id}/edit-human"
payload := strings.NewReader("{\n \"score\": 0.95,\n \"reason\": \"Evaluation reason\"\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/evaluations/{id}/edit-human")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"score\": 0.95,\n \"reason\": \"Evaluation reason\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galtea.ai/evaluations/{id}/edit-human")
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 \"score\": 0.95,\n \"reason\": \"Evaluation reason\"\n}"
response = http.request(request)
puts response.read_body{
"id": "eval_123",
"metricId": "metric_123",
"sessionId": "session_123",
"productId": "product_123",
"userId": "user_123",
"status": "SUCCESS",
"inferenceResultId": "ir_123",
"score": 0.95,
"reason": "High quality response",
"error": "<string>",
"canRetry": false,
"creditsUsed": 1,
"judgeInputTokens": 4100,
"judgeOutputTokens": 16800,
"judgeReasoningTokens": 12400,
"conversationSimulatorVersion": "1.0.0",
"humanEvaluatorId": "<string>",
"humanEvaluatorStartedAt": "2023-11-07T05:31:56Z",
"humanScore": 123,
"humanReason": "<string>",
"humanEvaluatorFinishedAt": "2023-11-07T05:31:56Z",
"failedTurns": [
"<string>"
],
"monitorId": "<string>",
"monitorSettledAtTurn": 123,
"monitorSamplingPercentage": 123,
"runId": "<string>",
"deletedAt": "2023-11-07T05:31:56Z",
"evaluatedAt": "2023-11-07T05:31:56Z",
"metricLegacyAt": "2023-11-07T05:31:56Z",
"passed": true,
"metricPassThreshold": 0.5,
"metricDisabledAt": "2023-11-07T05:31:56Z",
"metricExcludedFromAnalyticsAt": "2023-11-07T05:31:56Z",
"metricExcludedByUserId": "<string>",
"testCaseLegacyAt": "2023-11-07T05:31:56Z",
"scoreBreakdown": {
"version": 123,
"model": "<string>",
"type": "yes_no",
"value": 123,
"confidence": 123,
"pYes": 0.5,
"goodAnswer": "yes",
"probabilities": {},
"levelScores": [
123
],
"doesNotApply": true
},
"confidence": 0.9,
"longInput": true,
"createdAt": "2023-11-07T05:31:56Z"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}Edit a submitted human evaluation
Edit the score and reason for a previously submitted human evaluation or annotation. On an AI-judged metric, any user who may annotate the evaluation can edit it. On a HUMAN_EVALUATION metric the user must also belong to one of the metric’s user groups, which only an admin skips. The edit reassigns the human evaluator to the caller. See Evaluations.
POST
/
evaluations
/
{id}
/
edit-human
Edit a submitted human evaluation
curl --request POST \
--url https://api.galtea.ai/evaluations/{id}/edit-human \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"score": 0.95,
"reason": "Evaluation reason"
}
'import requests
url = "https://api.galtea.ai/evaluations/{id}/edit-human"
payload = {
"score": 0.95,
"reason": "Evaluation reason"
}
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({score: 0.95, reason: 'Evaluation reason'})
};
fetch('https://api.galtea.ai/evaluations/{id}/edit-human', 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/evaluations/{id}/edit-human",
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([
'score' => 0.95,
'reason' => 'Evaluation reason'
]),
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/evaluations/{id}/edit-human"
payload := strings.NewReader("{\n \"score\": 0.95,\n \"reason\": \"Evaluation reason\"\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/evaluations/{id}/edit-human")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"score\": 0.95,\n \"reason\": \"Evaluation reason\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galtea.ai/evaluations/{id}/edit-human")
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 \"score\": 0.95,\n \"reason\": \"Evaluation reason\"\n}"
response = http.request(request)
puts response.read_body{
"id": "eval_123",
"metricId": "metric_123",
"sessionId": "session_123",
"productId": "product_123",
"userId": "user_123",
"status": "SUCCESS",
"inferenceResultId": "ir_123",
"score": 0.95,
"reason": "High quality response",
"error": "<string>",
"canRetry": false,
"creditsUsed": 1,
"judgeInputTokens": 4100,
"judgeOutputTokens": 16800,
"judgeReasoningTokens": 12400,
"conversationSimulatorVersion": "1.0.0",
"humanEvaluatorId": "<string>",
"humanEvaluatorStartedAt": "2023-11-07T05:31:56Z",
"humanScore": 123,
"humanReason": "<string>",
"humanEvaluatorFinishedAt": "2023-11-07T05:31:56Z",
"failedTurns": [
"<string>"
],
"monitorId": "<string>",
"monitorSettledAtTurn": 123,
"monitorSamplingPercentage": 123,
"runId": "<string>",
"deletedAt": "2023-11-07T05:31:56Z",
"evaluatedAt": "2023-11-07T05:31:56Z",
"metricLegacyAt": "2023-11-07T05:31:56Z",
"passed": true,
"metricPassThreshold": 0.5,
"metricDisabledAt": "2023-11-07T05:31:56Z",
"metricExcludedFromAnalyticsAt": "2023-11-07T05:31:56Z",
"metricExcludedByUserId": "<string>",
"testCaseLegacyAt": "2023-11-07T05:31:56Z",
"scoreBreakdown": {
"version": 123,
"model": "<string>",
"type": "yes_no",
"value": 123,
"confidence": 123,
"pYes": 0.5,
"goodAnswer": "yes",
"probabilities": {},
"levelScores": [
123
],
"doesNotApply": true
},
"confidence": 0.9,
"longInput": true,
"createdAt": "2023-11-07T05:31:56Z"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}You are reading the docs of Galtea 5.14. Read this page in the latest version.
Authorizations
Headers
Body
application/json
Response
Evaluation updated successfully. The body is the resource as its GET answers it.