Spaces:
Sleeping
Sleeping
Create src/chimera/config.py
Browse files- src/chimera/config.py +21 -0
src/chimera/config.py
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# src/chimera/config.py
|
2 |
+
import os
|
3 |
+
from dotenv import load_dotenv
|
4 |
+
|
5 |
+
# Load environment variables from .env file if it exists (for local dev)
|
6 |
+
load_dotenv()
|
7 |
+
|
8 |
+
# Hugging Face Spaces secrets are loaded as environment variables directly
|
9 |
+
GEMINI_API_KEY = os.getenv("GEMINI_API_KEY")
|
10 |
+
SERPAPI_API_KEY = os.getenv("SERPAPI_API_KEY")
|
11 |
+
# Add other keys
|
12 |
+
# OPENWEATHERMAP_API_KEY = os.getenv("OPENWEATHERMAP_API_KEY")
|
13 |
+
|
14 |
+
# Basic check
|
15 |
+
if not GEMINI_API_KEY:
|
16 |
+
print("Warning: GEMINI_API_KEY not found in environment variables.")
|
17 |
+
if not SERPAPI_API_KEY:
|
18 |
+
print("Warning: SERPAPI_API_KEY not found in environment variables.")
|
19 |
+
|
20 |
+
# You might add other configurations here, like model names, default locations, etc.
|
21 |
+
GEMINI_MODEL_NAME = "gemini-1.5-flash" # Or your preferred model
|