"""
Centralised configuration for the AI Cats Python services.

All values are read from environment variables which are loaded from the
project .env file by python-dotenv at process startup (see models/database.py).
No credentials are hardcoded here.
"""

import os
from dotenv import load_dotenv

# Load .env from the project root (two levels up from this file).
_project_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
load_dotenv(os.path.join(_project_root, ".env"))

DB_HOST     = os.environ.get("DB_HOST",     "localhost")
DB_PORT     = int(os.environ.get("DB_PORT", "5432"))
DB_NAME     = os.environ.get("DB_NAME",     "ai_cats")
DB_USER     = os.environ.get("DB_USER",     "")
DB_PASSWORD = os.environ.get("DB_PASSWORD", "")

# Confidence threshold — PHP's system_settings value is read directly from DB
# at runtime; this is the fallback default used when the setting is absent.
DEFAULT_CONFIDENCE_THRESHOLD = 90.0
