File size: 375 Bytes
1bdec92
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
from langchain.chains import RetrievalQA
from Api_Key import google_plam
from langchain.llms import GooglePalm

def Q_A(vectorstore,question):
    google_llm = GooglePalm(google_api_key=google_plam, temperature=0.5)
    qa = RetrievalQA.from_chain_type(llm=google_llm, chain_type="stuff", retriever=vectorstore.as_retriever())
    answer = qa.run(question)

    return answer