/** * Core types for AgentRails framework */ /** * Tool call definition for validation */ export interface ToolCall { id: string; type: string; function?: { name: string; arguments?: Record; }; } /** * Rail case definition (formerly TestCase) * Can be defined inline in config or loaded from YAML */ export interface RailCase { name: string; description?: string; input: TInput; expectedBehavior?: string; goodResponses?: string[]; badResponses?: string[]; maxTimeAllowed?: number; expectedToolCalls?: string[]; timeout?: number; metadata?: Record; } /** * Rail suite definition (formerly TestSuite) * Can be defined inline in config or loaded from YAML */ export interface RailSuite { suite: string; description?: string; rails: RailCase[]; } /** * Agent implementation that users must provide */ export interface AgentFunction { (input: TInput): Promise; } /** * Rail result for a single rail case (formerly TestResult) */ export interface RailResult { railName: string; passed: boolean; actualResponse: TOutput; evaluationReasoning?: string; error?: string; duration: number; toolCalls?: ToolCall[]; toolCallValidation?: { expected: string[]; actual: string[]; passed: boolean; }; } /** * Complete rail run results (formerly TestRunResult) */ export interface RailRunResult { suiteName: string; totalRails: number; passed: number; failed: number; duration: number; results: RailResult[]; } /** * Supported LLM providers for evaluation */ export type LLMProvider = "openai" | "anthropic" | "google" | "grok"; /** * LLM configuration options */ export interface LLMConfig { provider: LLMProvider; apiKey: string; model?: string; temperature?: number; baseURL?: string; } /** * AgentRails configuration */ export interface AgentRailsConfig { llm: LLMConfig; rails?: RailSuite[]; testMatch?: string[]; timeout?: number; agent: AgentFunction; features?: { e2eTesting?: boolean; toolCallValidation?: boolean; [key: string]: any; }; } /** * LLM Evaluator interface for extensibility */ export interface LLMEvaluator { evaluate(input: TInput, actualResponse: TOutput, expectedBehavior?: string, goodResponses?: string[], badResponses?: string[]): Promise<{ passed: boolean; reasoning: string; }>; } export type TestCase = RailCase; export type TestSuite = RailSuite; export type TestResult = RailResult; export type TestRunResult = RailRunResult; //# sourceMappingURL=types.d.ts.map