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
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:
@@ -0,0 +1,82 @@
|
||||
{
|
||||
"schema_version": "1.0",
|
||||
"experiment": "5-9",
|
||||
"run_id": "20260729T212542Z-5_9-live-browser",
|
||||
"started_at_utc": "2026-07-29T21:25:42.619262+00:00",
|
||||
"completed_at_utc": "2026-07-29T21:25:47.868053+00:00",
|
||||
"provider": "ark",
|
||||
"endpoint": "https://ark.cn-beijing.volces.com/api/v3",
|
||||
"model": "doubao-seed-1-6-flash-250615",
|
||||
"temperature": 0,
|
||||
"source": {
|
||||
"manuscript": "book/chapter5.md#实验-5-9",
|
||||
"campaign_sha256": "f1110f5b6b07ea6e8ba4a7a5270fcc85f25752fdc01056bb73f1abea9ee4a8cf"
|
||||
},
|
||||
"input": {
|
||||
"request": "我想订一张去北京的机票",
|
||||
"intended_submission": {
|
||||
"departure_city": "上海",
|
||||
"departure_date": "2026-08-11",
|
||||
"trip_type": "round_trip",
|
||||
"return_date": "2026-08-18"
|
||||
}
|
||||
},
|
||||
"static_validation": {
|
||||
"出发城市(文本输入)": true,
|
||||
"出发日期(日期选择器)": true,
|
||||
"旅行类型(单选:单程)": true,
|
||||
"旅行类型(单选:往返)": true,
|
||||
"返程日期(日期选择器)": true,
|
||||
"返程字段级联逻辑(仅往返显示)": true
|
||||
},
|
||||
"browser_execution": {
|
||||
"browser": "Chromium",
|
||||
"browser_version": "139.0.7258.5",
|
||||
"initial_return_visible": false,
|
||||
"after_round_trip_visible": true,
|
||||
"submit_count": 1,
|
||||
"submitted_json": {
|
||||
"departure_city": "上海",
|
||||
"departure_date": "2026-08-11",
|
||||
"trip_type": "round_trip",
|
||||
"return_date": "2026-08-18"
|
||||
}
|
||||
},
|
||||
"agent_continuation": "订上海至北京往返机票,去程日期2026-08-11,返程日期2026-08-18。正在为您检索航班...",
|
||||
"usage": {
|
||||
"calls": 2,
|
||||
"prompt_tokens": 690,
|
||||
"completion_tokens": 793,
|
||||
"total_tokens": 1483,
|
||||
"latency_s": 4.516
|
||||
},
|
||||
"artifacts": {
|
||||
"html": {
|
||||
"path": "generated_form.html",
|
||||
"sha256": "676e39fc18181aeb8f2b851e65df281aef56c8e64e49f447b9ac928788ebadcf"
|
||||
},
|
||||
"screenshot": {
|
||||
"path": "browser-submitted.png",
|
||||
"sha256": "d404555c7699e8bc4474791dd147f0beb7222dfc36fce53472c479ba97b91bdd"
|
||||
},
|
||||
"receipts": {
|
||||
"path": "receipts.json",
|
||||
"sha256": "38d5160495f123f4a3847d11bf8ff8a16e0e2236b80c3d086f6d7691baac2532"
|
||||
}
|
||||
},
|
||||
"acceptance_gates": {
|
||||
"live_model_generated_complete_html": true,
|
||||
"all_manuscript_fields_present": true,
|
||||
"real_chromium_executed_javascript": true,
|
||||
"return_date_hidden_before_round_trip": true,
|
||||
"return_date_visible_after_round_trip": true,
|
||||
"user_submitted_exactly_once": true,
|
||||
"browser_submission_contains_all_values": true,
|
||||
"agent_consumed_exact_browser_payload": true,
|
||||
"agent_continued_booking_task": true,
|
||||
"raw_provider_receipts_complete": true,
|
||||
"rendered_browser_screenshot_retained": true
|
||||
},
|
||||
"official_complete": true,
|
||||
"errors_during_repair": []
|
||||
}
|
||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 29 KiB |
+51
@@ -0,0 +1,51 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>机票预订澄清表单</title>
|
||||
<style>
|
||||
#return_date_field { display: none; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<form id="bookingForm">
|
||||
<label for="departure_city">出发城市:</label>
|
||||
<input type="text" id="departure_city" name="departure_city" required><br>
|
||||
|
||||
<label for="departure_date">出发日期:</label>
|
||||
<input type="date" id="departure_date" name="departure_date" required><br>
|
||||
|
||||
<label>旅行类型:</label>
|
||||
<input type="radio" id="one_way" name="trip_type" value="one_way" checked>单程
|
||||
<input type="radio" id="round_trip" name="trip_type" value="round_trip">往返<br>
|
||||
|
||||
<div id="return_date_field">
|
||||
<label for="return_date">返程日期:</label>
|
||||
<input type="date" id="return_date" name="return_date">
|
||||
</div><br>
|
||||
|
||||
<input type="submit" value="提交">
|
||||
</form>
|
||||
<pre id="result"></pre>
|
||||
|
||||
<script>
|
||||
document.getElementById('round_trip').addEventListener('change', function() {
|
||||
document.getElementById('return_date_field').style.display = this.checked ? 'block' : 'none';
|
||||
});
|
||||
document.getElementById('one_way').addEventListener('change', function() {
|
||||
document.getElementById('return_date_field').style.display = this.checked ? 'none' : 'block';
|
||||
});
|
||||
|
||||
document.getElementById('bookingForm').addEventListener('submit', function(e) {
|
||||
e.preventDefault();
|
||||
const formData = {
|
||||
departure_city: document.getElementById('departure_city').value,
|
||||
departure_date: document.getElementById('departure_date').value,
|
||||
trip_type: document.querySelector('input[name="trip_type"]:checked').value,
|
||||
return_date: document.getElementById('return_date').value
|
||||
};
|
||||
document.getElementById('result').textContent = JSON.stringify(formData, null, 2);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,82 @@
|
||||
{
|
||||
"schema_version": "1.0",
|
||||
"experiment": "5-9",
|
||||
"run_id": "20260729T212542Z-5_9-live-browser",
|
||||
"started_at_utc": "2026-07-29T21:25:42.619262+00:00",
|
||||
"completed_at_utc": "2026-07-29T21:25:47.868053+00:00",
|
||||
"provider": "ark",
|
||||
"endpoint": "https://ark.cn-beijing.volces.com/api/v3",
|
||||
"model": "doubao-seed-1-6-flash-250615",
|
||||
"temperature": 0,
|
||||
"source": {
|
||||
"manuscript": "book/chapter5.md#实验-5-9",
|
||||
"campaign_sha256": "f1110f5b6b07ea6e8ba4a7a5270fcc85f25752fdc01056bb73f1abea9ee4a8cf"
|
||||
},
|
||||
"input": {
|
||||
"request": "我想订一张去北京的机票",
|
||||
"intended_submission": {
|
||||
"departure_city": "上海",
|
||||
"departure_date": "2026-08-11",
|
||||
"trip_type": "round_trip",
|
||||
"return_date": "2026-08-18"
|
||||
}
|
||||
},
|
||||
"static_validation": {
|
||||
"出发城市(文本输入)": true,
|
||||
"出发日期(日期选择器)": true,
|
||||
"旅行类型(单选:单程)": true,
|
||||
"旅行类型(单选:往返)": true,
|
||||
"返程日期(日期选择器)": true,
|
||||
"返程字段级联逻辑(仅往返显示)": true
|
||||
},
|
||||
"browser_execution": {
|
||||
"browser": "Chromium",
|
||||
"browser_version": "139.0.7258.5",
|
||||
"initial_return_visible": false,
|
||||
"after_round_trip_visible": true,
|
||||
"submit_count": 1,
|
||||
"submitted_json": {
|
||||
"departure_city": "上海",
|
||||
"departure_date": "2026-08-11",
|
||||
"trip_type": "round_trip",
|
||||
"return_date": "2026-08-18"
|
||||
}
|
||||
},
|
||||
"agent_continuation": "订上海至北京往返机票,去程日期2026-08-11,返程日期2026-08-18。正在为您检索航班...",
|
||||
"usage": {
|
||||
"calls": 2,
|
||||
"prompt_tokens": 690,
|
||||
"completion_tokens": 793,
|
||||
"total_tokens": 1483,
|
||||
"latency_s": 4.516
|
||||
},
|
||||
"artifacts": {
|
||||
"html": {
|
||||
"path": "generated_form.html",
|
||||
"sha256": "676e39fc18181aeb8f2b851e65df281aef56c8e64e49f447b9ac928788ebadcf"
|
||||
},
|
||||
"screenshot": {
|
||||
"path": "browser-submitted.png",
|
||||
"sha256": "d404555c7699e8bc4474791dd147f0beb7222dfc36fce53472c479ba97b91bdd"
|
||||
},
|
||||
"receipts": {
|
||||
"path": "receipts.json",
|
||||
"sha256": "38d5160495f123f4a3847d11bf8ff8a16e0e2236b80c3d086f6d7691baac2532"
|
||||
}
|
||||
},
|
||||
"acceptance_gates": {
|
||||
"live_model_generated_complete_html": true,
|
||||
"all_manuscript_fields_present": true,
|
||||
"real_chromium_executed_javascript": true,
|
||||
"return_date_hidden_before_round_trip": true,
|
||||
"return_date_visible_after_round_trip": true,
|
||||
"user_submitted_exactly_once": true,
|
||||
"browser_submission_contains_all_values": true,
|
||||
"agent_consumed_exact_browser_payload": true,
|
||||
"agent_continued_booking_task": true,
|
||||
"raw_provider_receipts_complete": true,
|
||||
"rendered_browser_screenshot_retained": true
|
||||
},
|
||||
"official_complete": true,
|
||||
"errors_during_repair": []
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
[
|
||||
{
|
||||
"purpose": "generate-form-attempt-1",
|
||||
"called_at_utc": "2026-07-29T21:25:46.329389+00:00",
|
||||
"latency_s": 3.64,
|
||||
"request": {
|
||||
"model": "doubao-seed-1-6-flash-250615",
|
||||
"messages": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": "你是一个\"意图澄清\"助手。用户会给出一个信息不完整的请求,\n你的任务不是直接追问,而是**生成一个自包含的 HTML 表单**,让用户一次性补全所有\n缺失信息。\n\n严格要求(订机票场景):\n1. 表单必须包含以下字段,字段的 name 属性必须使用给定的英文标识:\n - 出发城市:文本输入框,name=\"departure_city\"\n - 出发日期:日期选择器 <input type=\"date\">,name=\"departure_date\"\n - 旅行类型:单选按钮 <input type=\"radio\" name=\"trip_type\">,两个选项\n value=\"one_way\"(单程)和 value=\"round_trip\"(往返)\n - 返程日期:日期选择器,name=\"return_date\",放在 id=\"return_date_field\" 的\n 容器里\n2. **级联逻辑(关键)**:返程日期字段默认隐藏,只有当旅行类型选择\"往返\"\n (round_trip) 时才通过 JavaScript 显示出来;选回\"单程\"时再次隐藏。\n3. 提交时用 JavaScript 阻止默认提交,把所有字段汇总为一个 JSON 对象,\n key 使用上面的英文 name,并显示在 id=\"result\" 的元素里\n (例如 <pre id=\"result\"></pre>)。\n4. 输出必须是**完整、自包含**的 HTML(含 <style> 和 <script>,内联,不引用外部\n 资源),可直接保存为 .html 文件在浏览器打开。\n\n只输出 HTML 代码本身,不要任何解释文字,不要用 markdown 代码块包裹。"
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": "用户请求:我想订一张去北京的机票\n请为其中缺失的信息生成澄清表单。"
|
||||
}
|
||||
],
|
||||
"temperature": 0
|
||||
},
|
||||
"response": {
|
||||
"id": "02178536034303104b7fd0428efab78207837433ca5fe67baa6ba",
|
||||
"model": "doubao-seed-1-6-flash-250615",
|
||||
"finish_reason": "stop",
|
||||
"content": "<!DOCTYPE html>\n<html>\n<head>\n <meta charset=\"UTF-8\">\n <title>机票预订澄清表单</title>\n <style>\n #return_date_field { display: none; }\n </style>\n</head>\n<body>\n <form id=\"bookingForm\">\n <label for=\"departure_city\">出发城市:</label>\n <input type=\"text\" id=\"departure_city\" name=\"departure_city\" required><br>\n\n <label for=\"departure_date\">出发日期:</label>\n <input type=\"date\" id=\"departure_date\" name=\"departure_date\" required><br>\n\n <label>旅行类型:</label>\n <input type=\"radio\" id=\"one_way\" name=\"trip_type\" value=\"one_way\" checked>单程\n <input type=\"radio\" id=\"round_trip\" name=\"trip_type\" value=\"round_trip\">往返<br>\n\n <div id=\"return_date_field\">\n <label for=\"return_date\">返程日期:</label>\n <input type=\"date\" id=\"return_date\" name=\"return_date\">\n </div><br>\n\n <input type=\"submit\" value=\"提交\">\n </form>\n <pre id=\"result\"></pre>\n\n <script>\n document.getElementById('round_trip').addEventListener('change', function() {\n document.getElementById('return_date_field').style.display = this.checked ? 'block' : 'none';\n });\n document.getElementById('one_way').addEventListener('change', function() {\n document.getElementById('return_date_field').style.display = this.checked ? 'none' : 'block';\n });\n\n document.getElementById('bookingForm').addEventListener('submit', function(e) {\n e.preventDefault();\n const formData = {\n departure_city: document.getElementById('departure_city').value,\n departure_date: document.getElementById('departure_date').value,\n trip_type: document.querySelector('input[name=\"trip_type\"]:checked').value,\n return_date: document.getElementById('return_date').value\n };\n document.getElementById('result').textContent = JSON.stringify(formData, null, 2);\n });\n </script>\n</body>\n</html>"
|
||||
},
|
||||
"usage": {
|
||||
"prompt_tokens": 449,
|
||||
"completion_tokens": 654,
|
||||
"total_tokens": 1103,
|
||||
"cached_prompt_tokens": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"purpose": "continue-after-browser-submit",
|
||||
"called_at_utc": "2026-07-29T21:25:47.866760+00:00",
|
||||
"latency_s": 0.876,
|
||||
"request": {
|
||||
"model": "doubao-seed-1-6-flash-250615",
|
||||
"messages": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": "你是订机票助手。用户已经通过澄清表单一次性提交了 JSON 格式\n的补全信息。请解析这些信息并给出一段简洁的中文\"订票摘要\",确认航段、日期、行程类型。\n如果是单程(one_way)则不要提返程;如果是往返(round_trip)则必须包含返程日期。\n最后追加一句下一步操作提示(如\"正在为您检索航班...\")。只输出摘要文本。"
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": "原始请求:我想订一张去北京的机票\n浏览器表单实际提交的 JSON 数据:\n{\n \"departure_city\": \"上海\",\n \"departure_date\": \"2026-08-11\",\n \"trip_type\": \"round_trip\",\n \"return_date\": \"2026-08-18\"\n}"
|
||||
}
|
||||
],
|
||||
"temperature": 0
|
||||
},
|
||||
"response": {
|
||||
"id": "02178536034718104b7fd0428efab78207837433ca5fe67358839",
|
||||
"model": "doubao-seed-1-6-flash-250615",
|
||||
"finish_reason": "stop",
|
||||
"content": "订上海至北京往返机票,去程日期2026-08-11,返程日期2026-08-18。正在为您检索航班..."
|
||||
},
|
||||
"usage": {
|
||||
"prompt_tokens": 241,
|
||||
"completion_tokens": 139,
|
||||
"total_tokens": 380,
|
||||
"cached_prompt_tokens": 0
|
||||
}
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user