Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for recent breaking changes #73

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

gadkins
Copy link

@gadkins gadkins commented May 3, 2023

This PR fixes two breaking changes recently introduced in hwchase17/langchain:

  1. ConversationalRetrievalChain replacing ChatVectorDBChain per this blog
  2. AsyncCallbackManager moved to langchain.callbacks.manager after this refactor

Use ConversationalRetrievalChain instead of ChatVectorDBChain; 
Update AsyncCallbackManager after refactor
@gadkins gadkins changed the title Update query_data.py Fix for recent breaking changes May 3, 2023
Link to ConversationRetrievalChain example docs
Better link
@lefant
Copy link

lefant commented May 10, 2023

@gadkins just tried your fix. I think you also need the change from this branch of yours:
master...gadkins:chat-langchain:upgade-to-converstaionalretrievalchain

if I include that change on top of this branch it seems to work, thanks for figuring it out!

@jpzhangvincent
Copy link

It would be good to have this PR merged due to the package upgrade. Thanks! @hwchase17

qa = ChatVectorDBChain(
vectorstore=vectorstore,
qa = ConversationalRetrievalChain(
vectorstore=vectorstore.as_retriever(),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also needs to update to the parameter from vectorstore to retriever:

    qa = ConversationalRetrievalChain(
        retriever=vectorstore.as_retriever(),
        combine_docs_chain=doc_chain,
        question_generator=question_generator,
        callback_manager=manager,
        return_source_documents=True,
    )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants