Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +9 -20
src/streamlit_app.py
CHANGED
|
@@ -4,29 +4,18 @@ from supabase.client import create_client
|
|
| 4 |
from langchain_google_genai import GoogleGenerativeAIEmbeddings, ChatGoogleGenerativeAI
|
| 5 |
from streamlit_mic_recorder import speech_to_text
|
| 6 |
|
| 7 |
-
#
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
if value:
|
| 12 |
-
return value
|
| 13 |
-
# 2. Try Streamlit Secrets (Hugging Face / Streamlit fallback)
|
| 14 |
-
try:
|
| 15 |
-
return st.secrets[key]
|
| 16 |
-
except Exception:
|
| 17 |
-
return None
|
| 18 |
|
| 19 |
# --- 1. SETTINGS & KEYS ---
|
| 20 |
-
# --- 1. CONFIG FROM HUGGING FACE SECRETS ---
|
| 21 |
-
SUPABASE_URL = st.secrets["SUPABASE_URL"]
|
| 22 |
-
SUPABASE_KEY = st.secrets["SUPABASE_KEY"]
|
| 23 |
-
GEMINI_KEY = st.secrets["GEMINI_KEY"]
|
| 24 |
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
st.
|
| 30 |
st.stop()
|
| 31 |
|
| 32 |
# --- 2. INITIALIZE CLIENTS ---
|
|
|
|
| 4 |
from langchain_google_genai import GoogleGenerativeAIEmbeddings, ChatGoogleGenerativeAI
|
| 5 |
from streamlit_mic_recorder import speech_to_text
|
| 6 |
|
| 7 |
+
# --- DIRECT ENVIRONMENT ACCESS (Bypasses st.secrets bug) ---
|
| 8 |
+
SUPABASE_URL = os.getenv("SUPABASE_URL")
|
| 9 |
+
SUPABASE_KEY = os.getenv("SUPABASE_KEY")
|
| 10 |
+
GEMINI_KEY = os.getenv("GEMINI_KEY")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
# --- 1. SETTINGS & KEYS ---
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
+
# --- DEBUGGING UI (Temporary - helps us see what's wrong) ---
|
| 15 |
+
if not SUPABASE_URL:
|
| 16 |
+
st.error("❌ SUPABASE_URL is missing from Environment Variables.")
|
| 17 |
+
# Lists all variables to see if they are named differently (Safe for debugging)
|
| 18 |
+
# st.write("Available keys:", list(os.environ.keys()))
|
| 19 |
st.stop()
|
| 20 |
|
| 21 |
# --- 2. INITIALIZE CLIENTS ---
|