alejandro-ao / ask-multiple-pdfs

A Langchain app that allows you to chat with multiple PDFs
1.59k stars 908 forks source link

Update for langchain 0.1.0? #50

Open stockcrack opened 5 months ago

stockcrack commented 5 months ago

Hi,

I think there are a couple updates to be made for langchain 0.1.0 if you want to keep this current.

from langchain_community.vectorstores import FAISS
from langchain_openai import ChatOpenAI, OpenAIEmbeddings

and

def get_conversation_chain(vectorstore):
    """Get conversation chain from vector store"""
    llm = ChatOpenAI()
    memory = ConversationBufferMemory(memory_key="chat_history", return_messages=True)
    conversation_chain = ConversationalRetrievalChain.from_llm(
        llm=llm, memory=memory, retriever=vectorstore.as_retriever()
    )
    return conversation_chain
sameersk2k commented 3 months ago

from where to import ConversationalRetrievalChain . I tried langchain.chains its not working