Spaces:
Sleeping
Sleeping
Download api_clients/config.py from mgbam/project-asclepius: direct link, hf CLI and curl.
- Browser
- Download file 957 Bytes
-
https://huggingface.co/spaces/mgbam/project-asclepius/resolve/51d35a829a4e803d8b756a80441d1221a042256a/api_clients/config.py
- Command line
-
hf download hf://spaces/mgbam/project-asclepius@51d35a829a4e803d8b756a80441d1221a042256a/api_clients/config.py
-
curl -L -o config.py https://huggingface.co/spaces/mgbam/project-asclepius/resolve/51d35a829a4e803d8b756a80441d1221a042256a/api_clients/config.py
957 Bytes
| # api_clients/config.py | |
| """ | |
| Central configuration for API keys and base URLs. | |
| Loads keys from environment variables for security. | |
| """ | |
| import os | |
| from dotenv import load_dotenv | |
| # Load environment variables from .env file for local development | |
| load_dotenv() | |
| # --- API Keys --- | |
| # In Hugging Face, these are set as Space Secrets. | |
| GEMINI_API_KEY = os.getenv("GEMINI_API_KEY") | |
| UMLS_API_KEY = os.getenv("UMLS_API_KEY") | |
| # --- Base URLs --- | |
| UMLS_AUTH_URL = "https://utslogin.nlm.nih.gov/cas/v1/api-key" | |
| UMLS_BASE_URL = "https://uts-ws.nlm.nih.gov/rest" | |
| RXNORM_BASE_URL = "https://rxnav.nlm.nih.gov/REST" | |
| PUBMED_BASE_URL = "https://eutils.ncbi.nlm.nih.gov/entrez/eutils" | |
| OPENFDA_BASE_URL = "https://api.fda.gov" | |
| CLINICALTRIALS_BASE_URL = "https://clinicaltrials.gov/api/v2" | |
| # --- Headers --- | |
| # A good practice to identify your application | |
| REQUEST_HEADERS = { | |
| 'User-Agent': 'ProjectAsclepius/1.0 (Advanced Medical AI; https://hf.co/spaces/YourUser/YourSpace)' | |
| } |