Files
liqiang b119135836
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
ai-agent-book 精选快照(<2MB 代码与文档,来自 github.com/bojieli/ai-agent-book)
2026-08-20 13:12:50 +00:00

65 lines
12 KiB
XML

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 40 880 570" width="880" height="570" 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="30" y="60" width="280" height="55" rx="6" fill="#d0d0d0" stroke="#333333" stroke-width="2"/>
<text x="170" y="80" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="16" fill="#333333" text-anchor="middle" dominant-baseline="central" font-weight="bold">使用者需求</text>
<text x="170" y="98" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="14" fill="#666666" text-anchor="middle" dominant-baseline="central" font-weight="normal">&quot;建立一個電商退款客服 Agent&quot;</text>
<line x1="170" y1="115" x2="170" y2="145" stroke="#333333" stroke-width="2" marker-end="url(#ah)"/>
<rect x="20" y="145" width="840" height="230" rx="6" fill="#ffffff" stroke="#333333" stroke-width="2" stroke-dasharray="8,4"/>
<text x="440" y="168" 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">Meta-Agent (Coding Agent)</text>
<rect x="35" y="185" width="190" height="170" rx="6" fill="#f0f0f0" stroke="#333333" stroke-width="2"/>
<text x="130" y="205" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="16" fill="#333333" text-anchor="middle" dominant-baseline="central" font-weight="bold">① 閱讀參考程式碼</text>
<text x="45" y="228" font-family="'Courier New', Courier, monospace" font-size="12" fill="#333333" text-anchor="start" dominant-baseline="central">read_file:</text>
<text x="45" y="248" font-family="'Courier New', Courier, monospace" font-size="12" fill="#333333" text-anchor="start" dominant-baseline="central"> agent.py</text>
<text x="45" y="268" font-family="'Courier New', Courier, monospace" font-size="12" fill="#333333" text-anchor="start" dominant-baseline="central"> tools/*.py</text>
<text x="45" y="288" font-family="'Courier New', Courier, monospace" font-size="12" fill="#333333" text-anchor="start" dominant-baseline="central"> system_prompt.md</text>
<text x="45" y="308" font-family="'Courier New', Courier, monospace" font-size="12" fill="#333333" text-anchor="start" dominant-baseline="central"> config.yaml</text>
<text x="45" y="332" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="12" fill="#666666" text-anchor="start" dominant-baseline="central" font-weight="normal">→ 理解架構模式</text>
<line x1="225" y1="270" x2="248" y2="270" stroke="#333333" stroke-width="2" marker-end="url(#ah)"/>
<rect x="248" y="185" width="190" height="170" rx="6" fill="#f0f0f0" stroke="#333333" stroke-width="2"/>
<text x="343" y="205" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="16" fill="#333333" text-anchor="middle" dominant-baseline="central" font-weight="bold">② 複製腳手架</text>
<text x="258" y="228" font-family="'Courier New', Courier, monospace" font-size="12" fill="#333333" text-anchor="start" dominant-baseline="central">cp -r reference/</text>
<text x="258" y="248" font-family="'Courier New', Courier, monospace" font-size="12" fill="#333333" text-anchor="start" dominant-baseline="central"> → new_agent/</text>
<text x="258" y="278" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="12" fill="#666666" text-anchor="start" dominant-baseline="central" font-weight="normal">保留:</text>
<text x="258" y="298" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="12" fill="#666666" text-anchor="start" dominant-baseline="central" font-weight="normal"> Agent 迴圈框架</text>
<text x="258" y="318" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="12" fill="#666666" text-anchor="start" dominant-baseline="central" font-weight="normal"> 訊息格式 / KV 最佳化</text>
<line x1="438" y1="270" x2="461" y2="270" stroke="#333333" stroke-width="2" marker-end="url(#ah)"/>
<rect x="461" y="185" width="190" height="170" rx="6" fill="#d0d0d0" stroke="#333333" stroke-width="2"/>
<text x="556" y="205" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="16" fill="#333333" text-anchor="middle" dominant-baseline="central" font-weight="bold">③ 定向修改</text>
<text x="471" y="228" font-family="'Courier New', Courier, monospace" font-size="12" fill="#333333" text-anchor="start" dominant-baseline="central">edit_file:</text>
<text x="471" y="248" font-family="'Courier New', Courier, monospace" font-size="12" fill="#333333" text-anchor="start" dominant-baseline="central"> system_prompt.md</text>
<text x="471" y="268" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="12" fill="#666666" text-anchor="start" dominant-baseline="central" font-weight="normal"> → 電商退款規則</text>
<text x="471" y="290" font-family="'Courier New', Courier, monospace" font-size="12" fill="#333333" text-anchor="start" dominant-baseline="central"> tools/refund.py</text>
<text x="471" y="310" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="12" fill="#666666" text-anchor="start" dominant-baseline="central" font-weight="normal"> → 新增退款工具</text>
<text x="471" y="332" font-family="'Courier New', Courier, monospace" font-size="12" fill="#333333" text-anchor="start" dominant-baseline="central"> config.yaml</text>
<line x1="651" y1="270" x2="674" y2="270" stroke="#333333" stroke-width="2" marker-end="url(#ah)"/>
<rect x="674" y="185" width="175" height="170" rx="6" fill="#f0f0f0" stroke="#333333" stroke-width="2"/>
<text x="761" y="205" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="16" fill="#333333" text-anchor="middle" dominant-baseline="central" font-weight="bold">④ 驗證測試</text>
<text x="684" y="228" font-family="'Courier New', Courier, monospace" font-size="12" fill="#333333" text-anchor="start" dominant-baseline="central">bash:</text>
<text x="684" y="248" font-family="'Courier New', Courier, monospace" font-size="12" fill="#333333" text-anchor="start" dominant-baseline="central"> python agent.py</text>
<text x="684" y="270" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="12" fill="#666666" text-anchor="start" dominant-baseline="central" font-weight="normal"> → 啟動新 Agent</text>
<text x="684" y="290" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="12" fill="#666666" text-anchor="start" dominant-baseline="central" font-weight="normal"> → 傳送測試訊息</text>
<text x="684" y="310" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="12" fill="#666666" text-anchor="start" dominant-baseline="central" font-weight="normal"> → 檢查工具呼叫</text>
<text x="684" y="330" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="12" fill="#666666" text-anchor="start" dominant-baseline="central" font-weight="normal"> → 驗證對話流程</text>
<line x1="440.0" y1="375" x2="440.0" y2="410" stroke="#333333" stroke-width="2" marker-end="url(#ah)"/>
<rect x="115" y="410" width="700" height="90" rx="6" fill="#ffffff" stroke="#333333" stroke-width="2" stroke-dasharray="8,4"/>
<text x="465" y="432" 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">生成的新 Agent</text>
<rect x="135" y="448" width="170" height="42" rx="6" fill="#f0f0f0" stroke="#333333" stroke-width="2"/>
<text x="220" y="462" font-family="'Courier New', Courier, monospace" font-size="10" fill="#333333" text-anchor="middle" dominant-baseline="central">system_prompt.md</text>
<text x="220" y="480" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="14" fill="#666666" text-anchor="middle" dominant-baseline="central" font-weight="normal">電商退款規則</text>
<rect x="313" y="448" width="170" height="42" rx="6" fill="#f0f0f0" stroke="#333333" stroke-width="2"/>
<text x="398" y="462" font-family="'Courier New', Courier, monospace" font-size="10" fill="#333333" text-anchor="middle" dominant-baseline="central">tools/refund.py</text>
<text x="398" y="480" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="14" fill="#666666" text-anchor="middle" dominant-baseline="central" font-weight="normal">退款 / 查詢工具</text>
<rect x="491" y="448" width="170" height="42" rx="6" fill="#f0f0f0" stroke="#333333" stroke-width="2"/>
<text x="576" y="462" font-family="'Courier New', Courier, monospace" font-size="10" fill="#333333" text-anchor="middle" dominant-baseline="central">agent.py</text>
<text x="576" y="480" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="14" fill="#666666" text-anchor="middle" dominant-baseline="central" font-weight="normal">繼承框架程式碼</text>
<rect x="669" y="448" width="170" height="42" rx="6" fill="#f0f0f0" stroke="#333333" stroke-width="2"/>
<text x="754" y="462" font-family="'Courier New', Courier, monospace" font-size="10" fill="#333333" text-anchor="middle" dominant-baseline="central">config.yaml</text>
<text x="754" y="480" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="14" fill="#666666" text-anchor="middle" dominant-baseline="central" font-weight="normal">模型 / 引數配置</text>
<line x1="30" y1="515" x2="850" y2="515" stroke="#999999" stroke-width="2" stroke-dasharray="8,4"/>
<rect x="60" y="530" width="350" height="54" rx="6" fill="#f0f0f0" stroke="#333333" stroke-width="2"/>
<text x="235" y="549" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="16" fill="#333333" text-anchor="middle" dominant-baseline="central" font-weight="bold">從零生成:缺乏最佳實踐</text>
<text x="235" y="571" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="14" fill="#666666" text-anchor="middle" dominant-baseline="central" font-weight="normal">上下文管理隨意 · 工具設計不規範 · API 過時</text>
<rect x="470" y="530" width="350" height="54" rx="6" fill="#999999" stroke="#333333" stroke-width="2"/>
<text x="645" y="549" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="16" fill="#ffffff" text-anchor="middle" dominant-baseline="central" font-weight="bold">基於範例修改:繼承最佳實踐</text>
<text x="645" y="571" 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">標準訊息格式 · 規範工具設計 · 現代 API</text>
</svg>