| """ | |
| config.py | |
| --------- | |
| Central configuration for Notiflow. | |
| All file paths, feature flags, and model settings live here. | |
| Every other module imports from this file — no hardcoded paths elsewhere. | |
| """ | |
| from pathlib import Path | |
| # --------------------------------------------------------------------------- | |
| # Project root | |
| # --------------------------------------------------------------------------- | |
| ROOT = Path(__file__).parent.parent # notiflow/ | |
| # --------------------------------------------------------------------------- | |
| # Data paths | |
| # --------------------------------------------------------------------------- | |
| DATA_DIR = ROOT / "data" | |
| DATA_FILE = DATA_DIR / "notiflow_data.xlsx" # Excel business store | |
| MEMORY_FILE = DATA_DIR / "agent_memory.json" # Agent memory (recent context) | |
| REGISTRY_FILE = ROOT / "skills" / "skill_registry.json" # Skill registry | |
| # --------------------------------------------------------------------------- | |
| # Feature flags | |
| # --------------------------------------------------------------------------- | |
| # When True the dashboard and main.py simulate the pipeline locally. | |
| # Set to False (or override via env var) to use real Bedrock inference. | |
| import os | |
| NOTIFLOW_DEMO_MODE = os.getenv("NOTIFLOW_DEMO_MODE", "true").lower() == "true" | |
| # Legacy alias for backward compatibility | |
| DEMO_MODE = NOTIFLOW_DEMO_MODE | |
| # --------------------------------------------------------------------------- | |
| # Amazon Bedrock settings | |
| # --------------------------------------------------------------------------- | |
| BEDROCK_REGION = os.getenv("AWS_REGION", "us-east-1") | |
| BEDROCK_MODEL_ID = "amazon.nova-lite-v1:0" | |
| # --------------------------------------------------------------------------- | |
| # Ensure data directory exists at import time | |
| # --------------------------------------------------------------------------- | |
| DATA_DIR.mkdir(parents=True, exist_ok=True) | |
| # --------------------------------------------------------------------------- | |
| # Gemini settings (added: backend upgrade) | |
| # --------------------------------------------------------------------------- | |
| GEMINI_API_KEY: str | None = os.getenv("GEMINI_API_KEY") | |
| # --------------------------------------------------------------------------- | |
| # Excel sync path (added: backend upgrade) | |
| # If EXCEL_FILE_PATH is set in .env, it overrides the default DATA_FILE. | |
| # If not set, the existing DATA_FILE path is used as fallback. | |
| # --------------------------------------------------------------------------- | |
| _env_excel = os.getenv("EXCEL_FILE_PATH") | |
| EXCEL_SYNC_FILE = Path(_env_excel) if _env_excel else DATA_FILE |