/** * Natural Language Test Assertions — write test assertions in plain English. * * Evaluates assertions like "Response mentions temperature" against agent outputs * using pattern matching, keyword extraction, and semantic heuristics. * * @module nl-assert */ import type { AssertionResult } from './types'; export interface NLAssertion { text: string; negated: boolean; category: NLAssertionCategory; keywords: string[]; } export type NLAssertionCategory = 'contains' | 'not_contains' | 'tone' | 'format' | 'factual' | 'length' | 'safety' | 'custom'; export interface NLTestCase { input: string; assertions: string[]; tags?: string[]; } export interface NLTestSuite { name: string; description?: string; tests: NLTestCase[]; } export interface NLEvalResult { assertion: string; passed: boolean; confidence: number; reason: string; } export interface NLTestResult { input: string; output: string; results: NLEvalResult[]; allPassed: boolean; } /** * Parse a natural language assertion string into structured form. */ export declare function parseNLAssertion(text: string): NLAssertion; /** * Categorize an assertion into a type. */ export declare function categorizeAssertion(text: string): NLAssertionCategory; /** * Extract meaningful keywords from assertion text. */ export declare function extractKeywords(text: string): string[]; /** * Evaluate a single NL assertion against an output string. */ export declare function evaluateNLAssertion(assertion: NLAssertion, output: string): NLEvalResult; /** * Evaluate all NL assertions for a test case against an output. */ export declare function evaluateNLTest(testCase: NLTestCase, output: string): NLTestResult; /** * Convert NL eval results to standard AssertionResults for integration with the test runner. */ export declare function nlResultsToAssertions(nlResult: NLTestResult): AssertionResult[]; /** * Format NL test results for display. */ export declare function formatNLResults(results: NLTestResult[]): string; //# sourceMappingURL=nl-assert.d.ts.map