Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,6 +12,15 @@ try:
|
|
| 12 |
except ImportError:
|
| 13 |
Groq = None
|
| 14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
# -----------------------------
|
| 17 |
# Utility Functions
|
|
|
|
| 12 |
except ImportError:
|
| 13 |
Groq = None
|
| 14 |
|
| 15 |
+
# Read the API key from Hugging Face Secrets
|
| 16 |
+
GROQ_API_KEY = os.environ.get("GROQ_API_KEY")
|
| 17 |
+
|
| 18 |
+
# Safety check – show status in the app (never show actual key!)
|
| 19 |
+
if GROQ_API_KEY:
|
| 20 |
+
st.sidebar.success("✅ GROQ API Key found")
|
| 21 |
+
else:
|
| 22 |
+
st.sidebar.error("❌ GROQ API Key missing! Please set it in Hugging Face Spaces -> Settings -> Repository Secrets")
|
| 23 |
+
|
| 24 |
|
| 25 |
# -----------------------------
|
| 26 |
# Utility Functions
|