ai-agent-book 精选快照(<2MB 代码与文档,来自 github.com/bojieli/ai-agent-book)
Build latest book artifacts / build (push) Canceled after 0s
dependency resolution / resolve (3.11) (push) Canceled after 0s
dependency resolution / resolve (3.13) (push) Canceled after 0s
deploy-pages / build (push) Canceled after 0s
deploy-pages / deploy (push) Canceled after 0s
i18n consistency check / check (push) Canceled after 0s
provider adoption tests / test (chapter2/context-compression) (push) Canceled after 0s
provider adoption tests / test (chapter2/prompt-injection) (push) Canceled after 0s
provider adoption tests / test (chapter2/system-hint) (push) Canceled after 0s
provider adoption tests / test (chapter3/log-sanitization) (push) Canceled after 0s
web-search-agent tests / test (push) Canceled after 0s
web-search-agent tests / agentbook (push) Canceled after 0s

This commit is contained in:
2026-08-20 13:12:50 +00:00
commit b119135836
10275 changed files with 3284984 additions and 0 deletions
+68
View File
@@ -0,0 +1,68 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 40 880 520" width="880" height="520" style="background:#ffffff">
<defs><marker id="ah" markerWidth="12" markerHeight="8" refX="12" refY="4" orient="auto"><polygon points="0 0, 12 4, 0 8" fill="#333333"/></marker><marker id="ah-light" markerWidth="12" markerHeight="8" refX="12" refY="4" orient="auto"><polygon points="0 0, 12 4, 0 8" fill="#999999"/></marker></defs>
<rect x="20" y="60" width="250" height="160" rx="6" fill="#ffffff" stroke="#333333" stroke-width="2" stroke-dasharray="8,4"/>
<text x="145" y="82" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="20" fill="#333333" text-anchor="middle" dominant-baseline="central" font-weight="bold">① 日誌採集</text>
<rect x="30" y="98" width="230" height="122" rx="3" fill="#f5f5f5" stroke="#999999" stroke-width="2"/>
<text x="38" y="112" font-family="'Courier New', Courier, monospace" font-size="9" fill="#333333" text-anchor="start" dominant-baseline="central">trajectory_001.json:</text>
<text x="38" y="126" font-family="'Courier New', Courier, monospace" font-size="9" fill="#333333" text-anchor="start" dominant-baseline="central"> {&quot;role&quot;:&quot;user&quot;,&quot;content&quot;:</text>
<text x="38" y="140" font-family="'Courier New', Courier, monospace" font-size="9" fill="#333333" text-anchor="start" dominant-baseline="central"> &quot;取消訂單 #12345&quot;}</text>
<text x="38" y="154" font-family="'Courier New', Courier, monospace" font-size="9" fill="#333333" text-anchor="start" dominant-baseline="central"> {&quot;role&quot;:&quot;assistant&quot;,</text>
<text x="38" y="168" font-family="'Courier New', Courier, monospace" font-size="9" fill="#333333" text-anchor="start" dominant-baseline="central"> &quot;tool_call&quot;:&quot;cancel_order&quot;}</text>
<text x="38" y="182" font-family="'Courier New', Courier, monospace" font-size="9" fill="#333333" text-anchor="start" dominant-baseline="central"> {&quot;role&quot;:&quot;tool&quot;,&quot;result&quot;:</text>
<text x="38" y="196" font-family="'Courier New', Courier, monospace" font-size="9" fill="#333333" text-anchor="start" dominant-baseline="central"> &quot;ERROR: no insurance&quot;}</text>
<text x="38" y="210" font-family="'Courier New', Courier, monospace" font-size="9" fill="#333333" text-anchor="start" dominant-baseline="central"> → Agent 未告知使用者原因</text>
<line x1="270" y1="140" x2="310" y2="140" stroke="#333333" stroke-width="2" marker-end="url(#ah)"/>
<rect x="310" y="60" width="260" height="160" rx="6" fill="#ffffff" stroke="#333333" stroke-width="2" stroke-dasharray="8,4"/>
<text x="440" y="82" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="20" fill="#333333" text-anchor="middle" dominant-baseline="central" font-weight="bold">② LLM 分析</text>
<text x="320" y="100" font-family="'Courier New', Courier, monospace" font-size="10" fill="#333333" text-anchor="start" dominant-baseline="central">輸入: 軌跡 + 架構文件 + PRD</text>
<text x="320" y="114" font-family="'Courier New', Courier, monospace" font-size="10" fill="#333333" text-anchor="start" dominant-baseline="central"></text>
<text x="320" y="128" font-family="'Courier New', Courier, monospace" font-size="10" fill="#333333" text-anchor="start" dominant-baseline="central">分析維度:</text>
<text x="320" y="142" font-family="'Courier New', Courier, monospace" font-size="10" fill="#333333" text-anchor="start" dominant-baseline="central"> - 執行流程是否符合預期</text>
<text x="320" y="156" font-family="'Courier New', Courier, monospace" font-size="10" fill="#333333" text-anchor="start" dominant-baseline="central"> - 工具呼叫是否正確</text>
<text x="320" y="170" font-family="'Courier New', Courier, monospace" font-size="10" fill="#333333" text-anchor="start" dominant-baseline="central"> - 錯誤處理是否得當</text>
<text x="320" y="184" font-family="'Courier New', Courier, monospace" font-size="10" fill="#333333" text-anchor="start" dominant-baseline="central"> - 使用者體驗是否滿意</text>
<text x="320" y="198" font-family="'Courier New', Courier, monospace" font-size="10" fill="#333333" text-anchor="start" dominant-baseline="central"></text>
<text x="320" y="212" font-family="'Courier New', Courier, monospace" font-size="10" fill="#333333" text-anchor="start" dominant-baseline="central">→ 定位偏差環節和模組</text>
<line x1="570" y1="140" x2="610" y2="140" stroke="#333333" stroke-width="2" marker-end="url(#ah)"/>
<rect x="610" y="60" width="250" height="160" rx="6" fill="#ffffff" stroke="#333333" stroke-width="2" stroke-dasharray="8,4"/>
<text x="735" y="82" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="20" fill="#333333" text-anchor="middle" dominant-baseline="central" font-weight="bold">③ 結構化報告</text>
<rect x="620" y="98" width="230" height="108" rx="3" fill="#f5f5f5" stroke="#999999" stroke-width="2"/>
<text x="628" y="112" font-family="'Courier New', Courier, monospace" font-size="9" fill="#333333" text-anchor="start" dominant-baseline="central">問題報告:</text>
<text x="628" y="126" font-family="'Courier New', Courier, monospace" font-size="9" fill="#333333" text-anchor="start" dominant-baseline="central"> 優先順序: P1 (使用者流失風險)</text>
<text x="628" y="140" font-family="'Courier New', Courier, monospace" font-size="9" fill="#333333" text-anchor="start" dominant-baseline="central"> 模組: cancellation_handler</text>
<text x="628" y="154" font-family="'Courier New', Courier, monospace" font-size="9" fill="#333333" text-anchor="start" dominant-baseline="central"> 描述: 取消失敗後未向</text>
<text x="628" y="168" font-family="'Courier New', Courier, monospace" font-size="9" fill="#333333" text-anchor="start" dominant-baseline="central"> 使用者解釋原因和替代方案</text>
<text x="628" y="182" font-family="'Courier New', Courier, monospace" font-size="9" fill="#333333" text-anchor="start" dominant-baseline="central"> 建議: 新增失敗原因說明</text>
<text x="628" y="196" font-family="'Courier New', Courier, monospace" font-size="9" fill="#333333" text-anchor="start" dominant-baseline="central"> 和購買保險的引導</text>
<line x1="440.0" y1="220" x2="440.0" y2="260" stroke="#333333" stroke-width="2" marker-end="url(#ah)"/>
<rect x="60" y="260" width="370" height="160" rx="6" fill="#ffffff" stroke="#333333" stroke-width="2" stroke-dasharray="8,4"/>
<text x="245" y="282" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="20" fill="#333333" text-anchor="middle" dominant-baseline="central" font-weight="bold">④ 迴歸測試用例生成</text>
<rect x="70" y="298" width="350" height="150" rx="3" fill="#f5f5f5" stroke="#999999" stroke-width="2"/>
<text x="78" y="312" font-family="'Courier New', Courier, monospace" font-size="10" fill="#333333" text-anchor="start" dominant-baseline="central">def test_cancel_no_insurance():</text>
<text x="78" y="326" font-family="'Courier New', Courier, monospace" font-size="10" fill="#333333" text-anchor="start" dominant-baseline="central"> &quot;&quot;&quot;軌跡 #001, 輪次 3-5&quot;&quot;&quot;</text>
<text x="78" y="340" font-family="'Courier New', Courier, monospace" font-size="10" fill="#333333" text-anchor="start" dominant-baseline="central"> # 重放: 使用者請求取消經濟艙</text>
<text x="78" y="354" font-family="'Courier New', Courier, monospace" font-size="10" fill="#333333" text-anchor="start" dominant-baseline="central"> resp = agent.run(</text>
<text x="78" y="368" font-family="'Courier New', Courier, monospace" font-size="10" fill="#333333" text-anchor="start" dominant-baseline="central"> &quot;取消訂單 #12345&quot;)</text>
<text x="78" y="382" font-family="'Courier New', Courier, monospace" font-size="10" fill="#333333" text-anchor="start" dominant-baseline="central"> # 驗證: 應解釋原因</text>
<text x="78" y="396" font-family="'Courier New', Courier, monospace" font-size="10" fill="#333333" text-anchor="start" dominant-baseline="central"> assert &quot;保險&quot; in resp.text</text>
<text x="78" y="410" font-family="'Courier New', Courier, monospace" font-size="10" fill="#333333" text-anchor="start" dominant-baseline="central"> assert &quot;替代方案&quot; in resp.text</text>
<text x="78" y="424" font-family="'Courier New', Courier, monospace" font-size="10" fill="#333333" text-anchor="start" dominant-baseline="central"> # 驗證: 不應直接報錯</text>
<text x="78" y="438" font-family="'Courier New', Courier, monospace" font-size="10" fill="#333333" text-anchor="start" dominant-baseline="central"> assert &quot;ERROR&quot; not in resp.text</text>
<line x1="430" y1="340" x2="470" y2="340" stroke="#333333" stroke-width="2" marker-end="url(#ah)"/>
<rect x="470" y="260" width="380" height="160" rx="6" fill="#ffffff" stroke="#333333" stroke-width="2" stroke-dasharray="8,4"/>
<text x="660" y="282" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="20" fill="#333333" text-anchor="middle" dominant-baseline="central" font-weight="bold">⑤ GitHub Issue 自動建立</text>
<rect x="480" y="298" width="360" height="136" rx="3" fill="#f5f5f5" stroke="#999999" stroke-width="2"/>
<text x="488" y="312" font-family="'Courier New', Courier, monospace" font-size="10" fill="#333333" text-anchor="start" dominant-baseline="central">gh issue create \</text>
<text x="488" y="326" font-family="'Courier New', Courier, monospace" font-size="10" fill="#333333" text-anchor="start" dominant-baseline="central"> --title &quot;P1: 取消失敗缺少</text>
<text x="488" y="340" font-family="'Courier New', Courier, monospace" font-size="10" fill="#333333" text-anchor="start" dominant-baseline="central"> 使用者引導&quot; \</text>
<text x="488" y="354" font-family="'Courier New', Courier, monospace" font-size="10" fill="#333333" text-anchor="start" dominant-baseline="central"> --body &quot;**問題**: Agent 在</text>
<text x="488" y="368" font-family="'Courier New', Courier, monospace" font-size="10" fill="#333333" text-anchor="start" dominant-baseline="central"> cancel_order 失敗後直接</text>
<text x="488" y="382" font-family="'Courier New', Courier, monospace" font-size="10" fill="#333333" text-anchor="start" dominant-baseline="central"> 返回錯誤,未解釋原因...</text>
<text x="488" y="396" font-family="'Courier New', Courier, monospace" font-size="10" fill="#333333" text-anchor="start" dominant-baseline="central"> **軌跡**: #001 輪次 3-5</text>
<text x="488" y="410" font-family="'Courier New', Courier, monospace" font-size="10" fill="#333333" text-anchor="start" dominant-baseline="central"> **測試**: test_cancel_...&quot; \</text>
<text x="488" y="424" font-family="'Courier New', Courier, monospace" font-size="10" fill="#333333" text-anchor="start" dominant-baseline="central"> --assignee @backend-team</text>
<rect x="100" y="445" width="680" height="44" rx="6" fill="#999999" stroke="#333333" stroke-width="2"/>
<text x="440.0" y="460" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="20" fill="#ffffff" text-anchor="middle" dominant-baseline="central" font-weight="bold">端到端自動化:日誌 → 分析 → 報告 → 測試 → Issue</text>
<text x="440.0" y="480" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="14" fill="#ffffff" text-anchor="middle" dominant-baseline="central" font-weight="normal">透過 MCP 對接 GitHub · 測試框架自動重放驗證</text>
<text x="440.0" y="530" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="16" fill="#666666" text-anchor="middle" dominant-baseline="central" font-weight="bold">將人工診斷成本從小時級降低到分鐘級</text>
</svg>

After

Width:  |  Height:  |  Size: 12 KiB