Skip to content
  • Auto
  • Light
  • Dark

Create

Create Evaluation Test Case.
client.agents.evaluationTestCases.create(EvaluationTestCaseCreateParams { dataset_uuid, description, metrics, 3 more } body?, RequestOptionsoptions?): EvaluationTestCaseCreateResponse { test_case_uuid }
post/v2/gen-ai/evaluation_test_cases

To create an evaluation test-case send a POST request to /v2/gen-ai/evaluation_test_cases.

ParametersExpand Collapse
body: EvaluationTestCaseCreateParams { dataset_uuid, description, metrics, 3 more }
dataset_uuid?: string

Dataset against which the test‑case is executed.

description?: string

Description of the test case.

metrics?: Array<string>

Full metric list to use for evaluation test case.

name?: string

Name of the test case.

star_metric?: APIStarMetric { metric_uuid, name, success_threshold, success_threshold_pct }
metric_uuid?: string
name?: string
success_threshold?: number

The success threshold for the star metric. This is a value that the metric must reach to be considered successful.

formatfloat
success_threshold_pct?: number

The success threshold for the star metric. This is a percentage value between 0 and 100.

formatint32
workspace_uuid?: string

The workspace uuid.

ReturnsExpand Collapse
EvaluationTestCaseCreateResponse { test_case_uuid }
test_case_uuid?: string

Test‑case UUID.

Create Evaluation Test Case.
import Gradient from '@digitalocean/gradient';

const client = new Gradient();

const evaluationTestCase = await client.agents.evaluationTestCases.create();

console.log(evaluationTestCase.test_case_uuid);
{
  "test_case_uuid": "123e4567-e89b-12d3-a456-426614174000"
}
Returns Examples
{
  "test_case_uuid": "123e4567-e89b-12d3-a456-426614174000"
}