UNPKG

@yogesh0333/yogiway-prompt

Version:

Free & Open Source Prompt Optimization Library - Save 30-50% on AI API costs. Multi-language, multi-platform support.

21 lines (20 loc) 480 B
/** * Smart Chunker - Intelligent text chunking for large prompts */ export interface ChunkOptions { maxTokens: number; overlap?: number; strategy?: 'paragraph' | 'sentence' | 'word' | 'smart'; preserveStructure?: boolean; } export interface Chunk { text: string; tokens: number; index: number; start: number; end: number; } /** * Chunk text intelligently */ export declare function chunkText(text: string, options: ChunkOptions): Chunk[];