Spaces:
Running
Running
DIVYANSHI SINGH commited on
Commit Β·
623da34
1
Parent(s): 16baa93
π Fix: Robust environment variable loading to prevent illegal header errors
Browse files- core/ai.py +3 -2
- core/github.py +1 -1
core/ai.py
CHANGED
|
@@ -7,8 +7,9 @@ from dotenv import load_dotenv
|
|
| 7 |
load_dotenv()
|
| 8 |
log = logging.getLogger(__name__)
|
| 9 |
|
| 10 |
-
GEMINI_API_KEY = os.getenv("GEMINI_API_KEY"
|
| 11 |
-
|
|
|
|
| 12 |
|
| 13 |
gemini_client = None
|
| 14 |
if GEMINI_API_KEY:
|
|
|
|
| 7 |
load_dotenv()
|
| 8 |
log = logging.getLogger(__name__)
|
| 9 |
|
| 10 |
+
GEMINI_API_KEY = os.getenv("GEMINI_API_KEY") or os.getenv("GOOGLE_API_KEY") or ""
|
| 11 |
+
GEMINI_API_KEY = GEMINI_API_KEY.strip()
|
| 12 |
+
GROQ_API_KEY = os.getenv("GROQ_API_KEY", "").strip()
|
| 13 |
|
| 14 |
gemini_client = None
|
| 15 |
if GEMINI_API_KEY:
|
core/github.py
CHANGED
|
@@ -9,7 +9,7 @@ load_dotenv()
|
|
| 9 |
log = logging.getLogger(__name__)
|
| 10 |
|
| 11 |
GITHUB_API = "https://api.github.com"
|
| 12 |
-
GITHUB_TOKEN = os.getenv("GITHUB_TOKEN", "")
|
| 13 |
|
| 14 |
HEADERS = {
|
| 15 |
"Accept": "application/vnd.github+json",
|
|
|
|
| 9 |
log = logging.getLogger(__name__)
|
| 10 |
|
| 11 |
GITHUB_API = "https://api.github.com"
|
| 12 |
+
GITHUB_TOKEN = os.getenv("GITHUB_TOKEN", "").strip()
|
| 13 |
|
| 14 |
HEADERS = {
|
| 15 |
"Accept": "application/vnd.github+json",
|