Skip to content

The agent engineering platform.

fix vectorstore imports (#12804)

Harrison Chase6609a6033fed
diff --git a/libs/langchain/langchain/vectorstores/__init__.py b/libs/langchain/langchain/vectorstores/__init__.py
index 5e40a26d2f..cdacbb5773 100644
--- a/libs/langchain/langchain/vectorstores/__init__.py
+++ b/libs/langchain/langchain/vectorstores/__init__.py
@@ -21,6 +21,8 @@ and retrieve the data that are 'most similar' to the embedded query.
from typing import Any
+from langchain.schema.vectorstore import VectorStore
+
def _import_alibaba_cloud_open_search() -> Any:
from langchain.vectorstores.alibabacloud_opensearch import AlibabaCloudOpenSearch
@@ -605,4 +607,5 @@ __all__ = [
"Zilliz",
"TencentVectorDB",
"AzureCosmosDBVectorSearch",
+ "VectorStore",
]
diff --git a/libs/langchain/tests/unit_tests/vectorstores/test_public_api.py b/libs/langchain/tests/unit_tests/vectorstores/test_public_api.py
new file mode 100644
index 0000000000..503b87e035
--- /dev/null
+++ b/libs/langchain/tests/unit_tests/vectorstores/test_public_api.py
@@ -0,0 +1,75 @@
+"""Test the public API of the tools package."""
+from langchain.vectorstores import __all__ as public_api
+
+_EXPECTED = [
+ "AlibabaCloudOpenSearch",
+ "AlibabaCloudOpenSearchSettings",
+ "AnalyticDB",
+ "Annoy",
+ "AtlasDB",
+ "AwaDB",
+ "AzureSearch",
+ "Bagel",
+ "Cassandra",
+ "Chroma",
+ "Clarifai",
+ "Clickhouse",
+ "ClickhouseSettings",
+ "DashVector",
+ "DeepLake",
+ "Dingo",
+ "DocArrayHnswSearch",
+ "DocArrayInMemorySearch",
+ "ElasticKnnSearch",
+ "ElasticVectorSearch",
+ "ElasticsearchStore",
+ "Epsilla",
+ "FAISS",
+ "Hologres",
+ "LanceDB",
+ "LLMRails",
+ "Marqo",
+ "MatchingEngine",
+ "Meilisearch",
+ "Milvus",
+ "MomentoVectorIndex",
+ "MongoDBAtlasVectorSearch",
+ "MyScale",
+ "MyScaleSettings",
+ "Neo4jVector",
+ "OpenSearchVectorSearch",
+ "PGEmbedding",
+ "PGVector",
+ "Pinecone",
+ "Qdrant",
+ "Redis",
+ "Rockset",
+ "SKLearnVectorStore",
+ "ScaNN",
+ "SemaDB",
+ "SingleStoreDB",
+ "SQLiteVSS",
+ "StarRocks",
+ "SupabaseVectorStore",
+ "Tair",
+ "Tigris",
+ "TimescaleVector",
+ "Typesense",
+ "USearch",
+ "Vald",
+ "Vearch",
+ "Vectara",
+ "VespaStore",
+ "Weaviate",
+ "ZepVectorStore",
+ "Zilliz",
+ "TencentVectorDB",
+ "AzureCosmosDBVectorSearch",
+ "VectorStore",
+]
+
+
+def test_public_api() -> None:
+ """Test for regressions or changes in the public API."""
+ # Check that the public API is as expected
+ assert set(public_api) == set(_EXPECTED)