Download src/config/settings.py from Distopia22/icd-cpt-coding-api-backend: direct link, hf CLI and curl.
- Browser
- Download file 879 Bytes
-
https://huggingface.co/spaces/Distopia22/icd-cpt-coding-api-backend/resolve/764e30e4516861d7fef3c19bacc1d5486a9aedfa/src/config/settings.py
- Command line
-
hf download hf://spaces/Distopia22/icd-cpt-coding-api-backend@764e30e4516861d7fef3c19bacc1d5486a9aedfa/src/config/settings.py
-
curl -L -o settings.py https://huggingface.co/spaces/Distopia22/icd-cpt-coding-api-backend/resolve/764e30e4516861d7fef3c19bacc1d5486a9aedfa/src/config/settings.py
879 Bytes
| import os | |
| from pydantic_settings import BaseSettings | |
| class Settings(BaseSettings): | |
| # Groq API Configuration | |
| groq_api_key: str = os.getenv("GROQ_API_KEY", "") | |
| groq_model: str = os.getenv("GROQ_MODEL", "llama-3.3-70b-versatile") | |
| # API Configuration | |
| api_title: str = "ICD-CPT Coding API" | |
| api_version: str = "1.0.0" | |
| api_description: str = "Medical coding assistant powered by Groq LLaMA 3.3 70B" | |
| class Config: | |
| env_file = ".env" | |
| case_sensitive = False | |
| settings = Settings() | |
| # Validate API key on startup | |
| if not settings.groq_api_key: | |
| print("⚠️ WARNING: GROQ_API_KEY is not set! API will not function properly.") | |
| print("Please set GROQ_API_KEY in Hugging Face Space secrets.") | |
| else: | |
| print(f"✅ Groq API Key loaded (length: {len(settings.groq_api_key)})") | |
| print(f"✅ Using model: {settings.groq_model}") |