lalaru commited on
Commit
11af2e8
·
verified ·
1 Parent(s): c60654d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -24,7 +24,13 @@ except ImportError:
24
  TTS_ENGINE = "gtts"
25
 
26
  # === Groq API Key ===
27
- GROQ_API_KEY = os.getenv("GROQ_API_KEY", "your_api_key_here")
 
 
 
 
 
 
28
  client = Groq(api_key=GROQ_API_KEY)
29
 
30
  # === Error tracking & history storage ===
 
24
  TTS_ENGINE = "gtts"
25
 
26
  # === Groq API Key ===
27
+ # GROQ_API_KEY = os.getenv("GROQ_API_KEY", "your_api_key_here")
28
+ # client = Groq(api_key=GROQ_API_KEY)
29
+ GROQ_API_KEY = os.environ.get("GROQ_API_KEY") # no fallback value for security
30
+
31
+ if GROQ_API_KEY is None:
32
+ raise ValueError("❌ GROQ_API_KEY is not set. Please add it in Hugging Face Spaces 'Settings > Secrets'.")
33
+
34
  client = Groq(api_key=GROQ_API_KEY)
35
 
36
  # === Error tracking & history storage ===