/** * Response Validation Pattern * * Automatically validates AI responses against business rules, schemas, or quality criteria. * Retries execution if validation fails, with configurable fallback behavior. * * @example * ```typescript * const result = await validateResponse({ * execute: async () => { * const { object } = await generateObject({ * model: openai('gpt-4-turbo'), * schema: z.object({ * name: z.string(), * price: z.number() * }), * prompt: 'Generate a product' * }); * return object; * }, * validators: [ * { * name: 'price-range', * validate: (response) => response.price > 0 && response.price < 10000, * errorMessage: 'Price must be between $0 and $10,000' * } * ], * maxRetries: 3 * }); * ``` */ import type { ValidateResponseConfig, ValidateResponseResult } from "../types/response-validation"; /** * Validate a response against a set of validators */ export declare function validateResponse(config: ValidateResponseConfig): Promise>; //# sourceMappingURL=response-validation.d.ts.map