Spaces:
Running
Running
from langchain.chains import RetrievalQA | |
#from Api_Key import google_plam | |
from langchain.llms import GooglePalm | |
import os | |
from dotenv import load_dotenv | |
load_dotenv() | |
os.getenv("GOOGLE_API_KEY") | |
google_plam = os.getenv("GOOGLE_API_KEY") | |
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 |