import type { EmbeddingInput, EmbeddingModality, EmbeddingModelCapabilities, EmbeddingProviderPart } from '../types/embeddings.js'; /** A media kind an embedding input can hold. */ export type EmbeddingMediaKind = Exclude; /** A request's inputs, checked and ready for routing, the cache, and the provider. */ export interface EmbeddingInputs { /** Each input's text: a string itself, or its text parts joined by a newline. */ texts: string[]; /** Each input as the parts an adapter receives, when any input holds media. */ parts?: EmbeddingProviderPart[][]; /** The media kinds the inputs hold. */ media: Set; /** What media each input holds, for pricing and for a model's limits. */ units: MediaUnits[]; } /** * What an input's media comes to: its images, each audio part's and each video part's length in * seconds, read from its own headers, and the audio and video parts whose length could not be read. */ export interface MediaUnits { images: number; audio: number[]; video: number[]; unmeasured: number; } /** Checks a request's input and resolves every media part to base64 data or a URL. */ export declare function normalizeInputs(input: EmbeddingInput): EmbeddingInputs; /** Every input's media together. */ export declare function totalUnits(units: readonly MediaUnits[]): MediaUnits; /** How many frames a model takes from a video of this length, by its `videoFrames`. */ export declare function framesOf(seconds: number, model: EmbeddingModelCapabilities): number; /** * What a model charges for media, in US dollars: each image, each second of audio, counted up, and * each frame it takes from a video. A model with no media prices charges nothing for it. */ export declare function mediaCost(units: MediaUnits, model: EmbeddingModelCapabilities | undefined): number; /** Whether a model prices a medium by its length, so a part whose length is unknown is unpriced. */ export declare function pricesByLength(model: EmbeddingModelCapabilities | undefined): boolean; /** Refuses audio or video longer than a model takes, naming the input, before anything is sent. */ export declare function assertLengths(inputs: EmbeddingInputs, modelName: string, model: EmbeddingModelCapabilities | undefined): void; /** * Each input's identity, which repeats and the cache are keyed by: a text itself, or its parts with * every medium's content hashed, so a megabyte image is never a key. Loaded only for media. */ export declare function inputIdentities(inputs: EmbeddingInputs): Promise; /** * The media kinds a model takes, by its registry entry when it has one, else by its adapter. Text * only when neither says. */ export declare function acceptedModalities(model: { inputModalities?: readonly EmbeddingModality[]; } | undefined, provider: { inputModalities?: readonly EmbeddingModality[]; }): readonly EmbeddingModality[];