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
)
auto_generated_draft_test_case = client.evaluation_datasets.autogenerated_draft_test_cases.update(
autogenerated_draft_test_case_id="autogenerated_draft_test_case_id",
evaluation_dataset_id="evaluation_dataset_id",
)
print(auto_generated_draft_test_case.id)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"),
)
autoGeneratedDraftTestCase, err := client.EvaluationDatasets.AutogeneratedDraftTestCases.Update(
context.TODO(),
"evaluation_dataset_id",
"autogenerated_draft_test_case_id",
sgp.EvaluationDatasetAutogeneratedDraftTestCaseUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", autoGeneratedDraftTestCase.ID)
}curl --request PATCH \
--url https://api.egp.scale.com/v4/evaluation-datasets/{evaluation_dataset_id}/autogenerated-draft-test-cases/{autogenerated_draft_test_case_id} \
--header 'Content-Type: application/json' \
--data '
{
"schema_type": "<string>",
"test_case_data": {
"input": "<string>",
"artifact_ids_filter": [
"<string>"
],
"expected_output": "<string>",
"expected_extra_info": {
"chunks": [
{
"text": "<string>",
"metadata": {}
}
],
"schema_type": "CHUNKS"
}
},
"approved": true
}
'const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
schema_type: '<string>',
test_case_data: {
input: '<string>',
artifact_ids_filter: ['<string>'],
expected_output: '<string>',
expected_extra_info: {chunks: [{text: '<string>', metadata: {}}], schema_type: 'CHUNKS'}
},
approved: true
})
};
fetch('https://api.egp.scale.com/v4/evaluation-datasets/{evaluation_dataset_id}/autogenerated-draft-test-cases/{autogenerated_draft_test_case_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/evaluation-datasets/{evaluation_dataset_id}/autogenerated-draft-test-cases/{autogenerated_draft_test_case_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([
'schema_type' => '<string>',
'test_case_data' => [
'input' => '<string>',
'artifact_ids_filter' => [
'<string>'
],
'expected_output' => '<string>',
'expected_extra_info' => [
'chunks' => [
[
'text' => '<string>',
'metadata' => [
]
]
],
'schema_type' => 'CHUNKS'
]
],
'approved' => true
]),
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/evaluation-datasets/{evaluation_dataset_id}/autogenerated-draft-test-cases/{autogenerated_draft_test_case_id}")
.header("Content-Type", "application/json")
.body("{\n \"schema_type\": \"<string>\",\n \"test_case_data\": {\n \"input\": \"<string>\",\n \"artifact_ids_filter\": [\n \"<string>\"\n ],\n \"expected_output\": \"<string>\",\n \"expected_extra_info\": {\n \"chunks\": [\n {\n \"text\": \"<string>\",\n \"metadata\": {}\n }\n ],\n \"schema_type\": \"CHUNKS\"\n }\n },\n \"approved\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.egp.scale.com/v4/evaluation-datasets/{evaluation_dataset_id}/autogenerated-draft-test-cases/{autogenerated_draft_test_case_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 \"schema_type\": \"<string>\",\n \"test_case_data\": {\n \"input\": \"<string>\",\n \"artifact_ids_filter\": [\n \"<string>\"\n ],\n \"expected_output\": \"<string>\",\n \"expected_extra_info\": {\n \"chunks\": [\n {\n \"text\": \"<string>\",\n \"metadata\": {}\n }\n ],\n \"schema_type\": \"CHUNKS\"\n }\n },\n \"approved\": true\n}"
response = http.request(request)
puts response.read_body{
"evaluation_dataset_id": "<string>",
"test_case_data": {
"input": "<string>",
"artifact_ids_filter": [
"<string>"
],
"expected_output": "<string>",
"expected_extra_info": {
"chunks": [
{
"text": "<string>",
"metadata": {}
}
],
"schema_type": "CHUNKS"
}
},
"approved": true,
"content_metadata": {},
"id": "<string>",
"account_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"created_by_user_id": "<string>",
"schema_type": "GENERATION",
"topic_str": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Update Autogenerated Draft Test Case
Description
Update a test case draft.
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
)
auto_generated_draft_test_case = client.evaluation_datasets.autogenerated_draft_test_cases.update(
autogenerated_draft_test_case_id="autogenerated_draft_test_case_id",
evaluation_dataset_id="evaluation_dataset_id",
)
print(auto_generated_draft_test_case.id)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"),
)
autoGeneratedDraftTestCase, err := client.EvaluationDatasets.AutogeneratedDraftTestCases.Update(
context.TODO(),
"evaluation_dataset_id",
"autogenerated_draft_test_case_id",
sgp.EvaluationDatasetAutogeneratedDraftTestCaseUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", autoGeneratedDraftTestCase.ID)
}curl --request PATCH \
--url https://api.egp.scale.com/v4/evaluation-datasets/{evaluation_dataset_id}/autogenerated-draft-test-cases/{autogenerated_draft_test_case_id} \
--header 'Content-Type: application/json' \
--data '
{
"schema_type": "<string>",
"test_case_data": {
"input": "<string>",
"artifact_ids_filter": [
"<string>"
],
"expected_output": "<string>",
"expected_extra_info": {
"chunks": [
{
"text": "<string>",
"metadata": {}
}
],
"schema_type": "CHUNKS"
}
},
"approved": true
}
'const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
schema_type: '<string>',
test_case_data: {
input: '<string>',
artifact_ids_filter: ['<string>'],
expected_output: '<string>',
expected_extra_info: {chunks: [{text: '<string>', metadata: {}}], schema_type: 'CHUNKS'}
},
approved: true
})
};
fetch('https://api.egp.scale.com/v4/evaluation-datasets/{evaluation_dataset_id}/autogenerated-draft-test-cases/{autogenerated_draft_test_case_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/evaluation-datasets/{evaluation_dataset_id}/autogenerated-draft-test-cases/{autogenerated_draft_test_case_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([
'schema_type' => '<string>',
'test_case_data' => [
'input' => '<string>',
'artifact_ids_filter' => [
'<string>'
],
'expected_output' => '<string>',
'expected_extra_info' => [
'chunks' => [
[
'text' => '<string>',
'metadata' => [
]
]
],
'schema_type' => 'CHUNKS'
]
],
'approved' => true
]),
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/evaluation-datasets/{evaluation_dataset_id}/autogenerated-draft-test-cases/{autogenerated_draft_test_case_id}")
.header("Content-Type", "application/json")
.body("{\n \"schema_type\": \"<string>\",\n \"test_case_data\": {\n \"input\": \"<string>\",\n \"artifact_ids_filter\": [\n \"<string>\"\n ],\n \"expected_output\": \"<string>\",\n \"expected_extra_info\": {\n \"chunks\": [\n {\n \"text\": \"<string>\",\n \"metadata\": {}\n }\n ],\n \"schema_type\": \"CHUNKS\"\n }\n },\n \"approved\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.egp.scale.com/v4/evaluation-datasets/{evaluation_dataset_id}/autogenerated-draft-test-cases/{autogenerated_draft_test_case_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 \"schema_type\": \"<string>\",\n \"test_case_data\": {\n \"input\": \"<string>\",\n \"artifact_ids_filter\": [\n \"<string>\"\n ],\n \"expected_output\": \"<string>\",\n \"expected_extra_info\": {\n \"chunks\": [\n {\n \"text\": \"<string>\",\n \"metadata\": {}\n }\n ],\n \"schema_type\": \"CHUNKS\"\n }\n },\n \"approved\": true\n}"
response = http.request(request)
puts response.read_body{
"evaluation_dataset_id": "<string>",
"test_case_data": {
"input": "<string>",
"artifact_ids_filter": [
"<string>"
],
"expected_output": "<string>",
"expected_extra_info": {
"chunks": [
{
"text": "<string>",
"metadata": {}
}
],
"schema_type": "CHUNKS"
}
},
"approved": true,
"content_metadata": {},
"id": "<string>",
"account_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"created_by_user_id": "<string>",
"schema_type": "GENERATION",
"topic_str": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Body
"GENERATION"The data for the test case in a format matching the provided schema_type
- ArtifactSchemaGeneration
- SchemaGenerationBase
Show child attributes
Show child attributes
Boolean to track whether or not the draft test case is approved
Response
Successful Response
The ID of the associated evaluation dataset.
The data for the test case in a format matching the provided schema_type
- ArtifactSchemaGeneration
- SchemaGenerationBase
Show child attributes
Show child attributes
Boolean to track whether or not the draft test case is approved
Metadata for the chunks and artifacts that were used to generate this draft test case.
The unique identifier of the entity.
The ID of the account that owns the given 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 user who originally created the entity.
The type of identity that created the entity.
user, service_account "GENERATION"
