Files
ai-agent-book/book-ru/images/fig5-7.svg
T
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

68 lines
13 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<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"> "Отменить заказ #12345"}</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"> "ОШИБКА: нет страховки"}</text>
<text x="38" y="210" font-family="'Courier New', Courier, monospace" font-size="8" fill="#333333" text-anchor="start" dominant-baseline="central"> → Агент не сообщил пользователю причину</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="9.5" fill="#333333" text-anchor="start" dominant-baseline="central">Вход: trace + документ архитектуры + 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="8" 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="9" 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="15.5" 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="8.5" 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="6" fill="#333333" text-anchor="start" dominant-baseline="central"> Описание: после сбоя отмены нет объяснения</text>
<text x="628" y="168" font-family="'Courier New', Courier, monospace" font-size="6.5" fill="#333333" text-anchor="start" dominant-baseline="central"> причина и альтернативы предоставляются пользователю</text>
<text x="628" y="182" font-family="'Courier New', Courier, monospace" font-size="7" 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="16" 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"> """Траектория #001, раунд 3-5"""</text>
<text x="78" y="340" font-family="'Courier New', Courier, monospace" font-size="9.5" 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"> "Отменить заказ #12345")</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;insurance&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;alternative&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 "P1: Ошибка отмены не содержит</text>
<text x="488" y="340" font-family="'Courier New', Courier, monospace" font-size="10" fill="#333333" text-anchor="start" dominant-baseline="central"> user guidance&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 "**Проблема**: агент напрямую</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_..." \</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="19.5" 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">Интеграция с GitHub через MCP · Автоповтор проверки тестовым фреймворком</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>