feat: add AI model config template

This commit is contained in:
2026-06-22 16:57:11 +08:00
parent c59a348d67
commit 89ead379d2
6 changed files with 46 additions and 4 deletions
+2 -1
View File
@@ -73,6 +73,7 @@
config\
app_config.json # 用户偏好(输出格式、最近文件夹、最近模板、更新源等)
templates.json # 用户自定义模板
ai_models.json # AI 穿搭模型配置(管理员填写 key,首次可由出厂模板播种)
logs\
output\ # 默认导出目录的回退位置(安装根不可写时)
```
@@ -106,7 +107,7 @@
1. 环境变量 `CMBOT_DATA_DIR` 非空时使用它(覆盖口,供测试或特殊部署)。
2. 打包态(`sys.frozen`)→ `~/.cmbot`(即 `%USERPROFILE%\.cmbot`)。**不依赖启动器注入环境变量**:即使用户绕过 `Launcher.exe` 直接双击 `app\CMBot.exe`,数据也落在 `~/.cmbot`。
3. 开发态 → 项目根(不污染开发者主目录,保持现状)。
- **首次运行播种**:`~/.cmbot/config/templates.json`(或 `app_config.json`)不存在时,从程序包内 `app\config\` 拷贝出厂默认;缺省再退回内置默认(呼应 `docs/09` 第 6 节)。
- **首次运行播种**:`~/.cmbot/config/app_config.json`、`templates.json`、`ai_models.json` 不存在时,从程序包内 `app\config\` 拷贝对应出厂默认;缺省再退回内置默认(呼应 `docs/09` 第 6 节)。`ai_models.json` 出厂模板不得包含真实 API key,管理员在用户数据目录中填写。
- 写入配置/模板/日志/输出前按需创建多级目录(`parents=True`)。
数据目录分离与 `~/.cmbot` 约定后续需同步 `docs/05-project-architecture.md` 与 `docs/09` 第 5、6 节的目录说明。