Spaces:
Sleeping
Sleeping
Update api_clients/config.py
Browse files- api_clients/config.py +29 -0
api_clients/config.py
CHANGED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# api_clients/config.py
|
2 |
+
"""
|
3 |
+
Central configuration for API keys and base URLs.
|
4 |
+
Loads keys from environment variables for security.
|
5 |
+
"""
|
6 |
+
import os
|
7 |
+
from dotenv import load_dotenv
|
8 |
+
|
9 |
+
# Load environment variables from .env file for local development
|
10 |
+
load_dotenv()
|
11 |
+
|
12 |
+
# --- API Keys ---
|
13 |
+
# In Hugging Face, these are set as Space Secrets.
|
14 |
+
GEMINI_API_KEY = os.getenv("GEMINI_API_KEY")
|
15 |
+
UMLS_API_KEY = os.getenv("UMLS_API_KEY")
|
16 |
+
|
17 |
+
# --- Base URLs ---
|
18 |
+
UMLS_AUTH_URL = "https://utslogin.nlm.nih.gov/cas/v1/api-key"
|
19 |
+
UMLS_BASE_URL = "https://uts-ws.nlm.nih.gov/rest"
|
20 |
+
RXNORM_BASE_URL = "https://rxnav.nlm.nih.gov/REST"
|
21 |
+
PUBMED_BASE_URL = "https://eutils.ncbi.nlm.nih.gov/entrez/eutils"
|
22 |
+
OPENFDA_BASE_URL = "https://api.fda.gov"
|
23 |
+
CLINICALTRIALS_BASE_URL = "https://clinicaltrials.gov/api/v2"
|
24 |
+
|
25 |
+
# --- Headers ---
|
26 |
+
# A good practice to identify your application
|
27 |
+
REQUEST_HEADERS = {
|
28 |
+
'User-Agent': 'ProjectAsclepius/1.0 (Advanced Medical AI; https://hf.co/spaces/YourUser/YourSpace)'
|
29 |
+
}
|