ractogateway.rag.embedders.base

Abstract base class for embedding providers.

class ractogateway.rag.embedders.base.BaseEmbedder[source]

Bases: ABC

Embed a list of texts into dense float vectors.

All embedders implement both sync embed() and async aembed() variants. The dimension of returned vectors is declared via the dimension property (-1 if unknown until the first call).

property dimension: int

Dimensionality of the embedding vectors.

Returns -1 if not known until after the first call.

abstractmethod embed(texts)[source]

Embed texts synchronously.

Parameters:

texts (list[str]) – Non-empty list of strings to embed.

Return type:

list[list[float]]

Returns:

list[list[float]] – One embedding vector per input text, in the same order.

abstractmethod async aembed(texts)[source]

Async variant of embed().

Return type:

list[list[float]]