Test results - Get
- TypeScript
- Python
Retrieves the information for a TestResult
with the getTestResult()
function.
Retrieves the information for a TestResult
with the get_test_result()
function.
Example
typescript
import {init ,getTestResult } from "@gentrace/core";consttestResult = awaitgetTestResult ("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]);
python
import osimport gentracegentrace.init(api_key=os.getenv("GENTRACE_API_KEY"))test_result = gentrace.get_test_result("ede8271a-699f-4db7-a198-2c51a99e2dab")test_result_id = test_result.get('id')test_result_pipeline = test_result.get('pipeline')test_result_runs = test_result.get('runs')test_result_first_run_first_evaluation = test_result.get('runs', [{}])[0].get('evaluations', [])[0]test_result_first_evaluator = test_result.get('pipeline', {}).get('evaluators', [])[0]print("Test result ID:", test_result_id)print("Test result pipeline:", test_result_pipeline)print("Test result runs:", test_result_runs)print("Test result first run, first evaluation:", test_result_first_run_first_evaluation)print("Test result first evaluator:", test_result_first_evaluator)
Arguments
resultId: string (UUID)
result_id: str (UUID)
The unique identifier for the test result as a UUID string.
Return value
resultInfo: ExpandedTestResult
result_info: ExpandedTestResult
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
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 }