Skip to main content
POST
/
v4
/
evaluation-datasets
/
{evaluation_dataset_id}
/
approve-batch
Python
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_approve_batch_response = client.evaluation_datasets.approve_batch(
    evaluation_dataset_id="evaluation_dataset_id",
    autogenerated_draft_test_cases=["string"],
)
print(auto_generated_draft_test_case_approve_batch_response.autogenerated_draft_test_cases)
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"),
)
autoGeneratedDraftTestCaseApproveBatchResponse, err := client.EvaluationDatasets.ApproveBatch(
context.TODO(),
"evaluation_dataset_id",
sgp.EvaluationDatasetApproveBatchParams{
AutogeneratedDraftTestCases: sgp.F([]string{"string"}),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", autoGeneratedDraftTestCaseApproveBatchResponse.AutogeneratedDraftTestCases)
}
curl --request POST \
--url https://api.egp.scale.com/v4/evaluation-datasets/{evaluation_dataset_id}/approve-batch \
--header 'Content-Type: application/json' \
--data '
{
"autogenerated_draft_test_cases": [
"<string>"
]
}
'
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({autogenerated_draft_test_cases: ['<string>']})
};

fetch('https://api.egp.scale.com/v4/evaluation-datasets/{evaluation_dataset_id}/approve-batch', 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}/approve-batch",
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([
'autogenerated_draft_test_cases' => [
'<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.post("https://api.egp.scale.com/v4/evaluation-datasets/{evaluation_dataset_id}/approve-batch")
.header("Content-Type", "application/json")
.body("{\n \"autogenerated_draft_test_cases\": [\n \"<string>\"\n ]\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.egp.scale.com/v4/evaluation-datasets/{evaluation_dataset_id}/approve-batch")

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 \"autogenerated_draft_test_cases\": [\n \"<string>\"\n ]\n}"

response = http.request(request)
puts response.read_body
{
  "success": true,
  "autogenerated_draft_test_cases": [
    {
      "autogenerated_draft_test_case_id": "<string>",
      "success": true,
      "failed_chunks": [
        {
          "chunk_text": "<string>",
          "artifact_id": "<string>",
          "artifact_name": "<string>",
          "artifact_content_modification_identifier": "<string>"
        }
      ]
    }
  ]
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}

Path Parameters

evaluation_dataset_id
string
required

Query Parameters

force
boolean
default:false

Force approve a batch of autogenerated test case IDs for the evaluation dataset

Body

application/json
autogenerated_draft_test_cases
string[]
required

Ids of auto generated draft test cases to be approved.

Response

Successful Response

success
boolean
required

Whether or not the batch approval was successful

autogenerated_draft_test_cases
ApproveAutoGeneratedDraftTestCaseResponse · object[]
required

List of responses for each of the input draft test cases.