/// import fs from "fs"; export declare enum ExecutionProvider { CPU = "cpu", CUDA = "cuda", WebGL = "webgl", WASM = "wasm", XNNPACK = "xnnpack" } export declare enum EmbeddingModel { AllMiniLML6V2 = "fast-all-MiniLM-L6-v2", BGEBaseEN = "fast-bge-base-en", BGEBaseENV15 = "fast-bge-base-en-v1.5", BGESmallEN = "fast-bge-small-en", BGESmallENV15 = "fast-bge-small-en-v1.5", BGESmallZH = "fast-bge-small-zh-v1.5", MLE5Large = "fast-multilingual-e5-large", CUSTOM = "custom" } export declare enum SparseEmbeddingModel { SpladePPEnV1 = "prithivida/Splade_PP_en_v1", CUSTOM = "custom" } export type SparseVector = { values: number[]; indices: number[]; }; export interface InitOptionsBase { executionProviders?: ExecutionProvider[]; maxLength?: number; cacheDir?: string; showDownloadProgress?: boolean; } interface ModelInfo { model: EmbeddingModel; dim: number; description: string; } interface SparseModelInfo { model: SparseEmbeddingModel; vocabSize: number; description: string; } export interface InitStandardOptions extends InitOptionsBase { model: Exclude; modelAbsoluteDirPath?: undefined; modelName?: string; } export interface InitCustomOptions extends InitOptionsBase { model: EmbeddingModel.CUSTOM; modelAbsoluteDirPath: fs.PathLike; modelName: string; } export type InitOptions = InitStandardOptions | InitCustomOptions; export interface InitSparseStandardOptions extends InitOptionsBase { model: Exclude; modelAbsoluteDirPath?: undefined; modelName?: string; } export interface InitSparseCustomOptions extends InitOptionsBase { model: SparseEmbeddingModel.CUSTOM; modelAbsoluteDirPath: fs.PathLike; modelName: string; } export type InitSparseOptions = InitSparseStandardOptions | InitSparseCustomOptions; declare abstract class Embedding { abstract listSupportedModels(): ModelInfo[]; abstract embed(texts: string[], batchSize?: number): AsyncGenerator; abstract passageEmbed(texts: string[], batchSize: number): AsyncGenerator; abstract queryEmbed(query: string): Promise; } declare abstract class SparseEmbedding { abstract listSupportedModels(): SparseModelInfo[]; abstract embed(texts: string[], batchSize?: number): AsyncGenerator; abstract passageEmbed(texts: string[], batchSize: number): AsyncGenerator; abstract queryEmbed(query: string): Promise; } export declare class FlagEmbedding extends Embedding { private tokenizer; private session; private model; private constructor(); static init(options: InitStandardOptions): Promise; static init(options: InitCustomOptions): Promise; private static loadTokenizer; private static downloadFileFromGCS; private static decompressToCache; private static retrieveModel; embed(textStrings: string[], batchSize?: number): AsyncGenerator; passageEmbed(texts: string[], batchSize?: number): AsyncGenerator; queryEmbed(query: string): Promise; listSupportedModels(): ModelInfo[]; } export declare class SparseTextEmbedding extends SparseEmbedding { private tokenizer; private session; private model; private vocabSize; private constructor(); static init(options: InitSparseStandardOptions): Promise; static init(options: InitSparseCustomOptions): Promise; private static loadTokenizer; private static retrieveModel; embed(textStrings: string[], batchSize?: number): AsyncGenerator; passageEmbed(texts: string[], batchSize?: number): AsyncGenerator; queryEmbed(query: string): Promise; listSupportedModels(): SparseModelInfo[]; } export {}; //# sourceMappingURL=fastembed.d.ts.map