cia / app.py
Rubén David Below
Update app.py
eb1e4b5
Raw History Blame Contribute Delete
607 Bytes
import streamlit as st
from langchain.llms import OpenAI
st.title("Conversational Information Access (CIA)")
with st.sidebar:
openai_api_key = st.secrets["OPEN_API_KEY"]
def generate_response(input_text):
llm = OpenAI(temperature=0.7, openai_api_key=openai_api_key)
st.info(llm(input_text))
with st.form("my_form"):
text = st.text_area("Enter text:", "What are the latest updates from my team?")
submitted = st.form_submit_button("Submit")
if not openai_api_key:
st.info("Please add your OpenAI API key to continue.")
elif submitted:
generate_response(text)