/** * A/B Testing Pattern * * Allows testing multiple variants simultaneously and measuring their performance * to continuously optimize AI applications. * * @example * ```typescript * const result = await abTest({ * variants: [ * { * name: 'Simple', * weight: 0.33, * execute: async () => generateText({ prompt: 'Explain quantum computing' }) * }, * { * name: 'With Context', * weight: 0.33, * execute: async () => generateText({ * prompt: 'Explain quantum computing to a software developer' * }) * } * ], * userId: 'user-123', * onVariantSelected: (variant, result) => { * analytics.track('variant_selected', { variant: variant.name }); * } * }); * ``` */ import type { ABTestConfig, ABTestResult } from "../types/ab-test"; /** * Simple in-memory storage for sticky assignments using GlobalStorage */ declare class InMemoryAssignmentStorage { private storage; private readonly namespace; constructor(); get(userId: string, experimentId: string): Promise; set(userId: string, experimentId: string, variantName: string): Promise; } /** * Execute an A/B test with the given configuration */ export declare function abTest(config: ABTestConfig): Promise>; /** * Export the in-memory storage for testing purposes */ export { InMemoryAssignmentStorage }; //# sourceMappingURL=ab-test.d.ts.map