MCPcopy Create free account
hub / github.com/Mrinank-Bhowmick/python-beginner-projects / QA

Function QA

projects/PDF_Reader/PDF_Reader.py:50–58  ·  view source on GitHub ↗
(query)

Source from the content-addressed store, hash-verified

48
49
50def QA(query):
51 qa = ConversationalRetrievalChain.from_llm(
52 OpenAI(temperature=0), vectorstore.as_retriever(), memory=memory
53 )
54 query = "What is prompt engineering?"
55 result = qa({"question": query})
56 result = str(result["chat_history"][1])
57 result = result.split("content='")[1]
58 return result
59
60
61print("INSTRUCTIONS:")

Callers 1

PDF_Reader.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected