From 32163063dc04cf6a6e2a9a6f88bd87d0f3b4ea22 Mon Sep 17 00:00:00 2001 From: Chang She <759245+changhiskhan@users.noreply.github.com> Date: Tue, 5 Sep 2023 22:29:50 -0700 Subject: [PATCH] Fix up docs (#477) --- docs/src/python/python.md | 8 +++++++- python/lancedb/__init__.py | 6 +++++- python/lancedb/embeddings/__init__.py | 1 + python/lancedb/embeddings/functions.py | 4 ++++ python/lancedb/table.py | 1 + 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/docs/src/python/python.md b/docs/src/python/python.md index c83242b6..f11caa87 100644 --- a/docs/src/python/python.md +++ b/docs/src/python/python.md @@ -28,7 +28,13 @@ pip install lancedb ::: lancedb.embeddings.with_embeddings -::: lancedb.embeddings.EmbeddingFunction +::: lancedb.embeddings.functions.EmbeddingFunctionRegistry + +::: lancedb.embeddings.functions.EmbeddingFunctionModel + +::: lancedb.embeddings.functions.TextEmbeddingFunctionModel + +::: lancedb.embeddings.functions.SentenceTransformerEmbeddingFunction ## Context diff --git a/python/lancedb/__init__.py b/python/lancedb/__init__.py index 5e5cf45d..20ef3a00 100644 --- a/python/lancedb/__init__.py +++ b/python/lancedb/__init__.py @@ -31,9 +31,13 @@ def connect( ---------- uri: str or Path The uri of the database. - api_token: str, optional + api_key: str, optional If presented, connect to LanceDB cloud. Otherwise, connect to a database on file system or cloud storage. + region: str, default "us-west-2" + The region to use for LanceDB Cloud. + host_override: str, optional + The override url for LanceDB Cloud. Examples -------- diff --git a/python/lancedb/embeddings/__init__.py b/python/lancedb/embeddings/__init__.py index ec7bc848..68abdd3e 100644 --- a/python/lancedb/embeddings/__init__.py +++ b/python/lancedb/embeddings/__init__.py @@ -17,5 +17,6 @@ from .functions import ( EmbeddingFunctionModel, EmbeddingFunctionRegistry, SentenceTransformerEmbeddingFunction, + TextEmbeddingFunctionModel, ) from .utils import with_embeddings diff --git a/python/lancedb/embeddings/functions.py b/python/lancedb/embeddings/functions.py index 4ec9f26a..d1ae2cf7 100644 --- a/python/lancedb/embeddings/functions.py +++ b/python/lancedb/embeddings/functions.py @@ -169,6 +169,10 @@ class TextEmbeddingFunctionModel(EmbeddingFunctionModel): @REGISTRY.register() class SentenceTransformerEmbeddingFunction(TextEmbeddingFunctionModel): + """ + An embedding function that uses the sentence-transformers library + """ + name: str = "all-MiniLM-L6-v2" device: str = "cpu" normalize: bool = False diff --git a/python/lancedb/table.py b/python/lancedb/table.py index c01cc224..359985f1 100644 --- a/python/lancedb/table.py +++ b/python/lancedb/table.py @@ -231,6 +231,7 @@ class Table(ABC): self, query: Optional[Union[VEC, str]] = None, vector_column_name: str = VECTOR_COLUMN_NAME, + query_type: str = "auto", ) -> LanceQueryBuilder: """Create a search query to find the nearest neighbors of the given query vector.