/** * POSTPROCESSING PIPELINE - Response parsing, validation, formatting * Format conversion, error handling, retry logic */ export interface PostprocessorConfig { enabled: boolean; steps: PostprocessStep[]; } export declare enum PostprocessStepType { PARSING = "parsing", VALIDATION = "validation", FORMATTING = "formatting", SANITIZATION = "sanitization", EXTRACTION = "extraction", TRANSFORMATION = "transformation", ENRICHMENT = "enrichment", CUSTOM = "custom" } export interface PostprocessStep { type: PostprocessStepType; name: string; enabled: boolean; config?: Record; order: number; } export interface PostprocessResult { content: string; parsed_data?: unknown; metadata: Record; format?: ResponseFormat; warnings?: string[]; errors?: string[]; } export declare enum ResponseFormat { TEXT = "text", JSON = "json", MARKDOWN = "markdown", HTML = "html", XML = "xml", CSV = "csv", YAML = "yaml" } export interface ValidationRule { type: 'required' | 'min_length' | 'max_length' | 'pattern' | 'json_schema' | 'custom'; config?: Record; error_message?: string; } export interface ExtractionPattern { name: string; pattern: RegExp; transform?: (match: string) => unknown; } export interface FormatConverter { from: ResponseFormat; to: ResponseFormat; convert: (content: string) => string; } export declare class ResponseParser { /** * Parse response based on format */ parse(content: string, format: ResponseFormat): { data: unknown; errors: string[]; }; /** * Extract structured data from text */ extract(content: string, patterns: ExtractionPattern[]): Record; private parseJSON; private parseYAML; private parseCSV; private parseXML; } export declare class ResponseValidator { /** * Validate response against rules */ validate(content: string, rules: ValidationRule[]): { valid: boolean; errors: string[]; }; /** * Validate JSON schema (simplified) */ validateJSONSchema(data: unknown, _schema: Record): { valid: boolean; errors: string[]; }; } export declare class ResponseFormatter { /** * Format response to desired format */ format(content: string, from_format: ResponseFormat, to_format: ResponseFormat): string; /** * Clean and normalize text */ clean(content: string): string; /** * Wrap text at specified width */ wrap(content: string, width?: number): string; private jsonToText; private jsonToMarkdown; private textToMarkdown; private markdownToHTML; private markdownToText; } export declare class PostprocessingPipeline { private parser; private validator; private formatter; private config; constructor(config: PostprocessorConfig); /** * Process response through pipeline */ process(content: string, options?: { format?: ResponseFormat; target_format?: ResponseFormat; validation_rules?: ValidationRule[]; extraction_patterns?: ExtractionPattern[]; }): Promise; /** * Get parser */ getParser(): ResponseParser; /** * Get validator */ getValidator(): ResponseValidator; /** * Get formatter */ getFormatter(): ResponseFormatter; private sanitize; } //# sourceMappingURL=postprocessing.d.ts.map