From 581bcfbb88ca6b19db7f52b88e2a656b66958477 Mon Sep 17 00:00:00 2001 From: Martin Schorfmann <11707410+schorfma@users.noreply.github.com> Date: Wed, 12 Mar 2025 17:30:01 +0100 Subject: [PATCH] docs: fix docstring of EmbeddingFunction (#2118) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hello LanceDB team, --- I have fixed a discrepancy in the class docstring of `lancedb.embeddings.base:EmbeddingFunction` and made consistency alignments to that docstring. ### Changes made 1. The docstring referred to the abstract method `get_source_embeddings()`. This method does not exist in the repository at the current state. I have changed the mention to refer to the actual abstract method `compute_source_embeddings()`. 2. Also, I aligned the consistency within the ordered list which is describing the methods to be implemented by concrete embedding functions. --- Thank you for developing this useful library. 👍 Best regards Martin --- python/python/lancedb/embeddings/base.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/python/python/lancedb/embeddings/base.py b/python/python/lancedb/embeddings/base.py index dc78e27a..f711e5b7 100644 --- a/python/python/lancedb/embeddings/base.py +++ b/python/python/lancedb/embeddings/base.py @@ -17,12 +17,13 @@ class EmbeddingFunction(BaseModel, ABC): """ An ABC for embedding functions. - All concrete embedding functions must implement the following: + All concrete embedding functions must implement the following methods: 1. compute_query_embeddings() which takes a query and returns a list of embeddings - 2. get_source_embeddings() which returns a list of embeddings for the source column + 2. compute_source_embeddings() which returns a list of embeddings for + the source column For text data, the two will be the same. For multi-modal data, the source column might be images and the vector column might be text. - 3. ndims method which returns the number of dimensions of the vector column + 3. ndims() which returns the number of dimensions of the vector column """ __slots__ = ("__weakref__",) # pydantic 1.x compatibility