export interface OllamaChatOptions { baseUrl?: string; model?: string; timeoutMs?: number; system?: string; temperature?: number; format?: "json"; } export interface OllamaChatResult { ok: true; content: string; model: string; eval_count?: number; eval_duration?: number; } export interface OllamaChatFailure { ok: false; reason: "unreachable" | "timeout" | "bad_status" | "parse_error"; status?: number; message: string; } /** * Small wrapper around Ollama's /api/chat endpoint. Returns a structured * result + failure union so callers can gracefully degrade instead of * throwing. The network call is the only async primitive; no streaming * — concept labeling generates short JSON replies so streaming adds * complexity without value. */ export declare function ollamaChat(prompt: string, opts?: OllamaChatOptions): Promise; /** * Attempt to parse the LLM response as JSON. Accepts both raw JSON and * JSON wrapped in a markdown code fence — we're strict enough to reject * garbage but generous about fencing since some models prepend "Here is...". */ export declare function parseJsonResponse(raw: string): { ok: true; value: T; } | { ok: false; message: string; };