diff --git a/libs/core/langchain_core/indexing/__init__.py b/libs/core/langchain_core/indexing/__init__.py index 5a9b3102e81..ff8c1fda669 100644 --- a/libs/core/langchain_core/indexing/__init__.py +++ b/libs/core/langchain_core/indexing/__init__.py @@ -15,8 +15,8 @@ from langchain_core.indexing.base import ( __all__ = [ "aindex", - "index", "BaseIndex", + "index", "IndexingResult", "InMemoryRecordManager", "RecordManager", diff --git a/libs/core/langchain_core/indexing/base.py b/libs/core/langchain_core/indexing/base.py index 00102a41710..24b0d6c133c 100644 --- a/libs/core/langchain_core/indexing/base.py +++ b/libs/core/langchain_core/indexing/base.py @@ -7,18 +7,18 @@ from typing import ( Any, AsyncIterable, AsyncIterator, + Dict, Generic, Iterable, Iterator, List, + Literal, NotRequired, + Optional, Sequence, TypedDict, TypeVar, - Optional, Union, - Dict, - Literal, ) from langchain_core._api import beta @@ -110,7 +110,7 @@ class DeleteResponse(TypedDict, total=False): """ -class BaseIndex(Generic[T, Q]): +class BaseIndex(Generic[T]): """A collection of items that can be queried. This indexing interface is designed to be a generic abstraction for storing and diff --git a/libs/core/langchain_core/vectorstores/base.py b/libs/core/langchain_core/vectorstores/base.py index fa1ec683f51..2258af6503f 100644 --- a/libs/core/langchain_core/vectorstores/base.py +++ b/libs/core/langchain_core/vectorstores/base.py @@ -57,7 +57,7 @@ if TYPE_CHECKING: from langchain_core.indexing.base import UpsertResponse from langchain_core.documents.base import Document -from langchain_core.indexing.base_index import BaseIndex +from langchain_core.indexing import BaseIndex logger = logging.getLogger(__name__) diff --git a/libs/core/tests/unit_tests/indexing/test_public_api.py b/libs/core/tests/unit_tests/indexing/test_public_api.py index 0259017a954..a3253e6544d 100644 --- a/libs/core/tests/unit_tests/indexing/test_public_api.py +++ b/libs/core/tests/unit_tests/indexing/test_public_api.py @@ -4,11 +4,12 @@ from langchain_core.indexing import __all__ def test_all() -> None: """Use to catch obvious breaking changes.""" assert __all__ == sorted(__all__, key=str.lower) - assert __all__ == [ + assert set(__all__) == { "aindex", + "BaseIndex", "index", "IndexingResult", "InMemoryRecordManager", "RecordManager", "UpsertResponse", - ] + }