Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,6 +2,14 @@ import streamlit as st
|
|
| 2 |
from google import genai
|
| 3 |
from io import StringIO
|
| 4 |
import prompts # Assuming prompts.py is in the same directory
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
st.set_page_config(page_title="SQL AI Assistant", layout="wide")
|
| 7 |
|
|
|
|
| 2 |
from google import genai
|
| 3 |
from io import StringIO
|
| 4 |
import prompts # Assuming prompts.py is in the same directory
|
| 5 |
+
import os # Add this at the top of your imports
|
| 6 |
+
|
| 7 |
+
# Replace the st.secrets line with this:
|
| 8 |
+
api_key = os.environ.get("GOOGLE_API_KEY")
|
| 9 |
+
|
| 10 |
+
if not api_key:
|
| 11 |
+
st.error("API Key not found. Please ensure GOOGLE_API_KEY is set in Hugging Face Secrets.")
|
| 12 |
+
st.stop()
|
| 13 |
|
| 14 |
st.set_page_config(page_title="SQL AI Assistant", layout="wide")
|
| 15 |
|