61 lines
1.9 KiB
Python
61 lines
1.9 KiB
Python
# ZeekerWatchman - Configuration Management
|
|
|
|
import os
|
|
from pathlib import Path
|
|
|
|
from dotenv import load_dotenv
|
|
from pydantic_settings import BaseSettings
|
|
import logging
|
|
|
|
# Load .env into os.environ so non-prefixed keys (API keys) are also available
|
|
load_dotenv(Path(__file__).parent.parent / ".env")
|
|
|
|
# Configure testflow logger — used by all services
|
|
logging.basicConfig(
|
|
level=logging.INFO,
|
|
format="%(asctime)s.%(msecs)03d %(levelname)-5s %(message)s",
|
|
datefmt="%H:%M:%S",
|
|
)
|
|
logging.getLogger("httpx").setLevel(logging.WARNING)
|
|
logging.getLogger("openai").setLevel(logging.WARNING)
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
APP_NAME: str = "ZeekerWatchman"
|
|
VERSION: str = "0.1.0"
|
|
DEBUG: bool = True
|
|
|
|
# Paths
|
|
ZEEKERWATCHMEN_DIR: Path = Path(__file__).parent.parent / ".zeekerwatchmen"
|
|
SKILLS_DIR: Path = ZEEKERWATCHMEN_DIR / "skills"
|
|
MEMORY_DIR: Path = ZEEKERWATCHMEN_DIR / "memory"
|
|
SOUL_DIR: Path = ZEEKERWATCHMEN_DIR / "soul"
|
|
OUTPUT_DIR: Path = Path(__file__).parent.parent / "output"
|
|
|
|
# LLM Configuration
|
|
LLM_PROVIDER: str = "deepseek"
|
|
TEXT_MODEL: str = "deepseek-chat"
|
|
IMAGE_MODEL: str = "qwen3-vl-plus"
|
|
USE_MOCK: bool = True # True=左侧流水线用Mock / False=真实LLM
|
|
CHAT_USE_MOCK: bool = False # True=右侧AI助手用Mock / False=真实LLM
|
|
|
|
# CORS
|
|
CORS_ORIGINS: list = ["http://localhost:3000"]
|
|
|
|
# Upload
|
|
MAX_UPLOAD_SIZE_MB: int = 10
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
env_prefix = "ZEEKER_"
|
|
extra = "ignore"
|
|
|
|
|
|
settings = Settings()
|
|
|
|
# API Keys loaded from env directly (no prefix)
|
|
DEEPSEEK_API_KEY = os.environ.get("DEEPSEEK_API_KEY", "")
|
|
DEEPSEEK_BASE_URL = os.environ.get("DEEPSEEK_BASE_URL", "https://api.deepseek.com/v1")
|
|
DASHSCOPE_API_KEY = os.environ.get("DASHSCOPE_API_KEY", "")
|
|
DASHSCOPE_BASE_URL = os.environ.get("DASHSCOPE_BASE_URL", "https://dashscope.aliyuncs.com/compatible-mode/v1")
|