MCPcopy
hub / github.com/alejandro-ao/ask-multiple-pdfs / get_conversation_chain

Function get_conversation_chain

app.py:40–51  ·  view source on GitHub ↗
(vectorstore)

Source from the content-addressed store, hash-verified

38
39
40def get_conversation_chain(vectorstore):
41 llm = ChatOpenAI()
42 # llm = HuggingFaceHub(repo_id="google/flan-t5-xxl", model_kwargs={"temperature":0.5, "max_length":512})
43
44 memory = ConversationBufferMemory(
45 memory_key='chat_history', return_messages=True)
46 conversation_chain = ConversationalRetrievalChain.from_llm(
47 llm=llm,
48 retriever=vectorstore.as_retriever(),
49 memory=memory
50 )
51 return conversation_chain
52
53
54def handle_userinput(user_question):

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected