From 24eb244ffb37324f9c35dec455e2f9336c50e938 Mon Sep 17 00:00:00 2001 From: Shkarupa Alex Date: Wed, 16 Apr 2025 10:44:19 +0300 Subject: [PATCH] Fix async indexing issue `aindex` function should check not only `adelete` method, but `delete` method too --- libs/core/langchain_core/indexing/api.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/core/langchain_core/indexing/api.py b/libs/core/langchain_core/indexing/api.py index 084fe9b8907..60d4ed134c0 100644 --- a/libs/core/langchain_core/indexing/api.py +++ b/libs/core/langchain_core/indexing/api.py @@ -647,10 +647,10 @@ async def aindex( ) raise ValueError(msg) - if type(destination).adelete == VectorStore.adelete: - # Checking if the vectorstore has overridden the default delete method + if type(destination).adelete == VectorStore.adelete and type(destination).delete == VectorStore.delete: + # Checking if the vectorstore has overridden the default adelete or delete methods # implementation which just raises a NotImplementedError - msg = "Vectorstore has not implemented the delete method" + msg = "Vectorstore has not implemented the adelete or delete method" raise ValueError(msg) elif isinstance(destination, DocumentIndex): pass