Update config/settings.py
Browse files- config/settings.py +10 -28
config/settings.py
CHANGED
@@ -1,33 +1,22 @@
|
|
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:///./medqa_app.db"
|
9 |
-
LOG_LEVEL: str = "INFO"
|
10 |
|
11 |
-
|
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. "
|
@@ -41,15 +30,8 @@ class Settings(BaseSettings):
|
|
41 |
)
|
42 |
|
43 |
class Config:
|
44 |
-
env_file = ".env"
|
45 |
env_file_encoding = 'utf-8'
|
46 |
-
extra = "ignore"
|
47 |
-
|
48 |
-
settings = Settings()
|
49 |
|
50 |
-
|
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.")
|
|
|
1 |
# /home/user/app/config/settings.py
|
2 |
from pydantic_settings import BaseSettings
|
3 |
from pathlib import Path
|
4 |
+
from typing import Optional # IMPORTED Optional
|
5 |
|
6 |
class Settings(BaseSettings):
|
7 |
APP_TITLE: str = "Quantum Healthcare Navigator"
|
8 |
+
DATABASE_URL: str = "sqlite:///./medqa_app.db"
|
9 |
+
LOG_LEVEL: str = "INFO"
|
10 |
|
11 |
+
OPENAI_API_KEY: Optional[str] = None
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
UMLS_API_KEY: Optional[str] = None
|
13 |
BIOPORTAL_API_KEY: Optional[str] = None
|
14 |
+
GEMINI_API_KEY: Optional[str] = None # Kept for flexibility, but agent uses OpenAI
|
15 |
+
SECRET_KEY: str = "your_strong_secret_key_for_the_application_f34f1923s"
|
16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
MAIN_DISCLAIMER_SHORT: str = (
|
18 |
"AI for informational support only. Not a diagnostic tool. "
|
19 |
+
"Verify information with clinical judgment. **Do not enter real PHI.**"
|
20 |
)
|
21 |
MAIN_DISCLAIMER_LONG: str = (
|
22 |
"This AI-powered tool is intended for informational and educational purposes to support healthcare professionals. "
|
|
|
30 |
)
|
31 |
|
32 |
class Config:
|
33 |
+
env_file = ".env"
|
34 |
env_file_encoding = 'utf-8'
|
35 |
+
extra = "ignore"
|
|
|
|
|
36 |
|
37 |
+
settings = Settings()
|
|
|
|
|
|
|
|
|
|