Add the tools sub-project with the run_llm batch runner

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-04 14:03:28 +08:00
co-authored by Claude Fable 5
parent 9a42b463a3
commit 12ace6f45a
24 changed files with 1947 additions and 17 deletions
+22
View File
@@ -27,3 +27,25 @@
- **完整歌詞不進 git**(版權);API 金鑰走 `.env`
- **專案目錄維持原名 `pop-fem-audit`**API 管線下目錄名不會
進入模型輸入,無污染疑慮。
## 2026-07-31
- **專案英文名定為「A Feminist Audit of Pop Music」**:明示
女性主義立場,「audit」兼指對歌曲與對 LLM 標籤系統的稽核,
並與縮寫 `pop-fem-audit` 對應。
- **程式碼收整為 `tools/` src-layout 子專案**:發行名
`pop-fem-audit-tools`、import 套件名 `pop_fem_audit_tools`
description「Tools for A Feminist Audit of Pop Music.」;
`pip install -e tools/` 安裝、`python -m
pop_fem_audit_tools.run_llm` 執行;相依套件記於
`pyproject.toml``requirements.txt` 移除);Sphinx 文件
暫緩。理由:後續多支程式將共用程式碼,套件化後測試可用
正常 import;目錄名 `tools/` 經無脈絡的獨立 subagent 命名
評估選出,最誠實反映「服務研究的輔助工具」定位——研究
本體在根目錄的 prompts/、runs/、results/,程式只是配套。
- **CLI 入口改為套件層級 dispatcher**dispatcher 為單一
入口,`run_llm.py` 的 entry point 移除;有兩種等價呼叫
形式——`python -m pop_fem_audit_tools run-llm ...`
console script `pop-fem-audit-tools run-llm ...`
`[project.scripts]`)。理由:後續多支工具共用單一入口,
`--help` 可列出全部子命令,重現文件穩定。
+10 -4
View File
@@ -17,10 +17,16 @@ pop-fem-audit/
│ └── lyrics/ # 歌詞快取(gitignored,版權)
├── prompts/ # LLM 定義檔(逐字作為 system prompt
│ └── <task>_v<N>.md # 版本化:screen_v1.md、judge_v2.md…
├── scripts/ # deterministic Python scripts
# (runner、抓歌詞、統計、圖表)
└── run_llm.py # API runner2+1 協定、Batch API、
# 自動寫入 runs/
├── tools/ # 輔助工具子專案(src-layout
├── pyproject.toml # 套件 pop_fem_audit_tools
│ # pip install -e tools/ 安裝
├── src/pop_fem_audit_tools/ # deterministic Python 程式
│ │ │ # (runner、抓歌詞、統計、圖表)
│ │ ├── __main__.py # 套件 CLI 進入點(分派子命令)
│ │ └── run_llm.py # API runner2+1 協定、Batch API、
│ │ # 自動寫入 runs/;執行方式
│ │ # python -m pop_fem_audit_tools run-llm
│ └── tests/ # 單元測試(unittest
├── runs/ # 每次執行的完整稽核紀錄(進 git)
│ └── <階段>/<日期>-<定義檔版本>/
│ ├── prompt.md # 當次定義檔快照(自我完備)