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
+76
View File
@@ -0,0 +1,76 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 40 900 660" width="900" height="660" 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="10.0" y="55" width="168" height="38" rx="6" fill="#999999" stroke="#333333" stroke-width="2" />
<text x="94.0" y="74" 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="bold">Diff + Apply Model</text>
<rect x="10.0" y="101" width="168" height="116" rx="3" fill="#f5f5f5" stroke="#999999" stroke-width="2" />
<text x="16.0" y="123.36" font-family="'Courier New', Courier, monospace" font-size="11" fill="#333333" text-anchor="start" dominant-baseline="central">LLM Đầu ra diff Mô tả:</text>
<text x="16.0" y="135.24" font-family="'Courier New', Courier, monospace" font-size="11" fill="#333333" text-anchor="start" dominant-baseline="central">- def foo(x):</text>
<text x="16.0" y="147.12" font-family="'Courier New', Courier, monospace" font-size="11" fill="#333333" text-anchor="start" dominant-baseline="central">- return x</text>
<text x="16.0" y="159" font-family="'Courier New', Courier, monospace" font-size="11" fill="#333333" text-anchor="start" dominant-baseline="central">+ def foo(x, y=0):</text>
<text x="16.0" y="170.88" font-family="'Courier New', Courier, monospace" font-size="11" fill="#333333" text-anchor="start" dominant-baseline="central">+ return x + y</text>
<text x="16.0" y="0" font-family="'Courier New', Courier, monospace" font-size="11" fill="#333333" text-anchor="start" dominant-baseline="central"><tspan x="16" dy="182.76">→ Định vị và áp dụng các</tspan><tspan x="16" dy="11.88">mô hình nhỏ</tspan></text>
<rect x="14.0" y="229" width="160" height="56" rx="3" fill="#ffffff" stroke="#999999" stroke-width="2" />
<text x="94.0" y="0" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="10" fill="#333333" text-anchor="middle" dominant-baseline="central" font-weight="normal"><tspan x="94" dy="235.4">Ưu điểm: tách biệt</tspan><tspan x="94" dy="10.8">mối quan tâm</tspan></text>
<text x="94.0" y="0" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="10" fill="#666666" text-anchor="middle" dominant-baseline="central" font-weight="normal"><tspan x="94" dy="257">Nhược điểm: Những</tspan><tspan x="94" dy="10.8">sai lệch nhỏ có thể</tspan><tspan x="94" dy="10.8">gây ra sai lệch</tspan></text>
<rect x="188.0" y="55" width="168" height="38" rx="6" fill="#d0d0d0" stroke="#333333" stroke-width="2" />
<text x="272.0" y="0" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="12.96" fill="#333333" text-anchor="middle" dominant-baseline="central" font-weight="bold"><tspan x="272" dy="67">Old String → New</tspan><tspan x="272" dy="14">String</tspan></text>
<rect x="188.0" y="101" width="168" height="99" rx="3" fill="#f5f5f5" stroke="#999999" stroke-width="2" />
<text x="194.0" y="120.8" font-family="'Courier New', Courier, monospace" font-size="11" fill="#333333" text-anchor="start" dominant-baseline="central">old: "def foo(x):\n</text>
<text x="194.0" y="132.68" font-family="'Courier New', Courier, monospace" font-size="11" fill="#333333" text-anchor="start" dominant-baseline="central">return x"</text>
<text x="194.0" y="144.56" font-family="'Courier New', Courier, monospace" font-size="11" fill="#333333" text-anchor="start" dominant-baseline="central">new: "def foo(x, y=0):\n</text>
<text x="194.0" y="156.44" font-family="'Courier New', Courier, monospace" font-size="11" fill="#333333" text-anchor="start" dominant-baseline="central">return x + y"</text>
<text x="194.0" y="0" font-family="'Courier New', Courier, monospace" font-size="11" fill="#333333" text-anchor="start" dominant-baseline="central"><tspan x="194" dy="168.32">→ Thay thế kết hợp chính</tspan><tspan x="194" dy="11.88">xác chuỗi</tspan></text>
<rect x="192.0" y="212" width="160" height="56" rx="3" fill="#ffffff" stroke="#999999" stroke-width="2" />
<text x="272.0" y="0" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="10" fill="#333333" text-anchor="middle" dominant-baseline="central" font-weight="normal"><tspan x="272" dy="213">Ưu điểm: Có thể dự</tspan><tspan x="272" dy="10.8">đoán được, không mơ</tspan><tspan x="272" dy="10.8">hồ</tspan></text>
<text x="272.0" y="0" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="10" fill="#666666" text-anchor="middle" dominant-baseline="central" font-weight="normal"><tspan x="272" dy="245.4">Nhược điểm: Xóa các</tspan><tspan x="272" dy="10.8">phần lớn yêu cầu đầu</tspan><tspan x="272" dy="10.8">ra đầy đủ</tspan></text>
<rect x="366.0" y="55" width="168" height="38" rx="6" fill="#f0f0f0" stroke="#333333" stroke-width="2" />
<text x="450.0" y="74" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="14" fill="#333333" text-anchor="middle" dominant-baseline="central" font-weight="bold">Định vị số dòng</text>
<rect x="366.0" y="101" width="168" height="99" rx="3" fill="#f5f5f5" stroke="#999999" stroke-width="2" />
<text x="372.0" y="0" font-family="'Courier New', Courier, monospace" font-size="11" fill="#333333" text-anchor="start" dominant-baseline="central"><tspan x="372" dy="114.86">Xóa các hàng 42-43 và</tspan><tspan x="372" dy="11.88">chèn:</tspan></text>
<text x="372.0" y="138.62" font-family="'Courier New', Courier, monospace" font-size="11" fill="#333333" text-anchor="start" dominant-baseline="central">def foo(x, y=0):</text>
<text x="372.0" y="150.5" font-family="'Courier New', Courier, monospace" font-size="11" fill="#333333" text-anchor="start" dominant-baseline="central">return x + y</text>
<text x="372.0" y="162.38" font-family="'Courier New', Courier, monospace" font-size="11" fill="#333333" text-anchor="start" dominant-baseline="central" />
<text x="372.0" y="0" font-family="'Courier New', Courier, monospace" font-size="11" fill="#333333" text-anchor="start" dominant-baseline="central"><tspan x="372" dy="174.26">→ Xác định chính xác phạm</tspan><tspan x="372" dy="11.88">vi số dòng</tspan></text>
<rect x="370.0" y="212" width="160" height="56" rx="3" fill="#ffffff" stroke="#999999" stroke-width="2" />
<text x="450.0" y="0" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="10" fill="#333333" text-anchor="middle" dominant-baseline="central" font-weight="normal"><tspan x="450" dy="218.4">Ưu điểm: Vận hành</tspan><tspan x="450" dy="10.8">hiệu quả trên các</tspan><tspan x="450" dy="10.8">mặt cắt lớn</tspan></text>
<text x="450.0" y="0" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="10" fill="#666666" text-anchor="middle" dominant-baseline="central" font-weight="normal"><tspan x="450" dy="250.8">Nhược điểm: số dòng</tspan><tspan x="450" dy="10.8">file dài dễ mắc lỗi</tspan></text>
<rect x="544.0" y="55" width="168" height="38" rx="6" fill="#f0f0f0" stroke="#333333" stroke-width="2" />
<text x="628.0" y="74" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="14" fill="#333333" text-anchor="middle" dominant-baseline="central" font-weight="bold">Lệnh lớp Vim</text>
<rect x="544.0" y="101" width="168" height="99" rx="3" fill="#f5f5f5" stroke="#999999" stroke-width="2" />
<text x="550.0" y="120.8" font-family="'Courier New', Courier, monospace" font-size="11" fill="#333333" text-anchor="start" dominant-baseline="central">42G (chuyển tới dòng 42)</text>
<text x="550.0" y="132.68" font-family="'Courier New', Courier, monospace" font-size="11" fill="#333333" text-anchor="start" dominant-baseline="central">cw (thay thế từ)</text>
<text x="550.0" y="144.56" font-family="'Courier New', Courier, monospace" font-size="11" fill="#333333" text-anchor="start" dominant-baseline="central">dd (xóa hàng)</text>
<text x="550.0" y="156.44" font-family="'Courier New', Courier, monospace" font-size="11" fill="#333333" text-anchor="start" dominant-baseline="central">yy/p (sao chép/dán)</text>
<text x="550.0" y="0" font-family="'Courier New', Courier, monospace" font-size="11" fill="#333333" text-anchor="start" dominant-baseline="central"><tspan x="550" dy="168.32">→ Ngữ nghĩa chỉnh sửa</tspan><tspan x="550" dy="11.88">phong phú</tspan></text>
<rect x="548.0" y="212" width="160" height="56" rx="3" fill="#ffffff" stroke="#999999" stroke-width="2" />
<text x="628.0" y="0" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="10" fill="#333333" text-anchor="middle" dominant-baseline="central" font-weight="normal"><tspan x="628" dy="218.4">Ưu điểm: Chuyển</tspan><tspan x="628" dy="10.8">động/tổ chức lại</tspan><tspan x="628" dy="10.8">hiệu quả</tspan></text>
<text x="628.0" y="0" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="10" fill="#666666" text-anchor="middle" dominant-baseline="central" font-weight="normal"><tspan x="628" dy="250.8">Nhược điểm: Mô hình</tspan><tspan x="628" dy="10.8">yếu mắc nhiều lỗi</tspan></text>
<rect x="722.0" y="55" width="168" height="38" rx="6" fill="#d0d0d0" stroke="#333333" stroke-width="2" />
<text x="806.0" y="74" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="14" fill="#333333" text-anchor="middle" dominant-baseline="central" font-weight="bold">Nối đầu với đuôi</text>
<rect x="722.0" y="101" width="168" height="99" rx="3" fill="#f5f5f5" stroke="#999999" stroke-width="2" />
<text x="728.0" y="117" font-family="'Courier New', Courier, monospace" font-size="11" fill="#333333" text-anchor="start" dominant-baseline="central">start: "def foo(x):"</text>
<text x="728.0" y="134" font-family="'Courier New', Courier, monospace" font-size="11" fill="#333333" text-anchor="start" dominant-baseline="central">end: " return x"</text>
<text x="728.0" y="151" font-family="'Courier New', Courier, monospace" font-size="11" fill="#333333" text-anchor="start" dominant-baseline="central">new: "def foo(x, y=0):</text>
<text x="728.0" y="168" font-family="'Courier New', Courier, monospace" font-size="11" fill="#333333" text-anchor="start" dominant-baseline="central">return x + y"</text>
<text x="728.0" y="185" font-family="'Courier New', Courier, monospace" font-size="11" fill="#333333" text-anchor="start" dominant-baseline="central">→ Chỉ cần viền để định vị</text>
<rect x="726.0" y="212" width="160" height="56" rx="3" fill="#ffffff" stroke="#999999" stroke-width="2" />
<text x="806.0" y="0" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="10" fill="#333333" text-anchor="middle" dominant-baseline="central" font-weight="normal"><tspan x="806" dy="213">Ưu điểm: Xóa các</tspan><tspan x="806" dy="10.8">phần lớn mà không</tspan><tspan x="806" dy="10.8">xuất ra tất cả</tspan></text>
<text x="806.0" y="0" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="10" fill="#666666" text-anchor="middle" dominant-baseline="central" font-weight="normal"><tspan x="806" dy="245.4">Nhược điểm: Yêu cầu</tspan><tspan x="806" dy="10.8">sự kết hợp ranh giới</tspan><tspan x="806" dy="10.8">duy nhất</tspan></text>
<line x1="30" y1="320" x2="870" y2="320" stroke="#999999" stroke-width="2" stroke-dasharray="8,4" />
<text x="450.0" y="344" 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">Áp dụng thực tế</text>
<text x="240" y="382" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="14" fill="#333333" text-anchor="end" dominant-baseline="central" font-weight="bold">Old→New</text>
<rect x="250" y="368" width="408.0" height="28" rx="3" fill="#999999" stroke="#333333" stroke-width="2" />
<text x="454.0" y="382" 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">Claude Code</text>
<text x="240" y="420" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="14" fill="#333333" text-anchor="end" dominant-baseline="central" font-weight="bold">Định vị số dòng</text>
<rect x="250" y="406" width="240.0" height="28" rx="3" fill="#d0d0d0" stroke="#333333" stroke-width="2" />
<text x="370.0" y="420" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="14" fill="#333333" text-anchor="middle" dominant-baseline="central" font-weight="normal">Kịch bản tích hợp sâu IDE</text>
<text x="240" y="458" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="14" fill="#333333" text-anchor="end" dominant-baseline="central" font-weight="bold">Diff + Apply</text>
<rect x="250" y="444" width="192.0" height="28" rx="3" fill="#f0f0f0" stroke="#333333" stroke-width="2" />
<text x="346.0" y="458" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="14" fill="#333333" text-anchor="middle" dominant-baseline="central" font-weight="normal">Cursor</text>
<text x="240" y="496" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="14" fill="#333333" text-anchor="end" dominant-baseline="central" font-weight="bold">Nối đầu với đuôi</text>
<rect x="250" y="482" width="144.0" height="28" rx="3" fill="#f0f0f0" stroke="#333333" stroke-width="2" />
<text x="322.0" y="0" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="10" fill="#333333" text-anchor="middle" dominant-baseline="central" font-weight="normal"><tspan x="322" dy="490.6">Giải pháp tùy</tspan><tspan x="322" dy="10.8">chỉnh một phần</tspan></text>
<text x="240" y="534" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="14" fill="#333333" text-anchor="end" dominant-baseline="central" font-weight="bold">Lệnh Vim</text>
<rect x="250" y="520" width="72.0" height="28" rx="3" fill="#f5f5f5" stroke="#333333" stroke-width="2" />
<text x="286.0" y="0" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="10" fill="#333333" text-anchor="middle" dominant-baseline="central" font-weight="normal"><tspan x="286" dy="523.2">Kế hoạch</tspan><tspan x="286" dy="10.8">thử</tspan><tspan x="286" dy="10.8">nghiệm</tspan></text>
</svg>

After

Width:  |  Height:  |  Size: 15 KiB