/** * PREPROCESSING PIPELINE - Prompt templates, compression, chunking * Variable substitution, context window management, token optimization */ export interface PreprocessorConfig { enabled: boolean; steps: PreprocessStep[]; max_tokens?: number; context_window?: number; } export declare enum PreprocessStepType { TEMPLATE = "template", VARIABLE_SUBSTITUTION = "variable_substitution", COMPRESSION = "compression", CHUNKING = "chunking", VALIDATION = "validation", SANITIZATION = "sanitization", AUGMENTATION = "augmentation", CUSTOM = "custom" } export interface PreprocessStep { type: PreprocessStepType; name: string; enabled: boolean; config?: Record; order: number; } export interface PreprocessResult { content: string; metadata: Record; tokens_estimated?: number; chunks?: string[]; variables_substituted?: Record; compressed?: boolean; warnings?: string[]; } export interface PromptTemplate { id: string; name: string; template: string; variables: TemplateVariable[]; examples?: TemplateExample[]; metadata?: Record; } export interface TemplateVariable { name: string; type: 'string' | 'number' | 'boolean' | 'array' | 'object'; required: boolean; default?: unknown; description?: string; validation?: VariableValidation; } export interface VariableValidation { pattern?: RegExp; min_length?: number; max_length?: number; min_value?: number; max_value?: number; allowed_values?: unknown[]; } export interface TemplateExample { variables: Record; expected_output: string; } export interface ChunkingConfig { strategy: 'fixed' | 'sentence' | 'paragraph' | 'semantic' | 'sliding_window'; max_chunk_size: number; overlap?: number; separator?: string; } export interface CompressionConfig { method: 'remove_whitespace' | 'remove_stopwords' | 'summarize' | 'abbreviate'; target_ratio?: number; preserve_meaning?: boolean; } export declare class PromptTemplateEngine { private templates; /** * Register a template */ registerTemplate(template: PromptTemplate): void; /** * Get template */ getTemplate(template_id: string): PromptTemplate | null; /** * Render template with variables */ render(template_id: string, variables: Record): { content: string; errors: string[]; }; /** * Validate variables against template */ private validateVariables; private validateValue; } export declare class TextChunker { /** * Chunk text based on configuration */ chunk(text: string, config: ChunkingConfig): string[]; private chunkFixed; private chunkBySentence; private chunkByParagraph; private chunkSlidingWindow; } export declare class TextCompressor { /** * Compress text based on configuration */ compress(text: string, config: CompressionConfig): string; private removeExtraWhitespace; private removeStopwords; private abbreviate; } export declare class PreprocessingPipeline { private template_engine; private chunker; private compressor; private config; constructor(config: PreprocessorConfig); /** * Process text through pipeline */ process(content: string, options?: { template_id?: string; variables?: Record; chunking?: ChunkingConfig; compression?: CompressionConfig; }): Promise; /** * Register a prompt template */ registerTemplate(template: PromptTemplate): void; /** * Get template engine */ getTemplateEngine(): PromptTemplateEngine; private sanitize; private validate; private estimateTokens; } //# sourceMappingURL=preprocessing.d.ts.map