import type { EmbeddingProviderCallContext, EmbeddingProviderCapabilities, EmbeddingProviderInfo, EmbeddingProviderRequest, EmbeddingProviderResult, EmbeddingsProvider } from '../types/embeddings.js'; /** * Hosted embedding adapters. * * They share one file because each is a single request/response mapping over `fetch` with no SDK * and no shared state; splitting them would repeat the HTTP and decoding helpers five times. */ export interface EmbeddingAdapterOptions { /** API key. */ apiKey?: string; /** API base URL. Each adapter has its own default. */ baseUrl?: string; /** Model used when a request names none. */ model?: string; /** Headers added to every request. */ headers?: Record; /** Replaces the global `fetch`, for proxying or tests. */ fetch?: typeof fetch; } /** Options for any server that speaks the OpenAI `/embeddings` protocol. */ export interface OpenAICompatibleEmbeddingOptions extends EmbeddingAdapterOptions { /** Name this adapter reports and registers under. */ providerName?: string; /** Replaces the declared capabilities, for a compatible server with different limits. */ capabilities?: Partial; } declare abstract class HttpEmbeddingProvider implements EmbeddingsProvider { protected readonly options: EmbeddingAdapterOptions; abstract readonly info: EmbeddingProviderInfo; constructor(options?: EmbeddingAdapterOptions); abstract embed(request: EmbeddingProviderRequest, context: EmbeddingProviderCallContext): Promise; protected post(url: string, body: unknown, model: string, signal: AbortSignal): Promise; protected authHeaders(): Record; protected baseUrl(fallback: string): string; } /** * OpenAI and any OpenAI-compatible `/embeddings` endpoint. * * `baseUrl` points it at Azure OpenAI, a gateway, or a self-hosted server; `model` sets the default * when the request names none. */ export declare class OpenAIEmbeddingProvider extends HttpEmbeddingProvider { /** Provider name, capabilities, and models. */ readonly info: EmbeddingProviderInfo; constructor(options?: OpenAICompatibleEmbeddingOptions); /** Embeds a batch of texts. */ embed(request: EmbeddingProviderRequest, context: EmbeddingProviderCallContext): Promise; } /** Google Generative Language `batchEmbedContents`. */ export declare class GoogleEmbeddingProvider extends HttpEmbeddingProvider { /** Provider name, capabilities, and models. */ readonly info: EmbeddingProviderInfo; constructor(options?: EmbeddingAdapterOptions); protected authHeaders(): Record; /** Embeds a batch of texts. */ embed(request: EmbeddingProviderRequest, context: EmbeddingProviderCallContext): Promise; } /** Cohere v2 `/embed`. */ export declare class CohereEmbeddingProvider extends HttpEmbeddingProvider { /** Provider name, capabilities, and models. */ readonly info: EmbeddingProviderInfo; constructor(options?: EmbeddingAdapterOptions); /** Embeds a batch of texts. */ embed(request: EmbeddingProviderRequest, context: EmbeddingProviderCallContext): Promise; } /** Mistral `/v1/embeddings`, which follows the OpenAI request and response shape. */ export declare class MistralEmbeddingProvider extends OpenAIEmbeddingProvider { constructor(options?: EmbeddingAdapterOptions); } /** Local Ollama `/api/embed`. */ export declare class OllamaEmbeddingProvider extends HttpEmbeddingProvider { /** Provider name, capabilities, and models. */ readonly info: EmbeddingProviderInfo; constructor(options?: EmbeddingAdapterOptions); /** Embeds a batch of texts. */ embed(request: EmbeddingProviderRequest, context: EmbeddingProviderCallContext): Promise; } export {};