添加Ai 能力,重构项目结构

This commit is contained in:
zk
2026-07-24 17:55:27 +08:00
parent 39e162ae0f
commit d7f1ba4812
13 changed files with 127 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
import os
from pathlib import Path
from .settings import Settings
_env = os.getenv("ENV", "dev")
_env_files = {"dev": ".env", "test": ".env.test", "prod": ".env.prod"}
# 定位项目根目录(config 上两级)
_project_root = Path(__file__).resolve().parent.parent.parent
_env_file = _project_root / _env_files.get(_env, ".env")
if not _env_file.exists():
raise FileNotFoundError(f".env 文件不存在: {_env_file}")
settings = Settings(_env_file=str(_env_file))
__all__ = ["settings"]