POST
/
v4
/
evaluation-datasets
/
{evaluation_dataset_id}
/
autogenerated-draft-test-cases
/
{autogenerated_draft_test_case_id}
/
approve
import SGPClient from 'sgp';

const client = new SGPClient({
  apiKey: process.env['SGP_API_KEY'], // This is the default and can be omitted
});

async function main() {
  const approveAutoGeneratedDraftTestCaseResponse =
    await client.evaluationDatasets.autogeneratedDraftTestCases.approve(
      'evaluation_dataset_id',
      'autogenerated_draft_test_case_id',
    );

  console.log(approveAutoGeneratedDraftTestCaseResponse.autogenerated_draft_test_case_id);
}

main();
{
  "autogenerated_draft_test_case_id": "<string>",
  "success": true,
  "failed_chunks": [
    {
      "chunk_text": "<string>",
      "artifact_id": "<string>",
      "artifact_name": "<string>",
      "artifact_content_modification_identifier": "<string>"
    }
  ]
}

Authorizations

x-api-key
string
header
required

Headers

x-selected-account-id
string | null

Path Parameters

evaluation_dataset_id
string
required
autogenerated_draft_test_case_id
string
required

Query Parameters

force
boolean
default:
false

Force approve a failing test case

Response

200
application/json
Successful Response
autogenerated_draft_test_case_id
string
required

Draft test_case_id that has chunk_ids missing

success
boolean
required

Whether or not the test case was successfully approved

failed_chunks
object[]
required