/** * LLM Client Interface * * Abstract interface for LLM providers (Ollama, OpenAI, Anthropic, etc.). * Allows switching between providers without changing application code. */ export interface LLMMessage { role: 'system' | 'user' | 'assistant'; content: string; } export interface LLMResponse { content: string; model: string; finish_reason?: 'stop' | 'length' | 'content_filter'; usage?: { prompt_tokens: number; completion_tokens: number; total_tokens: number; }; } export interface LLMClientConfig { apiKey?: string; baseURL?: string; model?: string; timeout?: number; maxRetries?: number; } export interface ILLMClient { /** * Provider name (ollama, openai, anthropic, mock) */ readonly provider: string; /** * Check if the provider is available and configured */ available(): Promise; /** * Generate a completion from a prompt */ complete(prompt: string, options?: LLMClientConfig): Promise; /** * Generate a completion from a chat (messages) */ chat(messages: LLMMessage[], options?: LLMClientConfig): Promise; }