Skip to main content
Version: 4.7.8

Evaluation - Bulk create

The function bulkCreateEvaluations() creates multiple Evaluations in a single request.

Example

typescript
import { bulkCreateEvaluations, CreateEvaluationType, getTestResult } from "@gentrace/core";
 
const EXAMPLE_RESULT_ID = "492ef124-aca1-4640-8c9c-641c874acdb7";
 
const EXAMPLE_EVALUATOR_ID = "e1117752-01fe-568c-9ee0-5e160352031d"
 
const result = await getTestResult(EXAMPLE_RESULT_ID);
 
const runs = result.runs ?? [];
 
const evaluationPayloads: CreateEvaluationType[] = runs.map((run) => {
return {
evaluatorId: EXAMPLE_EVALUATOR_ID,
runId: run.id,
evalLabel: "A",
};
});
 
const creationCount = await bulkCreateEvaluations(evaluationPayloads);
 
console.log("Creation count: ", creationCount);

Arguments

evaluationPayloads: CreateEvaluationType[]

Types

🛠️ CreateEvaluationType

note?: string

evaluatorId: string (UUID)

runId: string (UUID)

evalLabel?: string

evalValue?: number