From 425f6ffa5b3e602035abea84d4b887e1ff92f2a7 Mon Sep 17 00:00:00 2001 From: Eugene Yurtsev Date: Thu, 8 Aug 2024 12:08:18 -0400 Subject: [PATCH] core[patch]: Fix aindex API (#25155) A previous PR accidentally broke the aindex API by renaming a positional argument vectorstore into vector_store. This PR reverts this change. --- libs/core/langchain_core/indexing/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/core/langchain_core/indexing/api.py b/libs/core/langchain_core/indexing/api.py index add0793062..d682f345b6 100644 --- a/libs/core/langchain_core/indexing/api.py +++ b/libs/core/langchain_core/indexing/api.py @@ -435,7 +435,7 @@ async def _to_async_iterator(iterator: Iterable[T]) -> AsyncIterator[T]: async def aindex( docs_source: Union[BaseLoader, Iterable[Document], AsyncIterator[Document]], record_manager: RecordManager, - vectorstore: Union[VectorStore, DocumentIndex], + vector_store: Union[VectorStore, DocumentIndex], *, batch_size: int = 100, cleanup: Literal["incremental", "full", None] = None, @@ -506,7 +506,7 @@ async def aindex( if cleanup == "incremental" and source_id_key is None: raise ValueError("Source id key is required when cleanup mode is incremental.") - destination = vectorstore # Renaming internally for clarity + destination = vector_store # Renaming internally for clarity # If it's a vectorstore, let's check if it has the required methods. if isinstance(destination, VectorStore):