import { LruCacheManager } from "../utils/cache/CacheManager"; import type { LLMAdapter } from "../llms"; import { type QirrelContext } from "../types"; import type { PipelineComponent, EventHandler } from "./types"; import { PipelineEvent } from "./Events"; import type { MiniparseConfig } from "../config/defaults"; export declare class Pipeline { private readonly components; private readonly tokenizer; private readonly config; private readonly cacheManager; private llmAdapter?; private llmInitPromise; private eventHandlers; constructor(configPath?: string); /** * Subscribe to pipeline events */ on(event: PipelineEvent, handler: EventHandler): this; /** * Unsubscribe from pipeline events */ off(event: PipelineEvent, handler: EventHandler): this; /** * Emit an event with optional payload */ private emit; use(component: PipelineComponent): this; init(): Promise; process(text: string): Promise; getConfig(): MiniparseConfig; addCustomProcessor(component: PipelineComponent): this; getLLMAdapter(): LLMAdapter | undefined; addLLMProcessor(processor: PipelineComponent): this; /** * Get the cache manager instance */ getCacheManager(): LruCacheManager; /** * Check if a result is cached for the given text */ isCached(text: string): boolean; /** * Get cached result for the given text */ getCached(text: string): QirrelContext | undefined; /** * Cache a result for the given text */ setCached(text: string, result: QirrelContext, ttl?: number): void; processBatch(texts: string[], options?: { concurrency?: number; }): Promise; /** * Wrap a component with caching if it's cacheable and caching is enabled */ private wrapComponentWithCache; /** * Generate a cache key for the given text */ private generateCacheKey; private cloneContext; }