From 4cee9f02934a22cf97dd449138eb4b98d3abc212 Mon Sep 17 00:00:00 2001 From: "ajaysi (aider)" Date: Sun, 6 Oct 2024 12:26:31 +0530 Subject: [PATCH] chore: Load environment variables on startup and set them after saving --- lib/utils/api_key_manager.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/utils/api_key_manager.py b/lib/utils/api_key_manager.py index 43b0fa54..ce5b733e 100644 --- a/lib/utils/api_key_manager.py +++ b/lib/utils/api_key_manager.py @@ -1,5 +1,6 @@ import os import streamlit as st +from dotenv import load_dotenv @st.cache_data def check_api_keys(): @@ -7,6 +8,7 @@ def check_api_keys(): Checks if the required API keys are present in the environment variables. Prompts the user to enter missing keys and saves them in the .env file. """ + load_dotenv() api_keys = { "METAPHOR_API_KEY": "https://dashboard.exa.ai/login", "TAVILY_API_KEY": "https://tavily.com/#api",