Spaces:
Sleeping
Sleeping
from langchain.llms import GooglePalm | |
from dotenv import dotenv_values,load_dotenv | |
load_dotenv() | |
secrets = dotenv_values('.env') | |
import streamlit as st | |
import os | |
def get_palm_response(question): | |
llm = GooglePalm(google_api_key=secrets['Google_API_Key'], temperature=0.5) | |
response = llm(question) | |
return response | |
st.set_page_config(page_title="Q&A Demo") | |
st.header("Langchain Application") | |
input = st.text_input("Input: ", key="input") | |
response = get_palm_response(input) | |
submit = st.button("Ask the question") | |
if submit: | |
st.subheader("The Respone is") | |
st.write(response) |