Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

📜 天道自动写作大阵 (The Chronicle of Gaokao: Auto-Writer Array)

“道生一,一生二,二生三,三生万物。代码生Bug,Bug生补丁,补丁生需求...” —— 《码农真经》

🔮 阵法简介 (Introduction)

本阵法(Project)乃是集天地灵气(GLM-4 API)与上古符文(Python)以及天宫数据(SQLite)于一体的全自动高中生活模拟与爽文生成引擎。 目标是炼制出一部记录《拮抗中学》三年因果的传世经典,以证算力大道。

🛠️ 筑基法门 (Installation)

欲练此功,必先筑基:

  1. 凝练灵气:确保已安装 Python 3.12+ 及 uv。
  2. 开启洞府:
    uv sync
  3. 注入灵石:在 .env 中配置 API_KEY 与 BASE_URL。

🎮 三大法器 (Core Artifacts)

本门派现有三大镇派法器,各司其职:

1. 造化鼎 (generate_full_plan.py) —— 核心推演

“大衍之数五十,其用四十有九。”

  • 用途:推演高一至高三的全剧本(Master Plan)。
  • 神通:内嵌三级缓存机制(查表->调AI->存表),能高效生成魔王级考题而不耗损过多灵力。
  • 产出:3_year_master_plan.txt(天书)。

2. 天库大阵 (batch_quiz_gen.py) —— 批量炼丹

“文曲星下凡,题海无边。”

  • 用途:批量生成各科考题,充实文曲库。
  • 神通:自动扫描课程表,针对空缺知识点进行大规模 AI 命题。

3. 创世神笔 (helper/seed_names_db.py & helper/seed_npc_metadata.py) —— 重塑红尘

“神笔一挥,众生归位。”

  • 用途:初始化红尘库。
  • 神通:生成数千个符合年代特征(70后老师/00后学生)的真实名讳,并将角色属性(家境、性格、流派)注入天宫。

🧩 天宫架构 (Data Architecture)

为保大阵清明,采取**“文武分治,红尘两清”**之策:

  • 文曲库 (novel_engine/data/storage/course_data.db)

    • 掌管:课程表、AI 题库。
    • 职责:考核与磨砺。
  • 红尘库 (novel_engine/data/storage/world_data.db)

    • 掌管:百家姓、年代名、技能树、红尘事件。
    • 职责:演绎与悲欢。
  • 守护者:

    • database.py:红尘库守护使。
    • quiz_data.py:文曲库守护使。

✅ 自动化测试 (Pytest Full Chain)

本项目提供按顺序执行的全链路 pytest 模块:

  1. test_00_api_key.py:真实 API key 连通性(thinking on/off)
  2. test_10_static_checks.py:py_compile + pyright
  3. test_20_generate_plan.py:隔离目录生成三年剧本
  4. test_30_run_one_chapter.py:隔离目录运行一章小说

推荐命令:

uv run pytest -x -q tests

分层执行(CI 可选):

uv run pytest -x -q tests/test_00_api_key.py tests/test_10_static_checks.py tests/test_20_generate_plan.py tests/test_30_run_one_chapter.py

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages