import type { EmbeddingProvider } from '../config-schema.js'; /** * All embedding providers implement this interface. */ export interface Embedder { /** The dimensionality of vectors produced by this embedder */ readonly dimensions: number; /** * Embed a batch of texts. Returns one vector per input text. * Implementations should handle batching/rate-limiting internally. */ embed(texts: string[]): Promise; /** * Optional: the provider identity ACTUALLY serving embeds, once known * (mmnto-ai/totem#2562). `LazyEmbedder` reports its post-resolution — * possibly Ollama-fallback — identity here, and `null` before the first * embed resolves. Absent means the constructed identity is the effective * one. Consumers that persist an embedder fingerprint (the full-sync * checkpoint) must prefer this over the configured identity, or a silent * fallback would mix vector spaces across a resume. */ describeEffective?(): { provider: string; model: string; dimensions: number; } | null; /** * Optional: FORCE resolution and return the identity that will serve this * run's embeds (mmnto-ai/totem#2562, falsification round 2). A resume * decision must compare effective-vs-effective — the configured identity is * unknowably wrong in both directions before resolution: a run silently * falling back would pass a config match and mix vector spaces at the first * insert, and a persistent fallback would spuriously restart every attempt. * Throws when no embedder is available at all (same failure the first * embed would hit, just earlier and with state intact). */ resolveEffective?(): Promise<{ provider: string; model: string; dimensions: number; }>; } /** * Probe the Ollama daemon's `/api/tags` endpoint to determine whether it's * reachable. Used internally by `LazyEmbedder`'s fallback chain and exported * for `totem doctor`'s floor-expectation diagnostic (mmnto-ai/totem#1851). * * Never throws — network errors, timeouts, ECONNREFUSED, and non-2xx * responses all resolve to `false`. Bounded by a 3-second `AbortSignal` * timeout. */ export declare function isOllamaAvailable(baseUrl?: string): Promise; /** * Create an embedder from config. If the configured provider's SDK or API key * is missing, falls back to Ollama. If Ollama isn't available either, throws * a clear error. * * Returns synchronously via a lazy proxy that resolves on first embed() call. * * @param onWarn Optional callback for fallback warnings (defaults to a no-op) */ export declare function createEmbedder(config: EmbeddingProvider, onWarn?: (msg: string) => void): Embedder; /** * The terminal "no embedder anywhere" failure message. Exported as the single * source of truth because `LanceStore.isNoEmbedderError` keys its opt-in FTS * degradation on recognizing exactly this failure (mmnto-ai/totem#2463) — a * wording change here propagates to the detector instead of silently * decoupling it. */ export declare const NO_EMBEDDER_AVAILABLE_MESSAGE = "No embedding provider available. The configured provider failed and Ollama is not running."; //# sourceMappingURL=embedder.d.ts.map