tasks-retrieval package

Classes

Class Description
DefaultTextChunker A default text chunking implementation using native C++ Wasm methods.
FilesetResolver Resolves the files required for the MediaPipe Task APIs. The returned filesets require that the Wasm files are published without renaming. If this is not possible, you can invoke the MediaPipe Tasks APIs using a manually created WasmFileset.
MemoryVectorStore Lightweight, in-memory implementation of VectorStore in TypeScript.
SemanticRetriever SemanticRetriever coordinates document chunking, multimodal embedding, and high-dimensional vector search.
SemanticRetrieverComponents Components used to initialize the SemanticRetriever.
UniversalEmbedder UniversalEmbedder performs multimodal embedding extraction directly using LiteRT LM.

Interfaces

Interface Description
AudioPart An audio part in a multimodal content block.
Embedding List of embeddings with an optional timestamp. One and only one of the two 'floatEmbedding' and 'quantizedEmbedding' will contain data, based on whether or not the embedder was configured to perform scalar quantization.
EmbeddingProvider Package-neutral interface for generating embeddings across modalities.
ImagePart An image part in a multimodal content block.
RetrievalOptions Options for configuring retrieval queries in SemanticRetriever.
RetrievalRecord Represents a single multi-modal record stored in the vector store.
RetrievalResult Represents a retrieved document or multimedia chunk.
TextChunker Interface for chunking long text into smaller segments.
TextPart A text part in a multimodal content block.
UniversalEmbedderBaseOptions Options for configuring the model asset and hardware accelerator.
UniversalEmbedderOptions Options to configure the MediaPipe Universal Embedder Task.
UniversalEmbedderResult Result returned by the Universal Embedder task.
UniversalEmbedderWasmModule Declarations for the native UniversalEmbedder WebAssembly module. Using declare interface instructs Tsickle to generate Closure Compiler externs, preventing properties from being renamed by ADVANCED_OPTIMIZATIONS.
VectorStore Interface for vector storage and similarity search backends.
WasmFileset An object containing the locations of the Wasm assets
WasmModule Declarations for Emscripten's WebAssembly Module behavior, so TS compiler doesn't break our various JS/C++ bridges. For internal usage.

Type Aliases

Type Alias Description
ActivationDataType Activation data type for model execution.
ChunkingMode Chunking mode for document chunking.
ContentPart A single multimodal content part.
EmptyPacketListener A listener that receives the current MediaPipe packet timestamp. This is invoked even for empty packet.
ErrorListener A listener that will be invoked with an absl::StatusCode and message.
SimpleListener A listener that receives the contents of a non-empty MediaPipe packet and its timestamp.
VectorListener A listener that receives a single element of vector-returning output packet. Receives one element at a time (in order). Once all elements are processed, the listener is invoked with data set to unknown and done set to true. Intended for internal usage.

ActivationDataType

Activation data type for model execution.

Signature:

export declare type ActivationDataType = "FLOAT32" | "FLOAT16" | "INT16" | "INT8";

ChunkingMode

Chunking mode for document chunking.

Signature:

export declare type ChunkingMode = "CHARACTER" | "WORD";

ContentPart

A single multimodal content part.

Signature:

export declare type ContentPart = TextPart | ImagePart | AudioPart;

EmptyPacketListener

A listener that receives the current MediaPipe packet timestamp. This is invoked even for empty packet.

Signature:

declare type EmptyPacketListener = (timestamp: number) => void;

ErrorListener

A listener that will be invoked with an absl::StatusCode and message.

Signature:

declare type ErrorListener = (code: number, message: string) => void;

SimpleListener

A listener that receives the contents of a non-empty MediaPipe packet and its timestamp.

Signature:

declare type SimpleListener<T> = (data: T, timestamp: number) => void;

VectorListener

A listener that receives a single element of vector-returning output packet. Receives one element at a time (in order). Once all elements are processed, the listener is invoked with data set to unknown and done set to true. Intended for internal usage.

Signature:

declare type VectorListener<T> = (data: T, done: boolean, timestamp: number) => void;