Generates a numerical embedding (vector) for a given text string.
The input text for which to generate an embedding.
A promise that resolves to an array of numbers representing the embedding vector.
Loads the embedding model and its necessary resources (e.g., weights, tokenizer) into memory. This method should be called before attempting to generate any embeddings.
A promise that resolves to the instance of the Embeddings class once loaded.
Unloads the embedding model and its associated resources from memory. This is typically used to free up system resources when the model is no longer needed.
A promise that resolves once the model unloading is complete.
Defines the essential operations for an embedding model. An embedding model converts text into high-dimensional numerical vectors (embeddings), capturing semantic meaning. These embeddings are crucial for tasks like similarity search, clustering, and other NLP applications. This interface covers model lifecycle (loading, unloading) and the core embedding generation capability.