Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.cyborg.co/llms.txt

Use this file to discover all available pages before exploring further.

Generates embeddings for the given texts using the configured embedding model.
Available in Embedded and Python SDK. The JS/TS SDK handles embedding generation internally.
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

  • Throws if no embedding model is available
  • Throws if embedding model type is not supported

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)