Skip to content

Commit ebabf7e

Browse files
committed
CrateDB: Vector Store -- rename to CrateDBVectorStore
1 parent 6b6ad4e commit ebabf7e

File tree

7 files changed

+55
-55
lines changed

7 files changed

+55
-55
lines changed

libs/community/langchain_community/vectorstores/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
CouchbaseVectorStore,
9494
)
9595
from langchain_community.vectorstores.cratedb import (
96-
CrateDBVectorSearch,
96+
CrateDBVectorStore,
9797
)
9898
from langchain_community.vectorstores.dashvector import (
9999
DashVector,
@@ -337,7 +337,7 @@
337337
"Clickhouse",
338338
"ClickhouseSettings",
339339
"CouchbaseVectorStore",
340-
"CrateDBVectorSearch",
340+
"CrateDBVectorStore",
341341
"DashVector",
342342
"DatabricksVectorSearch",
343343
"DeepLake",
@@ -442,7 +442,7 @@
442442
"Clickhouse": "langchain_community.vectorstores.clickhouse",
443443
"ClickhouseSettings": "langchain_community.vectorstores.clickhouse",
444444
"CouchbaseVectorStore": "langchain_community.vectorstores.couchbase",
445-
"CrateDBVectorSearch": "langchain_community.vectorstores.cratedb",
445+
"CrateDBVectorStore": "langchain_community.vectorstores.cratedb",
446446
"DashVector": "langchain_community.vectorstores.dashvector",
447447
"DatabricksVectorSearch": "langchain_community.vectorstores.databricks_vector_search", # noqa: E501
448448
"DeepLake": "langchain_community.vectorstores.deeplake",
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
from .base import CrateDBVectorSearch
2-
from .extended import CrateDBVectorSearchMultiCollection
1+
from .base import CrateDBVectorStore
2+
from .extended import CrateDBVectorStoreMultiCollection
33

44
__all__ = [
5-
"CrateDBVectorSearch",
6-
"CrateDBVectorSearchMultiCollection",
5+
"CrateDBVectorStore",
6+
"CrateDBVectorStoreMultiCollection",
77
]

libs/community/langchain_community/vectorstores/cratedb/base.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def _results_to_docs(docs_and_scores: Any) -> List[Document]:
4242
return [doc for doc, _ in docs_and_scores]
4343

4444

45-
class CrateDBVectorSearch(PGVector):
45+
class CrateDBVectorStore(PGVector):
4646
"""`CrateDB` vector store.
4747
4848
To use it, you should have the ``crate[sqlalchemy]`` python package installed.
@@ -62,13 +62,13 @@ class CrateDBVectorSearch(PGVector):
6262
Example:
6363
.. code-block:: python
6464
65-
from langchain.vectorstores import CrateDBVectorSearch
65+
from langchain.vectorstores import CrateDBVectorStore
6666
from langchain.embeddings.openai import OpenAIEmbeddings
6767
6868
CONNECTION_STRING = "crate://crate@localhost:4200/test3"
6969
COLLECTION_NAME = "state_of_the_union_test"
7070
embeddings = OpenAIEmbeddings()
71-
vectorestore = CrateDBVectorSearch.from_documents(
71+
vectorestore = CrateDBVectorStore.from_documents(
7272
embedding=embeddings,
7373
documents=docs,
7474
collection_name=COLLECTION_NAME,
@@ -337,7 +337,7 @@ def _query_collection_multi(
337337

338338
@classmethod
339339
def from_texts( # type: ignore[override]
340-
cls: Type[CrateDBVectorSearch],
340+
cls: Type[CrateDBVectorStore],
341341
texts: List[str],
342342
embedding: Embeddings,
343343
metadatas: Optional[List[dict]] = None,
@@ -346,7 +346,7 @@ def from_texts( # type: ignore[override]
346346
ids: Optional[List[str]] = None,
347347
pre_delete_collection: bool = False,
348348
**kwargs: Any,
349-
) -> CrateDBVectorSearch:
349+
) -> CrateDBVectorStore:
350350
"""
351351
Return VectorStore initialized from texts and embeddings.
352352
Database connection string is required.
@@ -431,7 +431,7 @@ def _select_relevance_score_fn(self) -> Callable[[float], float]:
431431
raise ValueError(
432432
"No supported normalization function for distance_strategy of "
433433
f"{self._distance_strategy}. Consider providing relevance_score_fn to "
434-
"CrateDBVectorSearch constructor."
434+
"CrateDBVectorStore constructor."
435435
)
436436

437437
@staticmethod

libs/community/langchain_community/vectorstores/cratedb/extended.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212

1313
from langchain_community.vectorstores.cratedb.base import (
1414
DEFAULT_DISTANCE_STRATEGY,
15-
CrateDBVectorSearch,
15+
CrateDBVectorStore,
1616
DistanceStrategy,
1717
)
1818
from langchain_community.vectorstores.pgvector import _LANGCHAIN_DEFAULT_COLLECTION_NAME
1919

2020

21-
class CrateDBVectorSearchMultiCollection(CrateDBVectorSearch):
21+
class CrateDBVectorStoreMultiCollection(CrateDBVectorStore):
2222
"""
2323
Provide functionality for searching multiple collections.
2424
It can not be used for indexing documents.
@@ -27,15 +27,15 @@ class CrateDBVectorSearchMultiCollection(CrateDBVectorSearch):
2727
2828
Synopsis::
2929
30-
from langchain.vectorstores.cratedb import CrateDBVectorSearchMultiCollection
30+
from langchain_community.vectorstores.cratedb import CrateDBVectorStoreMultiCollection
3131
32-
multisearch = CrateDBVectorSearchMultiCollection(
32+
multisearch = CrateDBVectorStoreMultiCollection(
3333
collection_names=["collection_foo", "collection_bar"],
3434
embedding_function=embeddings,
3535
connection_string=CONNECTION_STRING,
3636
)
3737
docs_with_score = multisearch.similarity_search_with_score(query)
38-
"""
38+
""" # noqa: E501
3939

4040
def __init__(
4141
self,

0 commit comments

Comments
 (0)