judgeval
Version:
Judgment SDK for TypeScript/JavaScript
83 lines (82 loc) • 2.49 kB
TypeScript
/**
* Represents an example for evaluation
*/
export interface ExampleOptions {
input: string;
actualOutput?: string | string[];
expectedOutput?: string | string[];
context?: string[];
retrievalContext?: string[];
additionalMetadata?: Record<string, any>;
toolsCalled?: string[];
expectedTools?: string[];
name?: string;
exampleId?: string;
exampleIndex?: number;
timestamp?: string;
traceId?: string;
example?: boolean;
}
export declare class Example {
input: string;
actualOutput?: string | string[];
expectedOutput?: string | string[];
context?: string[];
retrievalContext?: string[];
additionalMetadata?: Record<string, any>;
toolsCalled?: string[];
expectedTools?: string[];
name?: string;
exampleId: string;
exampleIndex?: number;
timestamp?: string;
traceId?: string;
example?: boolean;
constructor(options: ExampleOptions);
/**
* Generate a UUID for the example ID
*/
private generateUUID;
/**
* Builder pattern for creating an Example
*/
static builder(): ExampleBuilder;
/**
* Convert the example to a plain object
*/
toJSON(): Record<string, any>;
}
/**
* Builder for creating Example instances
*/
export declare class ExampleBuilder {
private _input;
private _actualOutput?;
private _expectedOutput?;
private _context?;
private _retrievalContext?;
private _additionalMetadata?;
private _toolsCalled?;
private _expectedTools?;
private _name?;
private _exampleId?;
private _exampleIndex?;
private _timestamp?;
private _traceId?;
private _example?;
input(input: string): ExampleBuilder;
actualOutput(actualOutput: string | string[]): ExampleBuilder;
expectedOutput(expectedOutput: string | string[]): ExampleBuilder;
context(context: string[]): ExampleBuilder;
retrievalContext(retrievalContext: string[]): ExampleBuilder;
additionalMetadata(additionalMetadata: Record<string, any>): ExampleBuilder;
toolsCalled(toolsCalled: string[]): ExampleBuilder;
expectedTools(expectedTools: string[]): ExampleBuilder;
name(name: string): ExampleBuilder;
exampleId(exampleId: string): ExampleBuilder;
exampleIndex(exampleIndex: number): ExampleBuilder;
timestamp(timestamp: string): ExampleBuilder;
traceId(traceId: string): ExampleBuilder;
example(example: boolean): ExampleBuilder;
build(): Example;
}