Generates embeddings for the given texts using the configured embedding model.
get_embeddings(texts: Union[str, List[str]]) -> np.ndarray

Parameters

ParameterTypeDescription
textsUnion[str, List[str]]Single text string or list of text strings to embed

Returns

np.ndarray: NumPy array of embeddings
  • If single text: 1-D array of shape (dimension,)
  • If list of texts: 2-D array of shape (num_texts, dimension)

Exceptions

Example Usage

# Single text embedding
embedding = store.get_embeddings("Hello, world!")
print(f"Embedding shape: {embedding.shape}")  # (384,)

# Multiple text embeddings
texts = ["First document", "Second document", "Third document"]
embeddings = store.get_embeddings(texts)
print(f"Embeddings shape: {embeddings.shape}")  # (3, 384)