core: default implementation for embed_documents

This commit is contained in:
Erick Friis
2024-12-05 17:17:02 -08:00
parent 18386c16c7
commit 4671ad8227

View File

@@ -33,7 +33,6 @@ class Embeddings(ABC):
an async native implementation for performance reasons. an async native implementation for performance reasons.
""" """
@abstractmethod
def embed_documents(self, texts: list[str]) -> list[list[float]]: def embed_documents(self, texts: list[str]) -> list[list[float]]:
"""Embed search docs. """Embed search docs.
@@ -43,6 +42,7 @@ class Embeddings(ABC):
Returns: Returns:
List of embeddings. List of embeddings.
""" """
return [self.embed_query(text) for text in texts]
@abstractmethod @abstractmethod
def embed_query(self, text: str) -> list[float]: def embed_query(self, text: str) -> list[float]: