import os
from scale_gp import SGPClient
client = SGPClient(
api_key=os.environ.get("SGP_API_KEY"), # This is the default and can be omitted
)
test_case_result = client.evaluations.test_case_results.update(
test_case_result_id="test_case_result_id",
evaluation_id="evaluation_id",
)
print(test_case_result)package main
import (
"context"
"fmt"
"github.com/stainless-sdks/sgp-go"
"github.com/stainless-sdks/sgp-go/option"
)
func main() {
client := sgp.NewClient(
option.WithAPIKey("My API Key"),
)
testCaseResult, err := client.Evaluations.TestCaseResults.Update(
context.TODO(),
"evaluation_id",
"test_case_result_id",
sgp.EvaluationTestCaseResultUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", testCaseResult)
}
curl --request PATCH \
--url https://api.egp.scale.com/v4/evaluations/{evaluation_id}/test-case-results/{test_case_result_id} \
--header 'Content-Type: application/json' \
--data '
{
"audit_required": true,
"audit_comment": "<string>",
"application_spec_id": "<string>",
"evaluation_dataset_version_num": "<string>",
"test_case_id": "<string>",
"test_case_evaluation_data": {},
"result": {},
"time_spent_labeling_s": 123,
"account_id": "<string>",
"annotated_by_user_id": "<string>"
}
'const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
audit_required: true,
audit_comment: '<string>',
application_spec_id: '<string>',
evaluation_dataset_version_num: '<string>',
test_case_id: '<string>',
test_case_evaluation_data: {},
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/{test_case_result_id}', 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/{test_case_result_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'audit_required' => true,
'audit_comment' => '<string>',
'application_spec_id' => '<string>',
'evaluation_dataset_version_num' => '<string>',
'test_case_id' => '<string>',
'test_case_evaluation_data' => [
],
'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;
}HttpResponse<String> response = Unirest.patch("https://api.egp.scale.com/v4/evaluations/{evaluation_id}/test-case-results/{test_case_result_id}")
.header("Content-Type", "application/json")
.body("{\n \"audit_required\": true,\n \"audit_comment\": \"<string>\",\n \"application_spec_id\": \"<string>\",\n \"evaluation_dataset_version_num\": \"<string>\",\n \"test_case_id\": \"<string>\",\n \"test_case_evaluation_data\": {},\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/{test_case_result_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"audit_required\": true,\n \"audit_comment\": \"<string>\",\n \"application_spec_id\": \"<string>\",\n \"evaluation_dataset_version_num\": \"<string>\",\n \"test_case_id\": \"<string>\",\n \"test_case_evaluation_data\": {},\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": {}
}
]
}Update Test Case Result
Description
Updates a test case result
Details
This API can be used to update the test case result that matches the ID that was passed in as a path parameter. To use this API, pass in the id that was returned from your Create Test Case Result API call as a path parameter.
Review the request schema to see the fields that can be updated.
import os
from scale_gp import SGPClient
client = SGPClient(
api_key=os.environ.get("SGP_API_KEY"), # This is the default and can be omitted
)
test_case_result = client.evaluations.test_case_results.update(
test_case_result_id="test_case_result_id",
evaluation_id="evaluation_id",
)
print(test_case_result)package main
import (
"context"
"fmt"
"github.com/stainless-sdks/sgp-go"
"github.com/stainless-sdks/sgp-go/option"
)
func main() {
client := sgp.NewClient(
option.WithAPIKey("My API Key"),
)
testCaseResult, err := client.Evaluations.TestCaseResults.Update(
context.TODO(),
"evaluation_id",
"test_case_result_id",
sgp.EvaluationTestCaseResultUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", testCaseResult)
}
curl --request PATCH \
--url https://api.egp.scale.com/v4/evaluations/{evaluation_id}/test-case-results/{test_case_result_id} \
--header 'Content-Type: application/json' \
--data '
{
"audit_required": true,
"audit_comment": "<string>",
"application_spec_id": "<string>",
"evaluation_dataset_version_num": "<string>",
"test_case_id": "<string>",
"test_case_evaluation_data": {},
"result": {},
"time_spent_labeling_s": 123,
"account_id": "<string>",
"annotated_by_user_id": "<string>"
}
'const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
audit_required: true,
audit_comment: '<string>',
application_spec_id: '<string>',
evaluation_dataset_version_num: '<string>',
test_case_id: '<string>',
test_case_evaluation_data: {},
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/{test_case_result_id}', 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/{test_case_result_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'audit_required' => true,
'audit_comment' => '<string>',
'application_spec_id' => '<string>',
'evaluation_dataset_version_num' => '<string>',
'test_case_id' => '<string>',
'test_case_evaluation_data' => [
],
'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;
}HttpResponse<String> response = Unirest.patch("https://api.egp.scale.com/v4/evaluations/{evaluation_id}/test-case-results/{test_case_result_id}")
.header("Content-Type", "application/json")
.body("{\n \"audit_required\": true,\n \"audit_comment\": \"<string>\",\n \"application_spec_id\": \"<string>\",\n \"evaluation_dataset_version_num\": \"<string>\",\n \"test_case_id\": \"<string>\",\n \"test_case_evaluation_data\": {},\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/{test_case_result_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"audit_required\": true,\n \"audit_comment\": \"<string>\",\n \"application_spec_id\": \"<string>\",\n \"evaluation_dataset_version_num\": \"<string>\",\n \"test_case_id\": \"<string>\",\n \"test_case_evaluation_data\": {},\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
PENDING, COMPLETED, FAILED UNAUDITED, FIXED, APPROVED Show child attributes
Show child attributes
user, service_account user, service_account 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'.
PENDING, COMPLETED, FAILED Show child attributes
Show child attributes
The unique identifier of the entity.
The date and time when the entity was created in ISO format.
The date and time when the entity was last updated in ISO format.
The ID of the account that owns the given entity.
The user who originally created the entity.
The type of identity that created the entity.
user, service_account UNAUDITED, FIXED, APPROVED "GENERATION"The result of the test case evaluation, in JSON form where the key is the question ID and the value is the result.
Show child attributes
Show child attributes
The time spent labeling in seconds.
The date and time when the entity was overwritten or deleted in ISO format.
The user who annotated the task.
The type of identity that annotated the entity.
user, service_account The user who edited the task.
The type of identity that edited the entity.
user, service_account The date and time when the entity was archived in ISO format.
Show child attributes
Show child attributes

