cag-js
Version:
Chunked Augmented Generation (CAG) algorithm for processing large text inputs with AI models
19 lines (18 loc) • 624 B
TypeScript
/**
* Prepares a prompt by replacing a placeholder with the actual text
* @param template The prompt template with {text} placeholder
* @param text The text to insert into the template
* @returns Prepared prompt string
*/
export declare const prepare_prompt: (template: string, text: string) => string;
/**
* Validates the CAG configuration
* @param config The CAG configuration object
* @throws Error if configuration is invalid
*/
export declare const validateConfig: (config: {
chunkSize: number;
chunkOverlap: number;
iteration_limit?: number;
iteration_output_token_limit?: number;
}) => void;