From 6c426b40ce92f3e9a25054fe4e30e7ffa837d1ce Mon Sep 17 00:00:00 2001 From: Jerome Hardaway Date: Sat, 2 Nov 2024 00:26:50 -0400 Subject: [PATCH] make the code more focused on streamlit code --- streamlit_app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/streamlit_app.py b/streamlit_app.py index 10cef83..ad69f34 100644 --- a/streamlit_app.py +++ b/streamlit_app.py @@ -162,9 +162,9 @@ load_dotenv() # Configure OpenAI -openai.api_key = os.getenv("OPENAI_API_KEY") +openai.api_key = st.secrets["OPENAI_API_KEY"] if not openai.api_key: - raise ValueError("OpenAI API key not found in .env file") + raise ValueError("OpenAI API key not found in Streamlit secrets") def parse_mos_file(file_content: str) -> dict: """