import { type BuilderGatewayAuth } from "../server/credential-provider.js"; import { type ServiceProviderId } from "../server/service-providers.js"; export type EmbeddingInputPurpose = "query" | "document"; export interface EmbeddingImageInput { mimeType: "image/png" | "image/jpeg" | "image/webp" | "image/gif"; base64: string; } export interface MultimodalEmbeddingInput { text?: string; images?: EmbeddingImageInput[]; } export interface EmbeddingFamily { id: string; provider: "gemini" | "cohere" | "voyage" | (string & {}); model: string; version: string; dimensions: number; supportedImageMimeTypes?: readonly EmbeddingImageInput["mimeType"][]; embed(inputs: readonly MultimodalEmbeddingInput[], purpose: EmbeddingInputPurpose, options?: { signal?: AbortSignal; }): Promise; } export declare function createGeminiEmbeddingFamily(apiKey: string, dimensions?: number): EmbeddingFamily; export declare function createCohereEmbeddingFamily(apiKey: string, dimensions?: number): EmbeddingFamily; export declare function createVoyageEmbeddingFamily(apiKey: string): EmbeddingFamily; export declare function createBuilderEmbeddingFamily(auth: BuilderGatewayAuth): EmbeddingFamily; export interface EmbeddingFamilyAvailability { families: EmbeddingFamily[]; /** * Providers whose credentials could not be read. `service-providers` means * the organization's Embeddings choice could not be read, so no family can * be picked safely. */ unavailableProviders: string[]; /** The organization's Embeddings choice, or null when unset or outside an organization. */ preferredProvider: ServiceProviderId<"embeddings"> | null; } export declare function readEmbeddingFamilyAvailability(): Promise; export declare function availableEmbeddingFamilies(): Promise; /** * The family to index and search with. The organization's choice wins, and a * choice whose provider isn't available returns null rather than another * family: vectors from a different provider don't match its index. Without a * choice, a single family is used as is, and several are picked in the order * Builder.io, Gemini, Cohere, Voyage. Families from other providers are never * picked among, only used when they are the only one. */ export declare function defaultEmbeddingFamily(families: readonly EmbeddingFamily[], preferredProvider?: string | null): EmbeddingFamily | null; /** * {@link defaultEmbeddingFamily} for the current request's credentials and * organization. Throws when a credential or the organization's choice could * not be read, like {@link availableEmbeddingFamilies}. */ export declare function resolveDefaultEmbeddingFamily(): Promise;