mgbam commited on
Commit
21067cf
·
verified ·
1 Parent(s): 93406ed

Update config/settings.py

Browse files
Files changed (1) hide show
  1. config/settings.py +33 -17
config/settings.py CHANGED
@@ -1,39 +1,55 @@
1
  # /home/user/app/config/settings.py
2
  from pydantic_settings import BaseSettings
3
  from pathlib import Path
4
- from typing import Optional
5
 
6
  class Settings(BaseSettings):
7
  APP_TITLE: str = "Quantum Healthcare Navigator"
8
- DATABASE_URL: str = "sqlite:///./test.db" # Example
9
- LOG_LEVEL: str = "INFO"
10
- # API Keys (ensure these are loaded from environment variables or secrets)
11
- SECRET_KEY: str = "your_very_secret_key_for_jwt_or_other_things" # Example
 
 
 
 
 
 
12
  UMLS_API_KEY: Optional[str] = None
13
  BIOPORTAL_API_KEY: Optional[str] = None
14
- GEMINI_API_KEY: Optional[str] = None # Or your specific LLM API key
15
- OPENAI_API_KEY: Optional[str] = None
16
 
17
- # NEW: Disclaimer texts
18
- MAIN_DISCLAIMER_SHORT: str = "AI for informational support only. Not a diagnostic tool. Verify with clinical judgment."
 
 
 
 
 
 
 
 
 
19
  MAIN_DISCLAIMER_LONG: str = (
20
  "This AI-powered tool is intended for informational and educational purposes to support healthcare professionals. "
21
  "It is NOT a diagnostic tool, does not provide medical advice, and should NOT be used as a substitute for "
22
  "independent professional medical judgment, diagnosis, or treatment. Always verify information with trusted clinical "
23
- "resources and apply your professional expertise. Do not input real Patient Health Information (PHI)."
24
  )
25
  SIMULATION_DISCLAIMER: str = (
26
- "Features described as 'Quantum' or involving optimization are currently simulated for demonstration "
27
- "purposes and do not utilize actual quantum computing hardware or validated quantum algorithms for clinical decision-making."
28
  )
29
 
30
  class Config:
31
- env_file = ".env"
32
  env_file_encoding = 'utf-8'
33
- extra = "ignore"
34
 
35
  settings = Settings()
36
 
37
- # For logo path (if you prefer it in settings)
38
- # PROJECT_ROOT = Path(__file__).resolve().parent.parent
39
- # LOGO_PATH = str(PROJECT_ROOT / "assets" / "logo.png")
 
 
 
 
1
  # /home/user/app/config/settings.py
2
  from pydantic_settings import BaseSettings
3
  from pathlib import Path
4
+ from typing import Optional # Ensure Optional is imported
5
 
6
  class Settings(BaseSettings):
7
  APP_TITLE: str = "Quantum Healthcare Navigator"
8
+ DATABASE_URL: str = "sqlite:///./medqa_app.db" # Example: Use a specific DB file name
9
+ LOG_LEVEL: str = "INFO" # e.g., DEBUG, INFO, WARNING, ERROR
10
+
11
+ # --- API Keys ---
12
+ # Ensure these are set in your Hugging Face Space secrets or .env file
13
+ # Pydantic will automatically load them if the environment variable names match the field names.
14
+
15
+ OPENAI_API_KEY: Optional[str] = None # For the primary agent LLM
16
+
17
+ # UMLS and BioPortal keys for your tools
18
  UMLS_API_KEY: Optional[str] = None
19
  BIOPORTAL_API_KEY: Optional[str] = None
 
 
20
 
21
+ # Gemini key (keep if you might use Gemini for other things, or comment out if solely OpenAI now)
22
+ GEMINI_API_KEY: Optional[str] = None
23
+
24
+ # A general secret key for other app purposes if needed (e.g., session signing)
25
+ SECRET_KEY: str = "your_application_secret_key_here_make_it_strong"
26
+
27
+ # --- Disclaimer Texts ---
28
+ MAIN_DISCLAIMER_SHORT: str = (
29
+ "AI for informational support only. Not a diagnostic tool. "
30
+ "Verify information with clinical judgment. Do not enter real PHI."
31
+ )
32
  MAIN_DISCLAIMER_LONG: str = (
33
  "This AI-powered tool is intended for informational and educational purposes to support healthcare professionals. "
34
  "It is NOT a diagnostic tool, does not provide medical advice, and should NOT be used as a substitute for "
35
  "independent professional medical judgment, diagnosis, or treatment. Always verify information with trusted clinical "
36
+ "resources and apply your professional expertise. **Do not input real Patient Health Information (PHI) into this system.**"
37
  )
38
  SIMULATION_DISCLAIMER: str = (
39
+ "Features described as 'Quantum' or involving optimization are currently **simulated for demonstration "
40
+ "purposes** and do not utilize actual quantum computing hardware or validated quantum algorithms for clinical decision-making."
41
  )
42
 
43
  class Config:
44
+ env_file = ".env" # Looks for a .env file in the root directory
45
  env_file_encoding = 'utf-8'
46
+ extra = "ignore" # Ignore extra fields from environment if any
47
 
48
  settings = Settings()
49
 
50
+ # Optional: You can add a check here to log if essential keys are missing during startup
51
+ # from services.logger import app_logger # Assuming logger is configured early
52
+ # if not settings.OPENAI_API_KEY:
53
+ # app_logger.warning("CRITICAL SETTINGS: OPENAI_API_KEY is not set. The AI agent will not function.")
54
+ # if not settings.DATABASE_URL:
55
+ # app_logger.warning("SETTINGS: DATABASE_URL is not set. Using default or in-memory DB might occur.")