{"id":1663,"date":"2025-10-14T15:16:54","date_gmt":"2025-10-14T07:16:54","guid":{"rendered":"https:\/\/www.loganblog.com\/?p=1663"},"modified":"2025-10-14T15:29:03","modified_gmt":"2025-10-14T07:29:03","slug":"%e8%87%aa%e5%8a%a8%e5%8c%96%e7%94%9f%e6%88%90%e6%9e%b6%e6%9e%84","status":"publish","type":"post","link":"https:\/\/www.loganblog.com\/index.php\/2025\/10\/14\/%e8%87%aa%e5%8a%a8%e5%8c%96%e7%94%9f%e6%88%90%e6%9e%b6%e6%9e%84\/","title":{"rendered":"\u81ea\u52a8\u5316\u751f\u6210\u67b6\u6784"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u6574\u4f53\u67b6\u6784\u8bbe\u8ba1<\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n# ============================================\n# \u9879\u76ee\u7ed3\u6784\n# ============================================\n&quot;&quot;&quot;\ntutorial-generator\/\n\u251c\u2500\u2500 app\/\n\u2502   \u251c\u2500\u2500 __init__.py\n\u2502   \u251c\u2500\u2500 main.py                 # FastAPI\u5e94\u7528\n\u2502   \u251c\u2500\u2500 config.py               # \u914d\u7f6e\n\u2502   \u2514\u2500\u2500 database.py             # \u6570\u636e\u5e93\n\u2502\n\u251c\u2500\u2500 core\/\n\u2502   \u251c\u2500\u2500 llm\/\n\u2502   \u2502   \u251c\u2500\u2500 client.py           # LLM\u5ba2\u6237\u7aef\uff08\u5e26\u91cd\u8bd5\uff09\n\u2502   \u2502   \u251c\u2500\u2500 prompt_template.py  # \u63d0\u793a\u8bcd\u6a21\u677f\u5f15\u64ce\n\u2502   \u2502   \u2514\u2500\u2500 rate_limiter.py     # \u901f\u7387\u9650\u5236\n\u2502   \u2502\n\u2502   \u251c\u2500\u2500 generators\/\n\u2502   \u2502   \u251c\u2500\u2500 text_generator.py\n\u2502   \u2502   \u2514\u2500\u2500 image_generator.py\n\u2502   \u2502\n\u2502   \u251c\u2500\u2500 executor\/\n\u2502   \u2502   \u251c\u2500\u2500 parallel_executor.py  # \u5e76\u884c\u6267\u884c\u5668\n\u2502   \u2502   \u2514\u2500\u2500 retry_handler.py      # \u91cd\u8bd5\u673a\u5236\n\u2502   \u2502\n\u2502   \u2514\u2500\u2500 validators\/\n\u2502       \u2514\u2500\u2500 content_validator.py   # \u5185\u5bb9\u9a8c\u8bc1\n\u2502\n\u251c\u2500\u2500 pipelines\/\n\u2502   \u251c\u2500\u2500 base_pipeline.py\n\u2502   \u2514\u2500\u2500 batch_tutorial_pipeline.py  # \u6279\u91cf\u6559\u7a0bPipeline\n\u2502\n\u251c\u2500\u2500 templates\/                   # Jinja2\u6a21\u677f\n\u2502   \u251c\u2500\u2500 base.html\n\u2502   \u251c\u2500\u2500 task_create.html\n\u2502   \u251c\u2500\u2500 task_monitor.html\n\u2502   \u2514\u2500\u2500 preview.html\n\u2502\n\u251c\u2500\u2500 static\/\n\u2502   \u251c\u2500\u2500 css\/\n\u2502   \u2514\u2500\u2500 js\/\n\u2502\n\u251c\u2500\u2500 prompts\/                     # \u63d0\u793a\u8bcd\u6a21\u677f\n\u2502   \u251c\u2500\u2500 system\/\n\u2502   \u2502   \u251c\u2500\u2500 tutorial_writer.jinja2\n\u2502   \u2502   \u2514\u2500\u2500 code_expert.jinja2\n\u2502   \u2514\u2500\u2500 user\/\n\u2502       \u251c\u2500\u2500 chapter_text.jinja2\n\u2502       \u2514\u2500\u2500 chapter_image.jinja2\n\u2502\n\u2514\u2500\u2500 requirements.txt\n&quot;&quot;&quot;\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\">\u67b6\u6784\u8bbe\u8ba1\u65b9\u6848<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u4e00\u3001\u7cfb\u7edf\u67b6\u6784\u56fe<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502                        \u524d\u7aef\u5c42 (Web UI)                        \u2502\n\u2502  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510      \u2502\n\u2502  \u2502 \u4efb\u52a1\u521b\u5efa\u9875\u9762  \u2502  \u2502 \u6267\u884c\u76d1\u63a7\u9875\u9762  \u2502  \u2502 \u9884\u89c8\u53d1\u5e03\u9875\u9762  \u2502      \u2502\n\u2502  \u2502 (Alpine.js)  \u2502  \u2502 (WebSocket)  \u2502  \u2502 (Markdown)   \u2502      \u2502\n\u2502  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518      \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n                            \u2195 HTTP\/WebSocket\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502                    API\u5c42 (FastAPI)                           \u2502\n\u2502  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510            \u2502\n\u2502  \u2502 \u4efb\u52a1\u7ba1\u7406API \u2502  \u2502 \u6267\u884cAPI    \u2502  \u2502 \u53d1\u5e03API    \u2502            \u2502\n\u2502  \u2502 CRUD       \u2502  \u2502 Execute    \u2502  \u2502 GitHub     \u2502            \u2502\n\u2502  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518            \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n                            \u2195\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502                   \u4e1a\u52a1\u903b\u8f91\u5c42 (Core)                           \u2502\n\u2502  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510  \u2502\n\u2502  \u2502          Pipeline \u7f16\u6392\u5f15\u64ce                            \u2502  \u2502\n\u2502  \u2502  \u2022 \u9009\u62e9Pipeline \u2022 \u534f\u8c03\u6267\u884c \u2022 \u72b6\u6001\u7ba1\u7406               \u2502  \u2502\n\u2502  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518  \u2502\n\u2502                            \u2195                                 \u2502\n\u2502  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510  \u2502\n\u2502  \u2502         \u5e76\u884c\u6267\u884c\u5f15\u64ce (Executor)                       \u2502  \u2502\n\u2502  \u2502  \u2022 \u4efb\u52a1\u961f\u5217 \u2022 \u5e76\u53d1\u63a7\u5236 \u2022 \u8fdb\u5ea6\u8ffd\u8e2a \u2022 \u7ed3\u679c\u805a\u5408        \u2502  \u2502\n\u2502  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518  \u2502\n\u2502         \u2199          \u2193          \u2193          \u2198                  \u2502\n\u2502  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510      \u2502\n\u2502  \u2502\u91cd\u8bd5\u673a\u5236  \u2502 \u2502\u901f\u7387\u9650\u5236  \u2502 \u2502\u5185\u5bb9\u9a8c\u8bc1  \u2502 \u2502\u9519\u8bef\u5904\u7406  \u2502      \u2502\n\u2502  \u2502Handler   \u2502 \u2502Limiter   \u2502 \u2502Validator \u2502 \u2502Handler   \u2502      \u2502\n\u2502  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518      \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n                            \u2195\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502                    \u539f\u5b50\u80fd\u529b\u5c42 (Generators)                    \u2502\n\u2502  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510      \u2502\n\u2502  \u2502 \u6587\u672c\u751f\u6210\u5668    \u2502  \u2502 \u56fe\u7247\u751f\u6210\u5668    \u2502  \u2502 \u683c\u5f0f\u5316\u5668      \u2502      \u2502\n\u2502  \u2502 TextGen      \u2502  \u2502 ImageGen     \u2502  \u2502 Formatter    \u2502      \u2502\n\u2502  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518      \u2502\n\u2502          \u2193                 \u2193                                 \u2502\n\u2502  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510  \u2502\n\u2502  \u2502            \u63d0\u793a\u8bcd\u6a21\u677f\u5f15\u64ce (Jinja2)                    \u2502  \u2502\n\u2502  \u2502  \u2022 \u7cfb\u7edf\u63d0\u793a\u8bcd \u2022 \u7528\u6237\u63d0\u793a\u8bcd \u2022 \u4e0a\u4e0b\u6587\u6ce8\u5165              \u2502  \u2502\n\u2502  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518  \u2502\n\u2502          \u2193                 \u2193                                 \u2502\n\u2502  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510                        \u2502\n\u2502  \u2502 Claude Client\u2502  \u2502 OpenAI Client\u2502                        \u2502\n\u2502  \u2502 (\u91cd\u8bd5+\u8d85\u65f6)  \u2502  \u2502 (\u91cd\u8bd5+\u8d85\u65f6)  \u2502                        \u2502\n\u2502  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518                        \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n                            \u2195\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502                    \u57fa\u7840\u8bbe\u65bd\u5c42                                 \u2502\n\u2502  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510      \u2502\n\u2502  \u2502 \u6570\u636e\u5e93        \u2502  \u2502 \u6587\u4ef6\u5b58\u50a8      \u2502  \u2502 GitHub API   \u2502      \u2502\n\u2502  \u2502 SQLite\/PG    \u2502  \u2502 Local FS     \u2502  \u2502 Publisher    \u2502      \u2502\n\u2502  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518      \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">\u4e8c\u3001\u6570\u636e\u6d41\u8bbe\u8ba1<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">2.1 \u4efb\u52a1\u521b\u5efa\u6d41\u7a0b<\/h4>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\u7528\u6237\u8f93\u5165\u914d\u7f6e\n    \u2193\n\u9a8c\u8bc1\u914d\u7f6e\u5b8c\u6574\u6027\n    \u2193\n\u9009\u62e9Pipeline\n    \u2193\n\u4fdd\u5b58\u5230\u6570\u636e\u5e93\uff08\u72b6\u6001\uff1aDRAFT\uff09\n    \u2193\n\u8fd4\u56de\u4efb\u52a1ID\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\">2.2 \u4efb\u52a1\u6267\u884c\u6d41\u7a0b<\/h4>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\u70b9\u51fb\u6267\u884c\u6309\u94ae\n    \u2193\n\u52a0\u8f7d\u4efb\u52a1\u914d\u7f6e + Pipeline\n    \u2193\nPipeline\u9884\u5904\u7406\uff08\u6784\u5efa\u4efb\u52a1DAG\uff09\n    \u2193\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502      \u5e76\u884c\u6267\u884c\u5f15\u64ce\u542f\u52a8                 \u2502\n\u2502                                      \u2502\n\u2502  1. \u6784\u5efa\u4efb\u52a1\u5217\u8868\uff08\u6587\u672c+\u56fe\u7247\uff09        \u2502\n\u2502  2. \u6309\u4f9d\u8d56\u5173\u7cfb\u5206\u7ec4                   \u2502\n\u2502  3. \u4f7f\u7528\u4fe1\u53f7\u91cf\u63a7\u5236\u5e76\u53d1\u6570             \u2502\n\u2502                                      \u2502\n\u2502  \u6267\u884c\u5faa\u73af\uff1a                          \u2502\n\u2502  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510   \u2502\n\u2502  \u2502 while \u6709\u5f85\u6267\u884c\u4efb\u52a1:         \u2502   \u2502\n\u2502  \u2502   \u53d6\u4e00\u6279\u4efb\u52a1\uff08\u5e76\u53d1\u9650\u5236\u5185\uff09   \u2502   \u2502\n\u2502  \u2502   \u2193                        \u2502   \u2502\n\u2502  \u2502   \u8c03\u7528LLM\uff08\u5e26\u91cd\u8bd5\uff09         \u2502   \u2502\n\u2502  \u2502   \u2193                        \u2502   \u2502\n\u2502  \u2502   \u9a8c\u8bc1\u7ed3\u679c                 \u2502   \u2502\n\u2502  \u2502   \u2193                        \u2502   \u2502\n\u2502  \u2502   \u4fdd\u5b58\u7ed3\u679c\/\u9519\u8bef            \u2502   \u2502\n\u2502  \u2502   \u2193                        \u2502   \u2502\n\u2502  \u2502   \u66f4\u65b0\u8fdb\u5ea6\uff08WebSocket\u63a8\u9001\uff09 \u2502   \u2502\n\u2502  \u2502   \u2193                        \u2502   \u2502\n\u2502  \u2502   \u7ee7\u7eed\u4e0b\u4e00\u6279               \u2502   \u2502\n\u2502  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518   \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n    \u2193\n\u805a\u5408\u7ed3\u679c\uff08\u6210\u529f+\u5931\u8d25\uff09\n    \u2193\n\u751f\u6210Markdown\u6587\u4ef6\n    \u2193\n\u66f4\u65b0\u4efb\u52a1\u72b6\u6001\uff08COMPLETED\/PARTIAL\uff09\n    \u2193\n\u901a\u77e5\u524d\u7aef\u5b8c\u6210\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\">2.3 \u9884\u89c8\u548c\u53d1\u5e03\u6d41\u7a0b<\/h4>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\u4efb\u52a1\u6267\u884c\u5b8c\u6210\n    \u2193\n\u524d\u7aef\u52a0\u8f7d\u751f\u6210\u7684Markdown\n    \u2193\n\u7528\u6237\u9884\u89c8\uff08\u53ef\u7f16\u8f91\uff09\n    \u2193\n\u7528\u6237\u786e\u8ba4\n    \u2193\n\u70b9\u51fb\u53d1\u5e03\u6309\u94ae\n    \u2193\n\u5408\u5e76\u6240\u6709\u7ae0\u8282\n    \u2193\n\u63d0\u4ea4\u5230GitHub\uff08PR\u6216\u76f4\u63a5Push\uff09\n    \u2193\n\u66f4\u65b0\u4efb\u52a1\u72b6\u6001\uff08PUBLISHED\uff09\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">\u4e09\u3001\u5173\u952e\u6a21\u5757\u8bbe\u8ba1<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">3.1 \u5e76\u884c\u6267\u884c\u5f15\u64ce\uff08\u6838\u5fc3\uff09<\/h4>\n\n\n\n<p><strong>\u8bbe\u8ba1\u8981\u70b9\uff1a<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u4efb\u52a1\u5206\u7ec4\u7b56\u7565<\/strong>\n<ul class=\"wp-block-list\">\n<li>\u6309\u7ae0\u8282\u4f9d\u8d56\u5173\u7cfb\u6784\u5efaDAG<\/li>\n\n\n\n<li>\u65e0\u4f9d\u8d56\u7684\u7ae0\u8282\u53ef\u5b8c\u5168\u5e76\u884c<\/li>\n\n\n\n<li>\u6709\u4f9d\u8d56\u7684\u7ae0\u8282\u6309\u5c42\u7ea7\u6267\u884c<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>\u5e76\u53d1\u63a7\u5236<\/strong>\n<ul class=\"wp-block-list\">\n<li>\u4f7f\u7528<code>asyncio.Semaphore<\/code>\u9650\u5236\u540c\u65f6\u8fdb\u884c\u7684\u8bf7\u6c42\u6570<\/li>\n\n\n\n<li>\u6587\u672c\u548c\u56fe\u7247\u751f\u6210\u53ef\u4ee5\u5e76\u884c<\/li>\n\n\n\n<li>\u540c\u4e00\u7ae0\u8282\u7684\u591a\u5f20\u56fe\u7247\u53ef\u4ee5\u5e76\u884c<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>\u4efb\u52a1\u961f\u5217<\/strong><\/li>\n<\/ol>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n   \u5f85\u6267\u884c\u961f\u5217 \u2192 \u6267\u884c\u4e2d\u961f\u5217 \u2192 \u5b8c\u6210\u961f\u5217\n                     \u2193\n                  \u5931\u8d25\u961f\u5217\uff08\u91cd\u8bd5\uff09\n<\/pre><\/div>\n\n\n<ol start=\"4\" class=\"wp-block-list\">\n<li><strong>\u8fdb\u5ea6\u8ffd\u8e2a<\/strong>\n<ul class=\"wp-block-list\">\n<li>\u5b9e\u65f6\u8ba1\u7b97\uff1a\u5df2\u5b8c\u6210\/\u603b\u4efb\u52a1\u6570<\/li>\n\n\n\n<li>\u901a\u8fc7WebSocket\u63a8\u9001\u8fdb\u5ea6\u5230\u524d\u7aef<\/li>\n\n\n\n<li>\u8bb0\u5f55\u6bcf\u4e2a\u4efb\u52a1\u7684\u72b6\u6001\u3001\u8017\u65f6\u3001\u91cd\u8bd5\u6b21\u6570<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<h4 class=\"wp-block-heading\">3.2 \u91cd\u8bd5\u673a\u5236<\/h4>\n\n\n\n<p><strong>\u4e09\u5c42\u91cd\u8bd5\u7b56\u7565\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\u5c42\u7ea7\u5904\u7406\u5bf9\u8c61\u91cd\u8bd5\u6761\u4ef6\u7b56\u7565L1: LLM\u5ba2\u6237\u7aef\u5355\u4e2aAPI\u8c03\u7528\u901f\u7387\u9650\u5236\u3001\u8d85\u65f6\u3001\u7f51\u7edc\u9519\u8bef\u6307\u6570\u9000\u907f\uff082s, 4s, 8s\uff09L2: \u751f\u6210\u5668\u5355\u4e2a\u4efb\u52a1\u8fd4\u56de\u5185\u5bb9\u9a8c\u8bc1\u5931\u8d25\u7acb\u5373\u91cd\u8bd53\u6b21L3: \u6267\u884c\u5668\u6279\u6b21\u4efb\u52a1\u6574\u4f53\u5931\u8d25\u7387&gt;30%\u6682\u505c\u5e76\u62a5\u8b66<\/pre>\n\n\n\n<p><strong>\u9519\u8bef\u5206\u7c7b\uff1a<\/strong><\/p>\n\n\n\n<p>python<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\u53ef\u91cd\u8bd5\u9519\u8bef\uff1a\n- RateLimitError\uff08\u901f\u7387\u9650\u5236\uff09\n- TimeoutError\uff08\u8d85\u65f6\uff09\n- InvalidResponseError\uff08\u5185\u5bb9\u4e0d\u7b26\u5408\u9884\u671f\uff09\n\n\u4e0d\u53ef\u91cd\u8bd5\u9519\u8bef\uff1a\n- AuthenticationError\uff08API\u5bc6\u94a5\u9519\u8bef\uff09\n- InvalidConfigError\uff08\u914d\u7f6e\u9519\u8bef\uff09\n- SystemError\uff08\u7cfb\u7edf\u9519\u8bef\uff09\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\">3.3 \u5185\u5bb9\u9a8c\u8bc1\u673a\u5236<\/h4>\n\n\n\n<p><strong>\u9a8c\u8bc1\u5c42\u7ea7\uff1a<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n1. \u57fa\u7840\u9a8c\u8bc1\uff08\u5feb\u901f\uff09\n   - \u975e\u7a7a\u68c0\u67e5\n   - \u6700\u5c0f\u957f\u5ea6\u68c0\u67e5\n   - \u683c\u5f0f\u68c0\u67e5\uff08\u662f\u5426\u4e3aMarkdown\uff09\n\n2. \u7ed3\u6784\u9a8c\u8bc1\uff08\u4e2d\u901f\uff09\n   - \u6807\u9898\u5c42\u7ea7\u662f\u5426\u6b63\u786e\n   - \u662f\u5426\u5305\u542b\u5fc5\u9700\u7684\u4ee3\u7801\u5757\n   - \u56fe\u7247\u94fe\u63a5\u662f\u5426\u6709\u6548\n\n3. \u8d28\u91cf\u9a8c\u8bc1\uff08\u6162\u901f\uff0c\u53ef\u9009\uff09\n   - \u5185\u5bb9\u76f8\u5173\u6027\uff08\u4f7f\u7528Embedding\uff09\n   - \u672f\u8bed\u4e00\u81f4\u6027\n   - \u903b\u8f91\u8fde\u8d2f\u6027\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\">3.4 \u63d0\u793a\u8bcd\u6a21\u677f\u7cfb\u7edf<\/h4>\n\n\n\n<p><strong>\u76ee\u5f55\u7ed3\u6784\uff1a<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nprompts\/\n\u251c\u2500\u2500 system\/                    # \u7cfb\u7edf\u63d0\u793a\u8bcd\n\u2502   \u251c\u2500\u2500 tutorial_writer.jinja2\n\u2502   \u251c\u2500\u2500 code_expert.jinja2\n\u2502   \u2514\u2500\u2500 image_designer.jinja2\n\u251c\u2500\u2500 user\/                      # \u7528\u6237\u63d0\u793a\u8bcd\n\u2502   \u251c\u2500\u2500 chapter_text.jinja2\n\u2502   \u251c\u2500\u2500 chapter_code.jinja2\n\u2502   \u2514\u2500\u2500 chapter_image.jinja2\n\u2514\u2500\u2500 includes\/                  # \u53ef\u590d\u7528\u7247\u6bb5\n    \u251c\u2500\u2500 terminology.jinja2\n    \u251c\u2500\u2500 style_guide.jinja2\n    \u2514\u2500\u2500 reference_docs.jinja2\n<\/pre><\/div>\n\n\n<p><strong>\u6a21\u677f\u53d8\u91cf\u8bbe\u8ba1\uff1a<\/strong><\/p>\n\n\n\n<p>jinja2<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n{# \u5168\u5c40\u53d8\u91cf #}\n{{ tutorial_theme }}          # \u6559\u7a0b\u4e3b\u9898\n{{ target_audience }}         # \u76ee\u6807\u8bfb\u8005\n{{ difficulty_level }}        # \u96be\u5ea6\u7b49\u7ea7\n\n{# \u4e0a\u4e0b\u6587\u53d8\u91cf #}\n{{ previous_chapters }}       # \u524d\u6587\u7ae0\u8282\u6458\u8981\n{{ terminology }}             # \u672f\u8bed\u8868\n{{ code_dependencies }}       # \u4ee3\u7801\u4f9d\u8d56\u5173\u7cfb\n\n{# \u7ae0\u8282\u53d8\u91cf #}\n{{ chapter.title }}\n{{ chapter.level }}\n{{ chapter.core_content }}\n{{ chapter.key_points }}\n\n{# \u53c2\u8003\u8d44\u6599 #}\n{{ reference_docs }}          # \u53c2\u8003\u6587\u6863\u5217\u8868\n{{ style_guide }}             # \u5199\u4f5c\u89c4\u8303\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">\u56db\u3001Pipeline\u8bbe\u8ba1\u6a21\u5f0f<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">4.1 Pipeline\u57fa\u7c7b\u63a5\u53e3<\/h4>\n\n\n\n<p>python<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nclass BasePipeline(ABC):\n    &quot;&quot;&quot;\u6240\u6709Pipeline\u5fc5\u987b\u5b9e\u73b0\u7684\u63a5\u53e3&quot;&quot;&quot;\n    \n    @abstractmethod\n    async def execute(self, task_config: Dict) -&gt; Dict:\n        &quot;&quot;&quot;\u6267\u884cPipeline\uff0c\u8fd4\u56de\u751f\u6210\u7ed3\u679c&quot;&quot;&quot;\n        pass\n    \n    @abstractmethod\n    def get_metadata(self) -&gt; Dict:\n        &quot;&quot;&quot;\u8fd4\u56dePipeline\u5143\u6570\u636e\uff08\u7528\u4e8e\u524d\u7aef\u5c55\u793a\uff09&quot;&quot;&quot;\n        pass\n    \n    @abstractmethod\n    def validate_config(self, config: Dict) -&gt; bool:\n        &quot;&quot;&quot;\u9a8c\u8bc1\u914d\u7f6e\u662f\u5426\u7b26\u5408\u6b64Pipeline\u7684\u8981\u6c42&quot;&quot;&quot;\n        pass\n    \n    def pre_process(self, config: Dict) -&gt; Dict:\n        &quot;&quot;&quot;\u9884\u5904\u7406\uff1a\u6784\u5efa\u4efb\u52a1DAG&quot;&quot;&quot;\n        pass\n    \n    def post_process(self, results: Dict) -&gt; Dict:\n        &quot;&quot;&quot;\u540e\u5904\u7406\uff1a\u6574\u5408\u7ed3\u679c\u3001\u751f\u6210\u76ee\u5f55&quot;&quot;&quot;\n        pass\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\">4.2 Pipeline\u7c7b\u578b\u8bbe\u8ba1<\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\">Pipeline\u540d\u79f0\u9002\u7528\u573a\u666f\u7279\u70b9\u5e76\u884c\u7b56\u7565SimplePipeline\u7eaf\u6587\u672c\u6559\u7a0b\u53ea\u751f\u6210\u6587\u672c\uff0c\u65e0\u56fe\u7247\u7ae0\u8282\u95f4\u5b8c\u5168\u5e76\u884cStandardPipeline\u6807\u51c6\u6559\u7a0b\u6587\u672c+\u5c11\u91cf\u56fe\u7247\u6587\u672c\u548c\u56fe\u7247\u5e76\u884cRichPipeline\u5bcc\u5a92\u4f53\u6559\u7a0b\u6587\u672c+\u5927\u91cf\u56fe\u7247+\u4ee3\u7801\u6309\u7ae0\u8282\u5206\u6279\uff0c\u6279\u5185\u5e76\u884cAPIPipelineAPI\u6587\u6863\u7ed3\u6784\u5316\u5f3a\uff0c\u6a21\u677f\u9a71\u52a8\u6309\u63a5\u53e3\u5e76\u884c\u751f\u6210<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">4.3 Pipeline\u53c2\u6570\u5316<\/h4>\n\n\n\n<p>python<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\npipeline_params = {\n    &quot;concurrency&quot;: {\n        &quot;max_concurrent_chapters&quot;: 5,    # \u6700\u591a\u540c\u65f6\u751f\u62105\u4e2a\u7ae0\u8282\n        &quot;max_concurrent_images&quot;: 10,     # \u6700\u591a\u540c\u65f6\u751f\u621010\u5f20\u56fe\u7247\n    },\n    &quot;retry&quot;: {\n        &quot;max_retries&quot;: 3,\n        &quot;retry_delay&quot;: 2.0,\n    },\n    &quot;validation&quot;: {\n        &quot;enable_quality_check&quot;: True,\n        &quot;min_word_count&quot;: 800,\n    },\n    &quot;llm&quot;: {\n        &quot;text_model&quot;: &quot;claude-sonnet-4-5&quot;,\n        &quot;image_model&quot;: &quot;dall-e-3&quot;,\n        &quot;temperature&quot;: 0.7,\n    }\n}\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">\u4e94\u3001\u524d\u7aef\u4ea4\u4e92\u8bbe\u8ba1<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">5.1 \u9875\u9762\u6d41\u8f6c<\/h4>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n1. \u4efb\u52a1\u521b\u5efa\u9875 (\/)\n   - \u8f93\u5165\u57fa\u672c\u4fe1\u606f\n   - \u914d\u7f6e\u7ae0\u8282\u5217\u8868\n   - \u914d\u7f6e\u63d0\u793a\u8bcd\u6a21\u677f\n   - \u9009\u62e9Pipeline\n   \u2193\n2. \u6267\u884c\u76d1\u63a7\u9875 (\/tasks\/{id}\/monitor)\n   - \u5b9e\u65f6\u663e\u793a\u8fdb\u5ea6\u6761\n   - \u663e\u793a\u5404\u7ae0\u8282\u72b6\u6001\n   - \u663e\u793a\u9519\u8bef\u4fe1\u606f\n   - \u652f\u6301\u6682\u505c\/\u7ee7\u7eed\n   \u2193\n3. \u9884\u89c8\u9875 (\/tasks\/{id}\/preview)\n   - \u7ae0\u8282\u5217\u8868\uff08\u6811\u5f62\u7ed3\u6784\uff09\n   - Markdown\u9884\u89c8\uff08\u53ef\u7f16\u8f91\uff09\n   - \u4e0b\u8f7d\u6309\u94ae\n   \u2193\n4. \u53d1\u5e03\u9875 (\/tasks\/{id}\/publish)\n   - \u914d\u7f6eGitHub\u4ed3\u5e93\n   - \u9009\u62e9\u63d0\u4ea4\u65b9\u5f0f\uff08PR\/Push\uff09\n   - \u786e\u8ba4\u53d1\u5e03\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\">5.2 WebSocket\u5b9e\u65f6\u901a\u4fe1<\/h4>\n\n\n\n<p><strong>\u6d88\u606f\u683c\u5f0f\uff1a<\/strong><\/p>\n\n\n\n<p>json<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n{\n  &quot;type&quot;: &quot;progress_update&quot;,\n  &quot;task_id&quot;: &quot;task_123&quot;,\n  &quot;data&quot;: {\n    &quot;total&quot;: 100,\n    &quot;completed&quot;: 45,\n    &quot;failed&quot;: 2,\n    &quot;current&quot;: &quot;chapter_05_text&quot;,\n    &quot;status&quot;: &quot;running&quot;\n  }\n}\n\n{\n  &quot;type&quot;: &quot;task_complete&quot;,\n  &quot;task_id&quot;: &quot;task_123&quot;,\n  &quot;data&quot;: {\n    &quot;status&quot;: &quot;success&quot;,\n    &quot;output_path&quot;: &quot;\/output\/task_123&quot;,\n    &quot;stats&quot;: {...}\n  }\n}\n\n{\n  &quot;type&quot;: &quot;error&quot;,\n  &quot;task_id&quot;: &quot;task_123&quot;,\n  &quot;data&quot;: {\n    &quot;chapter_id&quot;: &quot;chapter_03&quot;,\n    &quot;error_message&quot;: &quot;Rate limit exceeded&quot;,\n    &quot;retry_count&quot;: 2\n  }\n}\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">\u516d\u3001\u6570\u636e\u5e93\u8bbe\u8ba1<\/h3>\n\n\n\n<p>sql<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n-- \u4efb\u52a1\u8868\nCREATE TABLE tasks (\n    id VARCHAR(50) PRIMARY KEY,\n    name VARCHAR(200),\n    config TEXT,              -- JSON\u683c\u5f0f\u7684\u5b8c\u6574\u914d\u7f6e\n    pipeline VARCHAR(50),\n    status VARCHAR(20),       -- draft, running, completed, failed, published\n    progress INT DEFAULT 0,   -- 0-100\n    output_path VARCHAR(500),\n    error_message TEXT,\n    created_at TIMESTAMP,\n    updated_at TIMESTAMP,\n    completed_at TIMESTAMP\n);\n\n-- \u7ae0\u8282\u7ed3\u679c\u8868\nCREATE TABLE chapter_results (\n    id INTEGER PRIMARY KEY AUTOINCREMENT,\n    task_id VARCHAR(50),\n    chapter_id VARCHAR(100),\n    status VARCHAR(20),       -- pending, running, success, failed\n    content TEXT,             -- \u751f\u6210\u7684Markdown\u5185\u5bb9\n    error_message TEXT,\n    retries INT DEFAULT 0,\n    duration FLOAT,           -- \u751f\u6210\u8017\u65f6\uff08\u79d2\uff09\n    created_at TIMESTAMP,\n    FOREIGN KEY (task_id) REFERENCES tasks(id)\n);\n\n-- \u6267\u884c\u65e5\u5fd7\u8868\nCREATE TABLE execution_logs (\n    id INTEGER PRIMARY KEY AUTOINCREMENT,\n    task_id VARCHAR(50),\n    level VARCHAR(10),        -- info, warning, error\n    message TEXT,\n    timestamp TIMESTAMP,\n    FOREIGN KEY (task_id) REFERENCES tasks(id)\n);\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">\u4e03\u3001\u6587\u4ef6\u7ec4\u7ec7\u7ed3\u6784<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ntutorial-generator\/\n\u251c\u2500\u2500 app\/\n\u2502   \u251c\u2500\u2500 main.py                    # FastAPI\u5e94\u7528\u5165\u53e3\n\u2502   \u251c\u2500\u2500 config.py                  # \u914d\u7f6e\u7ba1\u7406\n\u2502   \u251c\u2500\u2500 database.py                # \u6570\u636e\u5e93\u8fde\u63a5\n\u2502   \u2514\u2500\u2500 websocket.py               # WebSocket\u7ba1\u7406\n\u2502\n\u251c\u2500\u2500 core\/\n\u2502   \u251c\u2500\u2500 llm\/\n\u2502   \u2502   \u251c\u2500\u2500 base_client.py         # \u57fa\u7840\u5ba2\u6237\u7aef\uff08\u91cd\u8bd5\u3001\u8d85\u65f6\uff09\n\u2502   \u2502   \u251c\u2500\u2500 claude_client.py\n\u2502   \u2502   \u251c\u2500\u2500 openai_client.py\n\u2502   \u2502   \u2514\u2500\u2500 rate_limiter.py        # \u901f\u7387\u9650\u5236\u5668\n\u2502   \u2502\n\u2502   \u251c\u2500\u2500 templates\/\n\u2502   \u2502   \u2514\u2500\u2500 prompt_engine.py       # Jinja2\u6a21\u677f\u5f15\u64ce\n\u2502   \u2502\n\u2502   \u251c\u2500\u2500 generators\/\n\u2502   \u2502   \u251c\u2500\u2500 text_generator.py      # \u6587\u672c\u751f\u6210\uff08\u539f\u5b50\u80fd\u529b\uff09\n\u2502   \u2502   \u251c\u2500\u2500 image_generator.py     # \u56fe\u7247\u751f\u6210\uff08\u539f\u5b50\u80fd\u529b\uff09\n\u2502   \u2502   \u2514\u2500\u2500 formatter.py           # Markdown\u683c\u5f0f\u5316\n\u2502   \u2502\n\u2502   \u251c\u2500\u2500 executor\/\n\u2502   \u2502   \u251c\u2500\u2500 parallel_executor.py   # \u5e76\u884c\u6267\u884c\u5f15\u64ce\n\u2502   \u2502   \u251c\u2500\u2500 task_queue.py          # \u4efb\u52a1\u961f\u5217\u7ba1\u7406\n\u2502   \u2502   \u2514\u2500\u2500 progress_tracker.py    # \u8fdb\u5ea6\u8ffd\u8e2a\n\u2502   \u2502\n\u2502   \u251c\u2500\u2500 validators\/\n\u2502   \u2502   \u251c\u2500\u2500 content_validator.py   # \u5185\u5bb9\u9a8c\u8bc1\n\u2502   \u2502   \u2514\u2500\u2500 config_validator.py    # \u914d\u7f6e\u9a8c\u8bc1\n\u2502   \u2502\n\u2502   \u2514\u2500\u2500 handlers\/\n\u2502       \u251c\u2500\u2500 retry_handler.py       # \u91cd\u8bd5\u5904\u7406\n\u2502       \u2514\u2500\u2500 error_handler.py       # \u9519\u8bef\u5904\u7406\n\u2502\n\u251c\u2500\u2500 pipelines\/\n\u2502   \u251c\u2500\u2500 base.py                    # Pipeline\u57fa\u7c7b\n\u2502   \u251c\u2500\u2500 registry.py                # Pipeline\u6ce8\u518c\u5668\n\u2502   \u251c\u2500\u2500 simple_pipeline.py\n\u2502   \u251c\u2500\u2500 standard_pipeline.py\n\u2502   \u2514\u2500\u2500 rich_pipeline.py\n\u2502\n\u251c\u2500\u2500 api\/\n\u2502   \u251c\u2500\u2500 tasks.py                   # \u4efb\u52a1CRUD API\n\u2502   \u251c\u2500\u2500 execution.py               # \u6267\u884c\u63a7\u5236API\n\u2502   \u251c\u2500\u2500 preview.py                 # \u9884\u89c8API\n\u2502   \u2514\u2500\u2500 publish.py                 # \u53d1\u5e03API\n\u2502\n\u251c\u2500\u2500 models\/                        # SQLAlchemy\u6a21\u578b\n\u2502   \u251c\u2500\u2500 task.py\n\u2502   \u251c\u2500\u2500 chapter_result.py\n\u2502   \u2514\u2500\u2500 execution_log.py\n\u2502\n\u251c\u2500\u2500 schemas\/                       # Pydantic Schema\n\u2502   \u251c\u2500\u2500 task_schema.py\n\u2502   \u251c\u2500\u2500 chapter_schema.py\n\u2502   \u2514\u2500\u2500 pipeline_schema.py\n\u2502\n\u251c\u2500\u2500 templates\/                     # Jinja2 HTML\u6a21\u677f\n\u2502   \u251c\u2500\u2500 base.html\n\u2502   \u251c\u2500\u2500 task_create.html\n\u2502   \u251c\u2500\u2500 task_monitor.html\n\u2502   \u251c\u2500\u2500 preview.html\n\u2502   \u2514\u2500\u2500 publish.html\n\u2502\n\u251c\u2500\u2500 prompts\/                       # LLM\u63d0\u793a\u8bcd\u6a21\u677f\n\u2502   \u251c\u2500\u2500 system\/\n\u2502   \u251c\u2500\u2500 user\/\n\u2502   \u2514\u2500\u2500 includes\/\n\u2502\n\u251c\u2500\u2500 static\/\n\u2502   \u251c\u2500\u2500 css\/\n\u2502   \u2502   \u2514\u2500\u2500 main.css\n\u2502   \u2514\u2500\u2500 js\/\n\u2502       \u251c\u2500\u2500 alpine-components.js   # Alpine.js\u7ec4\u4ef6\n\u2502       \u2514\u2500\u2500 websocket-client.js    # WebSocket\u5ba2\u6237\u7aef\n\u2502\n\u251c\u2500\u2500 output\/                        # \u751f\u6210\u6587\u4ef6\u8f93\u51fa\n\u2502   \u2514\u2500\u2500 tasks\/\n\u2502\n\u251c\u2500\u2500 tests\/\n\u2502   \u251c\u2500\u2500 test_executor\/\n\u2502   \u251c\u2500\u2500 test_pipelines\/\n\u2502   \u2514\u2500\u2500 test_validators\/\n\u2502\n\u251c\u2500\u2500 requirements.txt\n\u251c\u2500\u2500 .env.example\n\u2514\u2500\u2500 README.md\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">\u516b\u3001\u6280\u672f\u6808\u603b\u7ed3<\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\">\u5c42\u7ea7\u6280\u672f\u9009\u578b\u7406\u7531Web\u6846\u67b6FastAPI\u5f02\u6b65\u652f\u6301\u3001\u7c7b\u578b\u5b89\u5168\u3001\u81ea\u52a8\u6587\u6863\u6a21\u677f\u5f15\u64ceJinja2\u5f3a\u5927\u3001\u7075\u6d3b\u3001\u4e0eFastAPI\u96c6\u6210\u597d\u524d\u7aef\u6846\u67b6Alpine.js\u8f7b\u91cf\u3001\u6613\u5b66\u3001\u9002\u5408\u6e10\u8fdb\u589e\u5f3a\u6570\u636e\u5e93SQLite \u2192 PostgreSQL\u5f00\u53d1\u7528SQLite\uff0c\u751f\u4ea7\u7528PGORMSQLAlchemy\u6210\u719f\u3001\u529f\u80fd\u5168\u9762\u5f02\u6b65\u5e93asyncio + aiohttpPython\u539f\u751f\u3001\u6027\u80fd\u597dLLM SDKanthropic + openai\u5b98\u65b9SDK\u91cd\u8bd5\u5e93tenacity\u7075\u6d3b\u7684\u91cd\u8bd5\u7b56\u7565\u63d0\u793a\u8bcd\u6a21\u677fJinja2\u590d\u7528HTML\u6a21\u677f\u5f15\u64ce\u8fdb\u5ea6\u901a\u4fe1WebSocket\u5b9e\u65f6\u53cc\u5411\u901a\u4fe1\u4efb\u52a1\u961f\u5217\uff08\u53ef\u9009\uff09Celery + Redis\u5982\u9700\u5206\u5e03\u5f0f<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u6574\u4f53\u67b6\u6784\u8bbe\u8ba1 \u67b6\u6784\u8bbe\u8ba1\u65b9\u6848 \u4e00\u3001\u7cfb\u7edf\u67b6\u6784\u56fe \u4e8c\u3001\u6570\u636e\u6d41\u8bbe\u8ba1 2.1 \u4efb\u52a1\u521b\u5efa\u6d41\u7a0b 2.2 \u4efb\u52a1\u6267\u884c\u6d41\u7a0b 2.3 \u9884\u89c8\u548c\u53d1\u5e03\u6d41\u7a0b \u4e09\u3001\u5173\u952e\u6a21\u5757\u8bbe\u8ba1 3.1 \u5e76\u884c\u6267&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[10],"tags":[18,15,42],"table_tags":[],"class_list":["post-1663","post","type-post","status-publish","format-standard","hentry","category-program","tag-18","tag-15","tag-42"],"_links":{"self":[{"href":"https:\/\/www.loganblog.com\/index.php\/wp-json\/wp\/v2\/posts\/1663","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.loganblog.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.loganblog.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.loganblog.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.loganblog.com\/index.php\/wp-json\/wp\/v2\/comments?post=1663"}],"version-history":[{"count":4,"href":"https:\/\/www.loganblog.com\/index.php\/wp-json\/wp\/v2\/posts\/1663\/revisions"}],"predecessor-version":[{"id":1667,"href":"https:\/\/www.loganblog.com\/index.php\/wp-json\/wp\/v2\/posts\/1663\/revisions\/1667"}],"wp:attachment":[{"href":"https:\/\/www.loganblog.com\/index.php\/wp-json\/wp\/v2\/media?parent=1663"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.loganblog.com\/index.php\/wp-json\/wp\/v2\/categories?post=1663"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.loganblog.com\/index.php\/wp-json\/wp\/v2\/tags?post=1663"},{"taxonomy":"table_tags","embeddable":true,"href":"https:\/\/www.loganblog.com\/index.php\/wp-json\/wp\/v2\/table_tags?post=1663"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}