mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-18 18:53:10 +00:00
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.
This commit is contained in:
parent
15a36dd0a2
commit
425f6ffa5b
@ -435,7 +435,7 @@ async def _to_async_iterator(iterator: Iterable[T]) -> AsyncIterator[T]:
|
|||||||
async def aindex(
|
async def aindex(
|
||||||
docs_source: Union[BaseLoader, Iterable[Document], AsyncIterator[Document]],
|
docs_source: Union[BaseLoader, Iterable[Document], AsyncIterator[Document]],
|
||||||
record_manager: RecordManager,
|
record_manager: RecordManager,
|
||||||
vectorstore: Union[VectorStore, DocumentIndex],
|
vector_store: Union[VectorStore, DocumentIndex],
|
||||||
*,
|
*,
|
||||||
batch_size: int = 100,
|
batch_size: int = 100,
|
||||||
cleanup: Literal["incremental", "full", None] = None,
|
cleanup: Literal["incremental", "full", None] = None,
|
||||||
@ -506,7 +506,7 @@ async def aindex(
|
|||||||
if cleanup == "incremental" and source_id_key is None:
|
if cleanup == "incremental" and source_id_key is None:
|
||||||
raise ValueError("Source id key is required when cleanup mode is incremental.")
|
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 it's a vectorstore, let's check if it has the required methods.
|
||||||
if isinstance(destination, VectorStore):
|
if isinstance(destination, VectorStore):
|
||||||
|
Loading…
Reference in New Issue
Block a user