import type { RLMConfig, RLMResult } from '../types/index.js'; interface Message { role: 'system' | 'user' | 'assistant'; content: string; } /** * Callback type for LLM completions. * The RLM engine is LLM-agnostic — the caller provides the completion function. * This works with any provider: OpenAI, Anthropic, Ollama, LiteLLM, etc. */ export type LLMCompletionFn = (messages: Message[]) => Promise; export declare class RLMEngine { private config; private repl; private llmComplete; constructor(llmComplete: LLMCompletionFn, config?: Partial); /** * Analyze a document with a query using the RLM pattern. * * The full document text is stored as a Python variable — it is NEVER * sent to the LLM directly. The LLM interacts with it through code execution. * * @param query - The user's question about the document * @param context - The full document text (can be millions of characters) * @returns RLMResult with the answer, iteration count, and code execution count */ analyze(query: string, context: string): Promise; private runAnalysisLoop; /** * Handle recursive LLM calls from within the REPL. * The sub-context IS sent directly in the prompt (it should be small enough). */ private callRecursiveLLM; /** * Parse FINAL(answer) or FINAL_VAR(var_name) from LLM output. */ private parseFinalAnswer; /** * Extract Python code blocks from LLM response. * Supports ```python ... ``` and ``` ... ``` formats. */ private extractCodeBlocks; } export {}; //# sourceMappingURL=rlm-engine.d.ts.map