/** * Smart Context Window Management Pattern * * Automatically manages context token limits by truncating, summarizing, * or chunking content to prevent context_length_exceeded errors. * * @example * ```typescript * import { smartContextWindow, ContextStrategy } from 'ai-patterns'; * * const result = await smartContextWindow({ * execute: async (messages) => { * return await generateText({ * model: openai('gpt-4-turbo'), * messages * }); * }, * messages: conversationHistory, * maxTokens: 120000, * strategy: ContextStrategy.SLIDING_WINDOW, * keepRecentCount: 50 * }); * ``` */ import type { SmartContextWindowConfig, SmartContextWindowResult, Message } from "../types/context-window"; /** * Smart context window management */ export declare function smartContextWindow(config: SmartContextWindowConfig): Promise>; /** * Helper function to create a summarizer using an AI model */ export declare function createAISummarizer(summarizeFn: (messages: Message[]) => Promise): (messages: Message[]) => Promise; //# sourceMappingURL=context-window.d.ts.map