Skip to main content
Version: 4.7.34

Test results - Get

Retrieves the information for a TestResult with the getTestResult() function.

Example

typescript
import { init, getTestResult } from "@gentrace/core";
 
const testResult = await getTestResult("FACB6642-4725-4FAE-9323-634E72533C89");
 
console.log("Test result ID:", testResult.id);
console.log("Test result pipeline:", testResult.pipeline);
console.log("Test result runs:", testResult.runs);
console.log("Test result first run, first evaluation:", testResult?.runs?.[0]?.evaluations?.[0]);
console.log("Test result first evaluator:", testResult.pipeline?.evaluators?.[0]);

Arguments

resultId: string (UUID)

Return value

resultInfo: ExpandedTestResult

🛑danger

Our API returns a complex, deeply-expanded object that contains result, pipeline, run, evaluation, and evaluator information.

Types

🛠️ ExpandedTestResult

Contains all properties from TestResult (below)

pipeline: ExpandedPipeline

runs: ExpandedTestRun[]

🛠️ ExpandedTestRun

Also contains properties from TestRun (below)

full?: FullRun

steps?: ResolvedStepRun[]

case?: TestCase

evaluations?: TestEvaluation[]

🛠️ FullRun

pipelineRunId: string (UUID)

pipelineId: string (UUID)

organizationId: string (UUID)

startTime: string (ISO 8601)

endTime: string (ISO 8601)

cost?: number

elapsed?: number

feedback?: number

lastInvocation?: string (ISO 8601)

inputs?: object

outputs?: object

renderHTMLKey?: string

metadata?: { [key: string]: MetadataValueObject }

🛠️ ResolvedStepRun

id?: string (UUID)

organizationId?: string (UUID)

providerName?: string

invocation?: string

modelParams?: object

inputs?: object

outputs?: object

startTime?: string (ISO 8601)

endTime?: string (ISO 8601)

pipelineRunId?: string (UUID)

🛠️ TestCase

id: string (UUID)

createdAt: string (ISO 8601)

archivedAt?: string (ISO 8601)

updatedAt: string (ISO 8601)

expectedOutputs?: object

inputs: object

name: string

pipelineId: string (UUID)

🛠️ TestEvaluation

id: string (UUID)

createdAt: string (ISO 8601)

updatedAt: string (ISO 8601)

isPending: boolean

debug?: object

evaluatorId: string (UUID)

runId: string (UUID)

evalLabel?: string

evalValue?: string

manualCreatedByEmail?: string

billingGpt4InputTokens: number

The number of input tokens billed for GPT-4 for this evaluation.

billingGpt4OutputTokens: number

The number of output tokens billed for GPT-4 for this evaluation.

billingGpt35InputTokens: number

The number of input tokens billed for GPT-3.5 for this evaluation.

billingGpt35OutputTokens: number

The number of output tokens billed for GPT-3.5 for this evaluation.

🛠️ TestResult
The `TestResult` type outlines the structure of a test result in TypeScript. Below are the properties of the `TestResult` type.

id: string

createdAt: string

updatedAt: string

pipelineId: string

branch?: string

commit?: string

metadata?: { [key: string]: MetadataValueObject }

name?: string

🛠️ MetadataValueObject

type: string

{ [key: string]: any }

🛠️ ExpandedPipeline

Contains all properties from Pipeline (below)

evaluators: ExpandedTestEvaluator[]

🛠️ Pipeline

id: string (UUID)

createdAt: string (ISO 8601)

updatedAt: string (ISO 8601)

archivedAt?: string (ISO 8601)

labels: string[]

displayName?: string

slug: string

organizationId: string (UUID)

branch?: string

🛠️ TestRun

id: string (UUID)

createdAt: string (ISO 8601)

updatedAt: string (ISO 8601)

caseId: string (UUID)

resultId: string (UUID)

🛠️ TestEvaluator

id: string (UUID)

createdAt: string (ISO 8601)

updatedAt: string (ISO 8601)

archivedAt?: string (ISO 8601)

icon?: string

name: string

options: object

aiModel?: string

pipelineId: string (UUID)

processorId?: string (UUID)

heuristicFn?: string

aiPromptFormat?: string

humanPrompt?: string

who: string

valueType: string

🛠️ MetadataValueObject

type: string

{ [key: string]: any }