/** * @artemiskit/sdk * Fluent builders for constructing scenarios and test cases * * Provides a type-safe, fluent API for building ArtemisKit scenarios * programmatically without manually constructing complex objects. */ import type { ChatMessageType, Expected, Provider, Scenario, TestCase, Variables } from '@artemiskit/core'; import type { RedactionConfig } from '@artemiskit/core'; /** * Fluent builder for constructing test cases */ export declare class TestCaseBuilder { private _id; private _name?; private _description?; private _prompt; private _expected?; private _tags; private _metadata; private _timeout?; private _retries; private _provider?; private _model?; private _variables?; private _redaction?; constructor(id: string); /** * Set the test case name (display name) */ name(name: string): this; /** * Set the test case description */ description(description: string): this; /** * Set the prompt as a simple string */ prompt(prompt: string): this; /** * Set the prompt as chat messages */ messages(messages: ChatMessageType[]): this; /** * Add a system message followed by a user message */ systemAndUser(systemPrompt: string, userPrompt: string): this; /** * Expect an exact match */ expectExact(value: string, caseSensitive?: boolean): this; /** * Expect the response to contain specific values */ expectContains(values: string[], mode?: 'all' | 'any'): this; /** * Expect the response to NOT contain specific values */ expectNotContains(values: string[], mode?: 'all' | 'any'): this; /** * Expect a regex match */ expectRegex(pattern: string, flags?: string): this; /** * Expect a fuzzy match with similarity threshold */ expectFuzzy(value: string, threshold?: number): this; /** * Expect a JSON response matching a schema */ expectJsonSchema(schema: Record): this; /** * Expect response to pass LLM grading with a rubric */ expectLLMGrade(rubric: string, options?: { threshold?: number; model?: string; provider?: Provider; }): this; /** * Expect semantic similarity */ expectSimilarity(value: string, options?: { threshold?: number; mode?: 'embedding' | 'llm'; model?: string; embeddingModel?: string; }): this; /** * Expect an inline expression to evaluate to true */ expectInline(expression: string, value?: string): this; /** * Combine multiple expectations with AND logic * Note: Pass base expectations (not combined) for proper type inference */ expectAll(...expectations: Expected[]): this; /** * Combine multiple expectations with OR logic * Note: Pass base expectations (not combined) for proper type inference */ expectAny(...expectations: Expected[]): this; /** * Set a custom expectation */ expect(expected: Expected): this; /** * Add tags to the test case */ tags(...tags: string[]): this; /** * Add metadata to the test case */ metadata(data: Record): this; /** * Set timeout for this test case */ timeout(ms: number): this; /** * Set number of retries for this test case */ retries(count: number): this; /** * Override provider for this test case */ provider(provider: Provider): this; /** * Override model for this test case */ model(model: string): this; /** * Set variables for this test case */ variables(vars: Variables): this; /** * Enable redaction for this test case */ redact(config: RedactionConfig): this; /** * Build the test case object */ build(): TestCase; } /** * Fluent builder for constructing scenarios */ export declare class ScenarioBuilder { private _name; private _description?; private _version; private _provider?; private _model?; private _providerConfig?; private _seed?; private _temperature?; private _maxTokens?; private _tags; private _variables?; private _redaction?; private _systemPrompt?; private _cases; constructor(name: string); /** * Set the scenario description */ description(description: string): this; /** * Set the scenario version */ version(version: string): this; /** * Set the default provider */ provider(provider: Provider): this; /** * Set the default model */ model(model: string): this; /** * Set provider configuration */ providerConfig(config: Record): this; /** * Set the random seed for reproducibility */ seed(seed: number): this; /** * Set the temperature */ temperature(temp: number): this; /** * Set max tokens */ maxTokens(tokens: number): this; /** * Add tags to the scenario */ tags(...tags: string[]): this; /** * Set variables for template substitution */ variables(vars: Variables): this; /** * Set redaction configuration */ redact(config: RedactionConfig): this; /** * Set a system prompt for all test cases */ systemPrompt(prompt: string): this; /** * Add a test case using a builder */ case(caseBuilder: TestCaseBuilder): this; /** * Add a test case directly */ addCase(testCase: TestCase): this; /** * Add multiple test cases */ cases(...caseBuilders: TestCaseBuilder[]): this; /** * Build the scenario object */ build(): Scenario; } /** * Create a new scenario builder * * @example * ```typescript * import { scenario, testCase } from '@artemiskit/sdk/builders' * * const myScenario = scenario('Math Tests') * .provider('openai') * .model('gpt-4') * .description('Basic math verification tests') * .case( * testCase('addition') * .prompt('What is 2 + 2?') * .expectContains(['4']) * ) * .case( * testCase('multiplication') * .prompt('What is 6 * 7?') * .expectContains(['42']) * ) * .build() * ``` */ export declare function scenario(name: string): ScenarioBuilder; /** * Create a new test case builder * * @example * ```typescript * import { testCase } from '@artemiskit/sdk/builders' * * const case1 = testCase('json-output') * .prompt('Return a JSON object with name and age') * .expectJsonSchema({ * type: 'object', * required: ['name', 'age'], * properties: { * name: { type: 'string' }, * age: { type: 'number' } * } * }) * .tags('json', 'structured') * .build() * ``` */ export declare function testCase(id: string): TestCaseBuilder; /** * Create a simple test case with contains expectation */ export declare function containsCase(id: string, prompt: string, values: string[], mode?: 'all' | 'any'): TestCase; /** * Create a simple test case with exact match expectation */ export declare function exactCase(id: string, prompt: string, value: string): TestCase; /** * Create a simple test case with regex expectation */ export declare function regexCase(id: string, prompt: string, pattern: string, flags?: string): TestCase; /** * Create a simple test case with JSON schema expectation */ export declare function jsonCase(id: string, prompt: string, schema: Record): TestCase; /** * Create a simple test case with LLM grading */ export declare function gradedCase(id: string, prompt: string, rubric: string, threshold?: number): TestCase; /** * Create an exact match expectation */ export declare function exact(value: string, caseSensitive?: boolean): Expected; /** * Create a contains expectation */ export declare function contains(values: string[], mode?: 'all' | 'any'): Expected; /** * Create a not_contains expectation */ export declare function notContains(values: string[], mode?: 'all' | 'any'): Expected; /** * Create a regex expectation */ export declare function regex(pattern: string, flags?: string): Expected; /** * Create a fuzzy match expectation */ export declare function fuzzy(value: string, threshold?: number): Expected; /** * Create a JSON schema expectation */ export declare function jsonSchema(schema: Record): Expected; /** * Create an LLM grader expectation */ export declare function llmGrade(rubric: string, options?: { threshold?: number; model?: string; provider?: Provider; }): Expected; /** * Create a similarity expectation */ export declare function similarity(value: string, options?: { threshold?: number; mode?: 'embedding' | 'llm'; model?: string; embeddingModel?: string; }): Expected; /** * Create an inline expression expectation */ export declare function inline(expression: string, value?: string): Expected; /** * Combine expectations with AND logic * Note: Pass base expectations (not combined) for proper type inference */ export declare function allOf(...expectations: Expected[]): Expected; /** * Combine expectations with OR logic * Note: Pass base expectations (not combined) for proper type inference */ export declare function anyOf(...expectations: Expected[]): Expected; //# sourceMappingURL=index.d.ts.map