Spaces:
Running
Running
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 |