From 5472105dd33ff0663a6f539f6a142b0c3a43e4ad Mon Sep 17 00:00:00 2001 From: Anil-matcha Date: Mon, 29 May 2023 20:49:08 +0530 Subject: [PATCH] Streamlit fixes --- streamlitui.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/streamlitui.py b/streamlitui.py index a3be377..e5f2024 100644 --- a/streamlitui.py +++ b/streamlitui.py @@ -31,13 +31,14 @@ def is_openai_api_key_set() -> bool: def main(): if len(st.session_state) == 0: st.session_state["messages"] = [] + st.session_state["url"] = "" st.session_state["OPENAI_API_KEY"] = os.environ.get("OPENAI_API_KEY", "") if is_openai_api_key_set(): st.session_state["webquery"] = WebQuery(st.session_state["OPENAI_API_KEY"]) else: st.session_state["webquery"] = None - st.header("ChatPDF") + st.header("Website to Chatbot") if st.text_input("OpenAI API Key", value=st.session_state["OPENAI_API_KEY"], key="input_OPENAI_API_KEY", type="password"): if ( @@ -50,10 +51,10 @@ def main(): st.session_state["webquery"] = WebQuery(st.session_state["OPENAI_API_KEY"]) st.subheader("Add a url") - if st.text_input("Input url", value=st.session_state["url"], key="input_url", type="text"): + if st.text_input("Input url", value=st.session_state["url"], key="input_url", type="default"): if ( len(st.session_state["input_url"]) > 0 - and st.session_state["input_url"] != st.session_state["text"] + and st.session_state["input_url"] != st.session_state["url"] ): st.session_state["url"] = st.session_state["input_url"]