Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,13 +6,8 @@ from groq import Groq
|
|
| 6 |
import os
|
| 7 |
|
| 8 |
# --- Groq API Key Handling ---
|
| 9 |
-
GROQ_CONFIG = 'groq_config.json'
|
| 10 |
def get_groq_api_key():
|
| 11 |
-
|
| 12 |
-
with open(GROQ_CONFIG, 'r') as f:
|
| 13 |
-
config = json.load(f)
|
| 14 |
-
return config.get('GROQ_API_KEY', '')
|
| 15 |
-
return ''
|
| 16 |
|
| 17 |
groq_api_key = get_groq_api_key()
|
| 18 |
groq_client = Groq(api_key=groq_api_key) if groq_api_key else None
|
|
|
|
| 6 |
import os
|
| 7 |
|
| 8 |
# --- Groq API Key Handling ---
|
|
|
|
| 9 |
def get_groq_api_key():
|
| 10 |
+
return os.environ.get('GROQ_API_KEY', '')
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
groq_api_key = get_groq_api_key()
|
| 13 |
groq_client = Groq(api_key=groq_api_key) if groq_api_key else None
|