import type { EmbeddingConfig, CreateBackendResult } from './types.js'; export * from './types.js'; export { chunkArray } from './types.js'; export { OllamaBackend, DEFAULT_OLLAMA_MODEL } from './ollama.js'; export { GeminiBackend } from './gemini.js'; export { RateLimiter, type RateLimiterConfig } from './rate-limiter.js'; /** * Create an embedding backend based on configuration and available credentials. * * Tries backends in priority order: * 1. Gemini (if GEMINI_API_KEY environment variable is set) - free tier, recommended * 2. Ollama (local fallback, requires Ollama to be running) * * If an explicitly configured backend fails to initialize (e.g., rate limited), * automatically falls back to Ollama and returns fallback info. * * @param config - Optional configuration to customize the backend * @returns A promise resolving to the backend and optional fallback info * @throws Error if no backend is available (no API keys and Ollama not running) * * @example * ```typescript * // Use automatic backend selection * const { backend } = await createEmbeddingBackend(); * * // Force a specific backend (will fallback to Ollama on failure) * const { backend, fallback } = await createEmbeddingBackend({ backend: 'gemini' }); * if (fallback) { * console.warn(`Fell back to ${fallback.fallbackBackend}: ${fallback.reason}`); * } * ``` */ export declare function createEmbeddingBackend(config?: Partial): Promise; //# sourceMappingURL=index.d.ts.map