Create Test Case Result
curl --request POST \
--url https://api.egp.scale.com/v4/evaluations/{evaluation_id}/test-case-results \
--header 'Content-Type: application/json' \
--data '
{
"application_spec_id": "<string>",
"evaluation_dataset_version_num": "<string>",
"test_case_id": "<string>",
"test_case_evaluation_data": {},
"audit_required": true,
"audit_comment": "<string>",
"result": {},
"time_spent_labeling_s": 123,
"account_id": "<string>",
"annotated_by_user_id": "<string>"
}
'import requests
url = "https://api.egp.scale.com/v4/evaluations/{evaluation_id}/test-case-results"
payload = {
"application_spec_id": "<string>",
"evaluation_dataset_version_num": "<string>",
"test_case_id": "<string>",
"test_case_evaluation_data": {},
"audit_required": True,
"audit_comment": "<string>",
"result": {},
"time_spent_labeling_s": 123,
"account_id": "<string>",
"annotated_by_user_id": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
application_spec_id: '<string>',
evaluation_dataset_version_num: '<string>',
test_case_id: '<string>',
test_case_evaluation_data: {},
audit_required: true,
audit_comment: '<string>',
result: {},
time_spent_labeling_s: 123,
account_id: '<string>',
annotated_by_user_id: '<string>'
})
};
fetch('https://api.egp.scale.com/v4/evaluations/{evaluation_id}/test-case-results', 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.egp.scale.com/v4/evaluations/{evaluation_id}/test-case-results",
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([
'application_spec_id' => '<string>',
'evaluation_dataset_version_num' => '<string>',
'test_case_id' => '<string>',
'test_case_evaluation_data' => [
],
'audit_required' => true,
'audit_comment' => '<string>',
'result' => [
],
'time_spent_labeling_s' => 123,
'account_id' => '<string>',
'annotated_by_user_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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.egp.scale.com/v4/evaluations/{evaluation_id}/test-case-results"
payload := strings.NewReader("{\n \"application_spec_id\": \"<string>\",\n \"evaluation_dataset_version_num\": \"<string>\",\n \"test_case_id\": \"<string>\",\n \"test_case_evaluation_data\": {},\n \"audit_required\": true,\n \"audit_comment\": \"<string>\",\n \"result\": {},\n \"time_spent_labeling_s\": 123,\n \"account_id\": \"<string>\",\n \"annotated_by_user_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.egp.scale.com/v4/evaluations/{evaluation_id}/test-case-results")
.header("Content-Type", "application/json")
.body("{\n \"application_spec_id\": \"<string>\",\n \"evaluation_dataset_version_num\": \"<string>\",\n \"test_case_id\": \"<string>\",\n \"test_case_evaluation_data\": {},\n \"audit_required\": true,\n \"audit_comment\": \"<string>\",\n \"result\": {},\n \"time_spent_labeling_s\": 123,\n \"account_id\": \"<string>\",\n \"annotated_by_user_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.egp.scale.com/v4/evaluations/{evaluation_id}/test-case-results")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"application_spec_id\": \"<string>\",\n \"evaluation_dataset_version_num\": \"<string>\",\n \"test_case_id\": \"<string>\",\n \"test_case_evaluation_data\": {},\n \"audit_required\": true,\n \"audit_comment\": \"<string>\",\n \"result\": {},\n \"time_spent_labeling_s\": 123,\n \"account_id\": \"<string>\",\n \"annotated_by_user_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"label_status": "PENDING",
"application_spec_id": "<string>",
"evaluation_id": "<string>",
"evaluation_dataset_id": "<string>",
"evaluation_dataset_version_num": "<string>",
"test_case_id": "<string>",
"test_case_evaluation_data": {
"generation_output": "<string>",
"generation_extra_info": {
"chunks": [
{
"text": "<string>",
"metadata": {}
}
],
"schema_type": "CHUNKS"
}
},
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"account_id": "<string>",
"created_by_user_id": "<string>",
"created_by_identity_type": "user",
"audit_status": "UNAUDITED",
"audit_required": true,
"audit_comment": "<string>",
"test_case_evaluation_data_schema": "GENERATION",
"result": {},
"completed_at": "2023-11-07T05:31:56Z",
"time_spent_labeling_s": 123,
"application_test_case_output_id": "<string>",
"invalidated_at": "2023-11-07T05:31:56Z",
"annotated_by_user_id": "<string>",
"annotated_by_identity_type": "user",
"edited_by_user_id": "<string>",
"edited_by_identity_type": "user",
"archived_at": "2023-11-07T05:31:56Z",
"edited_by": {
"id": "<string>",
"email": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"preferences": {}
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Evaluations
Create Test Case Result
Description
Creates a test case result
Details
This API can be used to create a test case result. To use this API, review the request schema and pass in all fields that are required to create a test case result.
POST
/
v4
/
evaluations
/
{evaluation_id}
/
test-case-results
Create Test Case Result
curl --request POST \
--url https://api.egp.scale.com/v4/evaluations/{evaluation_id}/test-case-results \
--header 'Content-Type: application/json' \
--data '
{
"application_spec_id": "<string>",
"evaluation_dataset_version_num": "<string>",
"test_case_id": "<string>",
"test_case_evaluation_data": {},
"audit_required": true,
"audit_comment": "<string>",
"result": {},
"time_spent_labeling_s": 123,
"account_id": "<string>",
"annotated_by_user_id": "<string>"
}
'import requests
url = "https://api.egp.scale.com/v4/evaluations/{evaluation_id}/test-case-results"
payload = {
"application_spec_id": "<string>",
"evaluation_dataset_version_num": "<string>",
"test_case_id": "<string>",
"test_case_evaluation_data": {},
"audit_required": True,
"audit_comment": "<string>",
"result": {},
"time_spent_labeling_s": 123,
"account_id": "<string>",
"annotated_by_user_id": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
application_spec_id: '<string>',
evaluation_dataset_version_num: '<string>',
test_case_id: '<string>',
test_case_evaluation_data: {},
audit_required: true,
audit_comment: '<string>',
result: {},
time_spent_labeling_s: 123,
account_id: '<string>',
annotated_by_user_id: '<string>'
})
};
fetch('https://api.egp.scale.com/v4/evaluations/{evaluation_id}/test-case-results', 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.egp.scale.com/v4/evaluations/{evaluation_id}/test-case-results",
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([
'application_spec_id' => '<string>',
'evaluation_dataset_version_num' => '<string>',
'test_case_id' => '<string>',
'test_case_evaluation_data' => [
],
'audit_required' => true,
'audit_comment' => '<string>',
'result' => [
],
'time_spent_labeling_s' => 123,
'account_id' => '<string>',
'annotated_by_user_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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.egp.scale.com/v4/evaluations/{evaluation_id}/test-case-results"
payload := strings.NewReader("{\n \"application_spec_id\": \"<string>\",\n \"evaluation_dataset_version_num\": \"<string>\",\n \"test_case_id\": \"<string>\",\n \"test_case_evaluation_data\": {},\n \"audit_required\": true,\n \"audit_comment\": \"<string>\",\n \"result\": {},\n \"time_spent_labeling_s\": 123,\n \"account_id\": \"<string>\",\n \"annotated_by_user_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.egp.scale.com/v4/evaluations/{evaluation_id}/test-case-results")
.header("Content-Type", "application/json")
.body("{\n \"application_spec_id\": \"<string>\",\n \"evaluation_dataset_version_num\": \"<string>\",\n \"test_case_id\": \"<string>\",\n \"test_case_evaluation_data\": {},\n \"audit_required\": true,\n \"audit_comment\": \"<string>\",\n \"result\": {},\n \"time_spent_labeling_s\": 123,\n \"account_id\": \"<string>\",\n \"annotated_by_user_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.egp.scale.com/v4/evaluations/{evaluation_id}/test-case-results")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"application_spec_id\": \"<string>\",\n \"evaluation_dataset_version_num\": \"<string>\",\n \"test_case_id\": \"<string>\",\n \"test_case_evaluation_data\": {},\n \"audit_required\": true,\n \"audit_comment\": \"<string>\",\n \"result\": {},\n \"time_spent_labeling_s\": 123,\n \"account_id\": \"<string>\",\n \"annotated_by_user_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"label_status": "PENDING",
"application_spec_id": "<string>",
"evaluation_id": "<string>",
"evaluation_dataset_id": "<string>",
"evaluation_dataset_version_num": "<string>",
"test_case_id": "<string>",
"test_case_evaluation_data": {
"generation_output": "<string>",
"generation_extra_info": {
"chunks": [
{
"text": "<string>",
"metadata": {}
}
],
"schema_type": "CHUNKS"
}
},
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"account_id": "<string>",
"created_by_user_id": "<string>",
"created_by_identity_type": "user",
"audit_status": "UNAUDITED",
"audit_required": true,
"audit_comment": "<string>",
"test_case_evaluation_data_schema": "GENERATION",
"result": {},
"completed_at": "2023-11-07T05:31:56Z",
"time_spent_labeling_s": 123,
"application_test_case_output_id": "<string>",
"invalidated_at": "2023-11-07T05:31:56Z",
"annotated_by_user_id": "<string>",
"annotated_by_identity_type": "user",
"edited_by_user_id": "<string>",
"edited_by_identity_type": "user",
"archived_at": "2023-11-07T05:31:56Z",
"edited_by": {
"id": "<string>",
"email": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"preferences": {}
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Body
application/json
The status of the test case result. This should not be explictly set when creating a test case result. When patching a test case result, this field can be set to 'PENDING' to prevent the test case result from being marked 'COMPLETED'.
Available options:
PENDING, COMPLETED, FAILED Response
Successful Response
- GenerationTestCaseResultResponse
- FlexibleTestCaseResultResponse
The status of the test case result. This should not be explictly set when creating a test case result. When patching a test case result, this field can be set to 'PENDING' to prevent the test case result from being marked 'COMPLETED'.
Available options:
PENDING, COMPLETED, FAILED