Skip to content
Discussion options

You must be logged in to vote

I had the same question. The Langchain documentation could be a lot better in this regard, but here is how I would check (adapted from how the framework does it):

import inspect
import langchain


# Modified based on code here: https://github.com/langchain-ai/langchain/blob/master/libs/langchain/langchain/indexes/_api.py#L227-L239
def check_compatibility(vector_store):
    methods = ["delete", "add_documents"]
    for method in methods:
        if not hasattr(vector_store, method):
            return False
    # Checking if the vectorstore has overridden the default delete method
    # implementation which just raises a NotImplementedError
    if getattr(vector_store, 'delete') == langcha…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@srinisubramanian
Comment options

Answer selected by srinisubramanian
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants