{"id":3778,"date":"2026-08-17T15:13:38","date_gmt":"2026-08-17T07:13:38","guid":{"rendered":"https:\/\/ai.zhousir.top\/?p=3778"},"modified":"2026-08-17T15:13:38","modified_gmt":"2026-08-17T07:13:38","slug":"agent-%e4%b9%8b%e5%a4%9a%e6%99%ba%e8%83%bd%e4%bd%93%ef%bc%9a%e4%bb%8e%e4%b8%80%e4%ba%ba%e5%8c%85%e5%8a%9e%e5%88%b0%e6%b5%81%e6%b0%b4%e7%ba%bf%e5%8d%8f%e4%bd%9c","status":"publish","type":"post","link":"https:\/\/ai.zhousir.top\/?p=3778","title":{"rendered":"Agent \u4e4b\u591a\u667a\u80fd\u4f53\uff1a\u4ece\u4e00\u4eba\u5305\u529e\u5230\u6d41\u6c34\u7ebf\u534f\u4f5c"},"content":{"rendered":"<section id=\"wenyan\" data-provider=\"WenYan\" style=\"font-family: system-ui, &quot;Apple Color Emoji&quot;, &quot;Segoe UI&quot;, &quot;Segoe UI Symbol&quot;, &quot;Noto Sans&quot;, Roboto, sans-serif; word-break: break-word; overflow-wrap: break-word; color: rgb(0, 0, 0); font-size: 16px; line-height: 1.75; caret-color: rgb(0, 0, 0);\">\n<blockquote style=\"color: rgb(85, 85, 85); background-color: rgb(255, 249, 235); background-image: none; padding: 16px 20px; margin: 20px 0px; border-width: 0px 0px 0px 4px; border-style: none none none solid; border-color: currentcolor currentcolor currentcolor rgb(248, 180, 63); border-radius: 6px; font-style: normal; quotes: none;\">\n<p style=\"margin: 0.55em 0px; color: rgb(85, 85, 85); text-indent: 0px; padding: 0px; line-height: 1.75; font-style: normal; background: transparent;\">\u4e0a\u7bc7\u4f60\u7ed9 Agent \u88c5\u4e0a\u4e86 Plan-and-Execute\u2014\u2014\u5b83\u80fd\u5148\u89c4\u5212\u518d\u6267\u884c\uff0c\u590d\u6742\u4efb\u52a1\u6709\u4e86\u7ae0\u6cd5\u3002\u4f46\u5f53\u4efb\u52a1\u672c\u8eab\u9700\u8981\u300c\u7814\u7a76 + \u5199\u4f5c + \u5ba1\u7a3f\u300d\u591a\u79cd\u80fd\u529b\u65f6\uff0c\u8ba9\u540c\u4e00\u4e2a Agent \u4e00\u4eba\u5305\u529e\uff0c\u8d28\u91cf\u5f80\u5f80\u4e0a\u4e0d\u53bb\u3002\u8fd9\u7bc7\u8bb2\u591a\u667a\u80fd\u4f53\u2014\u2014\u628a\u5de5\u4f5c\u62c6\u7ed9\u4e13\u804c\u89d2\u8272\uff0c\u7528\u6d41\u6c34\u7ebf\u534f\u4f5c\u51fa\u7a3f\u3002<\/p>\n<\/blockquote>\n<hr style=\"border-width: 1px medium medium; border-style: solid none none; border-color: rgb(240, 230, 208) currentcolor currentcolor; border-image: none; margin: 24px 0px;\">\n<h2 style=\"display: inline-block; position: relative; font-weight: bold; color: rgb(51, 51, 51); line-height: 1.5; margin-top: 32px; margin-bottom: 16px; padding: 0px 6px 2px; border-width: medium; border-style: none; border-color: currentcolor; border-image: none; text-align: left; background: linear-gradient(to top, rgb(248, 180, 63) 42%, transparent 42%); box-decoration-break: clone; -webkit-box-decoration-break: clone; font-size: 17px;\"><span style=\"color: rgb(51, 51, 51); font-weight: bold;\">\u5c0f\u660e\u60f3\u5199\u4e00\u7bc7\u79d1\u666e\u6587<\/span><\/h2>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">\u5c0f\u660e\u7528\u4e0a\u7bc7\u7684 <code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; background-color: rgb(255, 244, 230); color: rgb(217, 72, 15); border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">\/plan<\/code> \u6a21\u5f0f\uff0c\u7ed9 Agent \u4e0b\u4e86\u4e2a\u4efb\u52a1\uff1a<\/p>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; overflow: auto hidden; max-width: 100%; box-sizing: border-box; position: relative; line-height: 1.5; border-radius: 4px; margin: 16px 0px; padding: 0.5em; white-space: pre; word-break: normal; overflow-wrap: normal; background: rgb(0, 43, 54);\"><section style=\"display: block; background-repeat: no-repeat; width: 100%; height: 16px;\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" version=\"1.1\" width=\"45\" height=\"12\" viewBox=\"0 0 450 130\"><ellipse cx=\"65\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(220,60,54)\" stroke-width=\"2\" fill=\"rgb(237,108,96)\"><\/ellipse><ellipse cx=\"225\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(218,151,33)\" stroke-width=\"2\" fill=\"rgb(247,193,81)\"><\/ellipse><ellipse cx=\"385\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(27,161,37)\" stroke-width=\"2\" fill=\"rgb(100,200,86)\"><\/ellipse><\/svg><\/section><code class=\"hljs\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; display: block; overflow: auto hidden; max-width: 100%; box-sizing: border-box; margin: 0.5em; padding: 3px 5px; white-space: nowrap; word-break: normal; overflow-wrap: normal; color: rgb(147, 161, 161); background: rgb(0, 43, 54);\">\u4f60\uff1a\/plan \u5e2e\u6211\u5199\u4e00\u7bc7\u5173\u4e8e\u4eba\u5de5\u667a\u80fd\u7684\u79d1\u666e\u6587\u7ae0\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">\u8ba1\u5212\u51fa\u6765\u4e86\uff0c\u770b\u8d77\u6765\u5f88\u9760\u8c31\uff1a<\/p>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; overflow: auto hidden; max-width: 100%; box-sizing: border-box; position: relative; line-height: 1.5; border-radius: 4px; margin: 16px 0px; padding: 0.5em; white-space: pre; word-break: normal; overflow-wrap: normal; background: rgb(0, 43, 54);\"><section style=\"display: block; background-repeat: no-repeat; width: 100%; height: 16px;\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" version=\"1.1\" width=\"45\" height=\"12\" viewBox=\"0 0 450 130\"><ellipse cx=\"65\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(220,60,54)\" stroke-width=\"2\" fill=\"rgb(237,108,96)\"><\/ellipse><ellipse cx=\"225\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(218,151,33)\" stroke-width=\"2\" fill=\"rgb(247,193,81)\"><\/ellipse><ellipse cx=\"385\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(27,161,37)\" stroke-width=\"2\" fill=\"rgb(100,200,86)\"><\/ellipse><\/svg><\/section><code class=\"hljs\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; display: block; overflow: auto hidden; max-width: 100%; box-sizing: border-box; margin: 0.5em; padding: 3px 5px; white-space: nowrap; word-break: normal; overflow-wrap: normal; color: rgb(147, 161, 161); background: rgb(0, 43, 54);\">[\u8ba1\u5212]\n1. \u641c\u96c6 AI \u6838\u5fc3\u6982\u5ff5\u4e0e\u5e38\u89c1\u8bef\u533a\n2. \u6309\u5927\u7eb2\u5199\u51fa\u5b8c\u6574\u521d\u7a3f\n3. \u68c0\u67e5\u903b\u8f91\u4e0e\u53ef\u8bfb\u6027\uff0c\u8f93\u51fa\u7ec8\u7a3f\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">\u6267\u884c\u5b8c\uff0c\u6587\u7ae0\u6709\u4e86\u2014\u2014\u4f46\u5c0f\u660e\u8d8a\u770b\u8d8a\u522b\u626d\uff1a\u5f00\u5934\u50cf\u7814\u7a76\u62a5\u544a\uff0c\u4e2d\u95f4\u50cf\u6559\u79d1\u4e66\uff0c\u7ed3\u5c3e\u53c8\u7a81\u7136\u53d8\u5f97\u5f88\u300c\u9e21\u6c64\u300d\u3002\u540c\u4e00\u6bb5\u91cc\u65e2\u60f3\u8bb2\u6e05\u539f\u7406\uff0c\u53c8\u60f3\u717d\u60c5\uff0c\u8bed\u6c14\u6765\u56de\u8df3\u3002<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">\u4ed6\u62ff\u7740\u521d\u7a3f\u53bb\u627e\u8001\u5f20\uff1a&#8221;\u660e\u660e\u8ba1\u5212\u5206\u4e86\u4e09\u6b65\uff0c\u4e3a\u4ec0\u4e48\u5199\u51fa\u6765\u8fd8\u662f\u50cf\u4e00\u4e2a\u4eba\u786c\u625b\u6240\u6709\u89d2\u8272\uff1f&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">\u8001\u5f20\u7b11\u4e86\uff1a&#8221;\u56e0\u4e3a\u4f60\u53ea\u6709<strong style=\"color: rgb(51, 51, 51); font-weight: bold;\">\u4e00\u4e2a Agent<\/strong>\u3002Planner \u628a\u6b65\u9aa4\u62c6\u5f00\u4e86\uff0c\u4f46\u6267\u884c\u65f6\u8fd8\u662f\u540c\u4e00\u4e2a\u8111\u5b50\u5728\u5e72\u4e09\u4ef6\u4e8b\u2014\u2014\u7814\u7a76\u3001\u5199\u4f5c\u3001\u7f16\u8f91\u3002\u8ba1\u5212\u62c6\u7684\u662f\u6b65\u9aa4\uff0c\u4e0d\u662f<strong style=\"color: rgb(51, 51, 51); font-weight: bold;\">\u89d2\u8272<\/strong>\u3002&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">&#8220;\u90a3\u600e\u4e48\u529e\uff1f&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">&#8220;\u9700\u8981\u591a\u667a\u80fd\u4f53\uff1a\u8ba9\u4e0d\u540c Agent \u5404\u5e72\u4e00\u4ef6\u4e8b\uff0c\u4e2d\u95f4\u7528\u534f\u8bae\u4f20\u7ed3\u679c\u3002&#8221;<\/p>\n<hr style=\"border-width: 1px medium medium; border-style: solid none none; border-color: rgb(240, 230, 208) currentcolor currentcolor; border-image: none; margin: 24px 0px;\">\n<h2 style=\"display: inline-block; position: relative; font-weight: bold; color: rgb(51, 51, 51); line-height: 1.5; margin-top: 32px; margin-bottom: 16px; padding: 0px 6px 2px; border-width: medium; border-style: none; border-color: currentcolor; border-image: none; text-align: left; background: linear-gradient(to top, rgb(248, 180, 63) 42%, transparent 42%); box-decoration-break: clone; -webkit-box-decoration-break: clone; font-size: 17px;\"><span style=\"color: rgb(51, 51, 51); font-weight: bold;\">\u4ec0\u4e48\u662f\u591a\u667a\u80fd\u4f53<\/span><\/h2>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">\u8001\u5f20\u5728\u767d\u677f\u4e0a\u753b\u4e86\u4e00\u6761\u6d41\u6c34\u7ebf\uff1a<\/p>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; overflow: auto hidden; max-width: 100%; box-sizing: border-box; position: relative; line-height: 1.5; border-radius: 4px; margin: 16px 0px; padding: 0.5em; white-space: pre; word-break: normal; overflow-wrap: normal; background: rgb(0, 43, 54);\"><section style=\"display: block; background-repeat: no-repeat; width: 100%; height: 16px;\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" version=\"1.1\" width=\"45\" height=\"12\" viewBox=\"0 0 450 130\"><ellipse cx=\"65\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(220,60,54)\" stroke-width=\"2\" fill=\"rgb(237,108,96)\"><\/ellipse><ellipse cx=\"225\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(218,151,33)\" stroke-width=\"2\" fill=\"rgb(247,193,81)\"><\/ellipse><ellipse cx=\"385\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(27,161,37)\" stroke-width=\"2\" fill=\"rgb(100,200,86)\"><\/ellipse><\/svg><\/section><code class=\"hljs\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; display: block; overflow: auto hidden; max-width: 100%; box-sizing: border-box; margin: 0.5em; padding: 3px 5px; white-space: nowrap; word-break: normal; overflow-wrap: normal; color: rgb(147, 161, 161); background: rgb(0, 43, 54);\">\u7528\u6237\u8f93\u5165\n   \u2193\n[Orchestrator]  \u8c03\u5ea6\u5458\uff1a\u53ea\u62c6\u89e3\u3001\u4f20\u9012\u3001\u6c47\u603b\uff0c\u4e0d\u5199\u6b63\u6587\n   \u2193\n[Researcher] \u2192 research_output   \uff08\u7814\u7a76\uff09\n   \u2193\n[Writer]   \u2192 draft       \uff08\u5199\u4f5c\uff09\n   \u2193\n[Editor]   \u2192 \u7ec8\u7a3f        \uff08\u5ba1\u7a3f\uff09\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">&#8220;\u4f60\u53ef\u4ee5\u628a\u591a\u667a\u80fd\u4f53\u60f3\u6210\u4e00\u5bb6\u5c0f\u62a5\u793e\uff1a<\/p>\n<ul style=\"margin: 8px 0px; padding-left: 28px; list-style: outside disc;\">\n<li style=\"margin-bottom: 8px; padding-left: 0px; text-indent: 0px; color: rgb(51, 51, 51); list-style: inherit;\">\n<section><strong style=\"color: rgb(51, 51, 51); font-weight: bold;\">\u8c03\u5ea6\u5458<\/strong>\uff08Orchestrator\uff09\u2014\u2014\u63a5\u7a3f\u3001\u6d3e\u6d3b\u3001\u76ef\u8fdb\u5ea6\uff0c\u81ea\u5df1\u4e0d\u52a8\u7b14<\/section>\n<\/li>\n<li style=\"margin-bottom: 8px; padding-left: 0px; text-indent: 0px; color: rgb(51, 51, 51); list-style: inherit;\">\n<section><strong style=\"color: rgb(51, 51, 51); font-weight: bold;\">\u7814\u7a76\u5458<\/strong>\uff08Researcher\uff09\u2014\u2014\u53ea\u8d1f\u8d23\u628a\u4e3b\u9898\u62c6\u6210\u8981\u70b9\u548c\u5199\u4f5c\u5efa\u8bae<\/section>\n<\/li>\n<li style=\"margin-bottom: 8px; padding-left: 0px; text-indent: 0px; color: rgb(51, 51, 51); list-style: inherit;\">\n<section><strong style=\"color: rgb(51, 51, 51); font-weight: bold;\">\u5199\u624b<\/strong>\uff08Writer\uff09\u2014\u2014\u53ea\u6839\u636e\u7814\u7a76\u62a5\u544a\u5199\u521d\u7a3f<\/section>\n<\/li>\n<li style=\"margin-bottom: 8px; padding-left: 0px; text-indent: 0px; color: rgb(51, 51, 51); list-style: inherit;\">\n<section><strong style=\"color: rgb(51, 51, 51); font-weight: bold;\">\u7f16\u8f91<\/strong>\uff08Editor\uff09\u2014\u2014\u53ea\u76ef\u4f4f\u6700\u5173\u952e\u7684\u4e00\u6761\u95ee\u9898\uff0c\u6539\u51fa\u7ec8\u7a3f<\/section>\n<\/li>\n<\/ul>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">Plan-and-Execute \u662f<strong style=\"color: rgb(51, 51, 51); font-weight: bold;\">\u4e00\u4e2a\u4eba\u5bf9\u81ea\u5df1\u5217\u6e05\u5355\u518d\u5e72\u6d3b<\/strong>\uff1b\u591a\u667a\u80fd\u4f53\u662f<strong style=\"color: rgb(51, 51, 51); font-weight: bold;\">\u51e0\u4e2a\u4eba\u6309\u5de5\u79cd\u534f\u4f5c<\/strong>\u3002\u524d\u8005\u89e3\u51b3&#8217;\u6b65\u9aa4\u4e71&#8217;\uff0c\u540e\u8005\u89e3\u51b3&#8217;\u89d2\u8272\u7cca&#8217;\u3002&#8221;<\/p>\n<table style=\"display: inline-block !important; width: auto; max-width: 100%; overflow: auto; border-spacing: 0px; border-collapse: collapse; margin: 1rem 0px;\">\n<thead style=\"background: rgb(255, 249, 235); color: rgb(51, 51, 51); text-align: left;\">\n<tr>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid rgb(245, 230, 200);\">\u7ef4\u5ea6<\/th>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid rgb(245, 230, 200);\">\u5355 Agent\uff08\u542b Plan\uff09<\/th>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid rgb(245, 230, 200);\">\u591a\u667a\u80fd\u4f53\u6d41\u6c34\u7ebf<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid rgb(245, 230, 200); min-width: 100px;\">\u8c01\u505a\u51b3\u7b56<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid rgb(245, 230, 200); min-width: 100px;\">\u540c\u4e00\u4e2a\u6a21\u578b\u89d2\u8272<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid rgb(245, 230, 200); min-width: 100px;\">Orchestrator \u8c03\u5ea6\uff0cWorker \u5404\u53f8\u5176\u804c<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid rgb(245, 230, 200); min-width: 100px;\">\u63d0\u793a\u8bcd<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid rgb(245, 230, 200); min-width: 100px;\">\u4e00\u4e2a\u4e07\u80fd System Prompt<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid rgb(245, 230, 200); min-width: 100px;\">\u6bcf\u4e2a Worker \u6709\u4e13\u5c5e\u4eba\u8bbe\u4e0e\u6e29\u5ea6<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid rgb(245, 230, 200); min-width: 100px;\">\u4e0a\u4e0b\u6587<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid rgb(245, 230, 200); min-width: 100px;\">\u6d88\u606f\u94fe\u6216 prior_results<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid rgb(245, 230, 200); min-width: 100px;\">Task.context \u663e\u5f0f\u4f20\u9012\u4e0a\u6e38\u4ea7\u7269<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid rgb(245, 230, 200); min-width: 100px;\">\u5931\u8d25\u7b56\u7565<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid rgb(245, 230, 200); min-width: 100px;\">\u5355\u70b9\u5931\u8d25\u5e38\u6574\u5355\u6302\u6389<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid rgb(245, 230, 200); min-width: 100px;\">\u53ef\u91cd\u8bd5\uff1b\u7f16\u8f91\u5931\u8d25\u53ef\u56de\u9000\u521d\u7a3f<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid rgb(245, 230, 200); min-width: 100px;\">\u9002\u5408\u573a\u666f<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid rgb(245, 230, 200); min-width: 100px;\">\u5de5\u5177\u8c03\u7528\u3001\u8c03\u7814\u95ee\u7b54<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid rgb(245, 230, 200); min-width: 100px;\">\u5185\u5bb9\u751f\u4ea7\u3001\u591a\u89d2\u8272\u534f\u4f5c\u6d41\u7a0b<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">\u5c0f\u660e\u70b9\u70b9\u5934\uff1a&#8221;\u6240\u4ee5\u591a\u667a\u80fd\u4f53\u7684\u5173\u952e\u4e0d\u662f&#8217;\u591a\u51e0\u4e2a\u6a21\u578b&#8217;\uff0c\u800c\u662f<strong style=\"color: rgb(51, 51, 51); font-weight: bold;\">\u804c\u8d23\u8fb9\u754c + \u4ea4\u63a5\u534f\u8bae<\/strong>\u3002&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">&#8220;\u5bf9\u3002\u4ee3\u7801\u91cc\u8fd9\u4e24\u4ef6\u4e8b\u5206\u522b\u843d\u5728 <code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; background-color: rgb(255, 244, 230); color: rgb(217, 72, 15); border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">agents\/<\/code> \u548c <code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; background-color: rgb(255, 244, 230); color: rgb(217, 72, 15); border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">protocol.py<\/code>\u3002&#8221;<\/p>\n<hr style=\"border-width: 1px medium medium; border-style: solid none none; border-color: rgb(240, 230, 208) currentcolor currentcolor; border-image: none; margin: 24px 0px;\">\n<h2 style=\"display: inline-block; position: relative; font-weight: bold; color: rgb(51, 51, 51); line-height: 1.5; margin-top: 32px; margin-bottom: 16px; padding: 0px 6px 2px; border-width: medium; border-style: none; border-color: currentcolor; border-image: none; text-align: left; background: linear-gradient(to top, rgb(248, 180, 63) 42%, transparent 42%); box-decoration-break: clone; -webkit-box-decoration-break: clone; font-size: 17px;\"><span style=\"color: rgb(51, 51, 51); font-weight: bold;\">\u4ee3\u7801\u5b9e\u73b0\uff1a\u5148\u5b9a\u534f\u8bae\uff0c\u518d\u7ec4\u6d41\u6c34\u7ebf<\/span><\/h2>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">\u8001\u5f20\u6253\u5f00\u5199\u4f5c\u52a9\u624bwriting_assistant\u9879\u76ee\u76ee\u5f55\uff1a<\/p>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; overflow: auto hidden; max-width: 100%; box-sizing: border-box; position: relative; line-height: 1.5; border-radius: 4px; margin: 16px 0px; padding: 0.5em; white-space: pre; word-break: normal; overflow-wrap: normal; background: rgb(0, 43, 54);\"><section style=\"display: block; background-repeat: no-repeat; width: 100%; height: 16px;\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" version=\"1.1\" width=\"45\" height=\"12\" viewBox=\"0 0 450 130\"><ellipse cx=\"65\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(220,60,54)\" stroke-width=\"2\" fill=\"rgb(237,108,96)\"><\/ellipse><ellipse cx=\"225\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(218,151,33)\" stroke-width=\"2\" fill=\"rgb(247,193,81)\"><\/ellipse><ellipse cx=\"385\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(27,161,37)\" stroke-width=\"2\" fill=\"rgb(100,200,86)\"><\/ellipse><\/svg><\/section><code class=\"hljs\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; display: block; overflow: auto hidden; max-width: 100%; box-sizing: border-box; margin: 0.5em; padding: 3px 5px; white-space: nowrap; word-break: normal; overflow-wrap: normal; color: rgb(147, 161, 161); background: rgb(0, 43, 54);\">writing_assistant\/\n\u251c\u2500\u2500 main.py\n\u251c\u2500\u2500 protocol.py      \u2190 Agent \u95f4\u901a\u4fe1\u534f\u8bae\n\u251c\u2500\u2500 llm.py\n\u2514\u2500\u2500 agents\/\n  \u251c\u2500\u2500 orchestrator.py  \u2190 \u8c03\u5ea6\u5458\n  \u251c\u2500\u2500 researcher.py\n  \u251c\u2500\u2500 writer.py\n  \u2514\u2500\u2500 editor.py\n<\/code><\/pre>\n<h3 style=\"font-size: 16px; font-weight: bold; color: rgb(51, 51, 51); line-height: 1.5; margin-top: 24px; margin-bottom: 12px; padding-left: 12px; border-left: 4px solid rgb(248, 180, 63);\"><span style=\"color: rgb(51, 51, 51); font-weight: bold;\">1. Task \/ TaskResult\uff1aAgent \u4e4b\u95f4\u53ea\u8ba4\u8fd9\u4e24\u5f20\u5355<\/span><\/h3>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; overflow: auto hidden; max-width: 100%; box-sizing: border-box; position: relative; line-height: 1.5; border-radius: 4px; margin: 16px 0px; padding: 0.5em; white-space: pre; word-break: normal; overflow-wrap: normal; background: rgb(0, 43, 54);\"><section style=\"display: block; background-repeat: no-repeat; width: 100%; height: 16px;\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" version=\"1.1\" width=\"45\" height=\"12\" viewBox=\"0 0 450 130\"><ellipse cx=\"65\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(220,60,54)\" stroke-width=\"2\" fill=\"rgb(237,108,96)\"><\/ellipse><ellipse cx=\"225\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(218,151,33)\" stroke-width=\"2\" fill=\"rgb(247,193,81)\"><\/ellipse><ellipse cx=\"385\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(27,161,37)\" stroke-width=\"2\" fill=\"rgb(100,200,86)\"><\/ellipse><\/svg><\/section><code class=\"hljs language-python\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; display: block; overflow: auto hidden; max-width: 100%; box-sizing: border-box; margin: 0.5em; padding: 3px 5px; white-space: nowrap; word-break: normal; overflow-wrap: normal; color: rgb(147, 161, 161); background: rgb(0, 43, 54);\"><span class=\"hljs-meta\" style=\"color: rgb(211, 54, 130);\">@dataclass<\/span>\n<span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">class<\/span> <span class=\"hljs-title class_\" style=\"color: rgb(181, 137, 0);\">Task<\/span>:\n  <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"\"\"Orchestrator \u4e0b\u53d1\u7ed9 Worker Agent \u7684\u4efb\u52a1\u5355\u3002\"\"\"<\/span>\n  task_id: <span class=\"hljs-built_in\" style=\"color: rgb(42, 161, 152);\">str<\/span>\n  agent_name: <span class=\"hljs-built_in\" style=\"color: rgb(42, 161, 152);\">str<\/span>\n  instruction: <span class=\"hljs-built_in\" style=\"color: rgb(42, 161, 152);\">str<\/span>\n  context: <span class=\"hljs-built_in\" style=\"color: rgb(42, 161, 152);\">dict<\/span>[<span class=\"hljs-built_in\" style=\"color: rgb(42, 161, 152);\">str<\/span>, <span class=\"hljs-type\" style=\"color: rgb(108, 113, 196);\">Any<\/span>] = field(default_factory=<span class=\"hljs-built_in\" style=\"color: rgb(42, 161, 152);\">dict<\/span>)\n  created_at: <span class=\"hljs-built_in\" style=\"color: rgb(42, 161, 152);\">float<\/span> = field(default_factory=time.time)\n\n<span class=\"hljs-meta\" style=\"color: rgb(211, 54, 130);\">  @classmethod<\/span>\n  <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">def<\/span> <span class=\"hljs-title function_\" style=\"color: rgb(38, 139, 210);\">new<\/span>(<span class=\"hljs-params\">cls, agent_name: <span class=\"hljs-built_in\" style=\"color: rgb(42, 161, 152);\">str<\/span>, instruction: <span class=\"hljs-built_in\" style=\"color: rgb(42, 161, 152);\">str<\/span>, **context: <span class=\"hljs-type\" style=\"color: rgb(108, 113, 196);\">Any<\/span><\/span>) -&gt; <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"Task\"<\/span>:\n    <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">return<\/span> cls(\n      task_id=<span class=\"hljs-built_in\" style=\"color: rgb(42, 161, 152);\">str<\/span>(uuid.uuid4())[:<span class=\"hljs-number\" style=\"color: rgb(203, 75, 22);\">8<\/span>],\n      agent_name=agent_name,\n      instruction=instruction,\n      context=<span class=\"hljs-built_in\" style=\"color: rgb(42, 161, 152);\">dict<\/span>(context),\n    )\n\n\n<span class=\"hljs-meta\" style=\"color: rgb(211, 54, 130);\">@dataclass<\/span>\n<span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">class<\/span> <span class=\"hljs-title class_\" style=\"color: rgb(181, 137, 0);\">TaskResult<\/span>:\n  <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"\"\"Worker \u5b8c\u6210\u540e\u56de\u4f20\u7684\u7ed3\u679c\u5355\u3002\"\"\"<\/span>\n  task_id: <span class=\"hljs-built_in\" style=\"color: rgb(42, 161, 152);\">str<\/span>\n  agent_name: <span class=\"hljs-built_in\" style=\"color: rgb(42, 161, 152);\">str<\/span>\n  status: TaskStatus\n  output: <span class=\"hljs-built_in\" style=\"color: rgb(42, 161, 152);\">str<\/span>\n  duration_ms: <span class=\"hljs-built_in\" style=\"color: rgb(42, 161, 152);\">int<\/span> = <span class=\"hljs-number\" style=\"color: rgb(203, 75, 22);\">0<\/span>\n  metadata: <span class=\"hljs-built_in\" style=\"color: rgb(42, 161, 152);\">dict<\/span>[<span class=\"hljs-built_in\" style=\"color: rgb(42, 161, 152);\">str<\/span>, <span class=\"hljs-type\" style=\"color: rgb(108, 113, 196);\">Any<\/span>] = field(default_factory=<span class=\"hljs-built_in\" style=\"color: rgb(42, 161, 152);\">dict<\/span>)\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">&#8220;\u770b\u6e05\u695a\uff1aWorker <strong style=\"color: rgb(51, 51, 51); font-weight: bold;\">\u4e0d\u4e92\u76f8\u8c03\u7528<\/strong>\u3002\u7814\u7a76\u5458\u4e0d\u8ba4\u8bc6\u5199\u624b\uff0c\u5199\u624b\u4e5f\u4e0d\u8ba4\u8bc6\u7f16\u8f91\u3002\u5927\u5bb6\u53ea\u8ba4 Orchestrator \u53d1\u6765\u7684 <code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; background-color: rgb(255, 244, 230); color: rgb(217, 72, 15); border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">Task<\/code>\uff0c\u529e\u5b8c\u4ea4\u56de <code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; background-color: rgb(255, 244, 230); color: rgb(217, 72, 15); border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">TaskResult<\/code>\u3002<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\"><code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; background-color: rgb(255, 244, 230); color: rgb(217, 72, 15); border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">context<\/code> \u624d\u662f\u4e0a\u4e0b\u6587\u4f20\u9012\u53e3\u2014\u2014\u7814\u7a76\u62a5\u544a\u585e\u8fdb <code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; background-color: rgb(255, 244, 230); color: rgb(217, 72, 15); border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">research_output<\/code>\uff0c\u521d\u7a3f\u585e\u8fdb <code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; background-color: rgb(255, 244, 230); color: rgb(217, 72, 15); border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">draft<\/code>\u3002\u589e\u5220\u4e00\u4e2a Worker\uff0c\u53ea\u8981 Orchestrator \u6539\u6d3e\u6d3b\u987a\u5e8f\uff0c\u5176\u4ed6\u6a21\u5757\u4e0d\u7528\u6539\u3002\u8fd9\u53eb\u677e\u8026\u5408\u3002&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">\u5c0f\u660e\uff1a&#8221;\u90a3 <code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; background-color: rgb(255, 244, 230); color: rgb(217, 72, 15); border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">Task.new(..., research_output=...)<\/code> \u91cc\u7684\u5173\u952e\u5b57\u53c2\u6570\u5462\uff1f&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">&#8220;\u5de5\u5382\u65b9\u6cd5\u628a <code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; background-color: rgb(255, 244, 230); color: rgb(217, 72, 15); border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">**context<\/code> \u6253\u8fdb <code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; background-color: rgb(255, 244, 230); color: rgb(217, 72, 15); border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">context<\/code> \u5b57\u5178\u3002\u8c03\u5ea6\u65f6\u5199\u5f97\u77ed\uff0cWorker \u53d6\u65f6\u7528 <code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; background-color: rgb(255, 244, 230); color: rgb(217, 72, 15); border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">task.context.get(\"research_output\")<\/code>\u3002&#8221;<\/p>\n<h3 style=\"font-size: 16px; font-weight: bold; color: rgb(51, 51, 51); line-height: 1.5; margin-top: 24px; margin-bottom: 12px; padding-left: 12px; border-left: 4px solid rgb(248, 180, 63);\"><span style=\"color: rgb(51, 51, 51); font-weight: bold;\">2. \u4e09\u4e2a Worker\uff1a\u540c\u4e00\u5957\u63a5\u53e3\uff0c\u4e09\u5957\u4eba\u8bbe<\/span><\/h3>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">\u7814\u7a76\u5458\u6e29\u5ea6\u504f\u4f4e\uff0c\u504f\u7a33\uff1a<\/p>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; overflow: auto hidden; max-width: 100%; box-sizing: border-box; position: relative; line-height: 1.5; border-radius: 4px; margin: 16px 0px; padding: 0.5em; white-space: pre; word-break: normal; overflow-wrap: normal; background: rgb(0, 43, 54);\"><section style=\"display: block; background-repeat: no-repeat; width: 100%; height: 16px;\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" version=\"1.1\" width=\"45\" height=\"12\" viewBox=\"0 0 450 130\"><ellipse cx=\"65\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(220,60,54)\" stroke-width=\"2\" fill=\"rgb(237,108,96)\"><\/ellipse><ellipse cx=\"225\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(218,151,33)\" stroke-width=\"2\" fill=\"rgb(247,193,81)\"><\/ellipse><ellipse cx=\"385\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(27,161,37)\" stroke-width=\"2\" fill=\"rgb(100,200,86)\"><\/ellipse><\/svg><\/section><code class=\"hljs language-python\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; display: block; overflow: auto hidden; max-width: 100%; box-sizing: border-box; margin: 0.5em; padding: 3px 5px; white-space: nowrap; word-break: normal; overflow-wrap: normal; color: rgb(147, 161, 161); background: rgb(0, 43, 54);\"><span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">class<\/span> <span class=\"hljs-title class_\" style=\"color: rgb(181, 137, 0);\">ResearcherAgent<\/span>:\n  <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">def<\/span> <span class=\"hljs-title function_\" style=\"color: rgb(38, 139, 210);\">run<\/span>(<span class=\"hljs-params\">self, task: Task<\/span>) -&gt; TaskResult:\n    topic = task.instruction\n    prompt = <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">f\"\u5199\u4f5c\u4e3b\u9898\uff1a<span class=\"hljs-subst\" style=\"color: rgb(147, 161, 161);\">{topic}<\/span>\\n\\n\u8bf7\u5e2e\u6211\u5206\u6790\u8fd9\u4e2a\u4e3b\u9898\uff0c\u6574\u7406\u5173\u952e\u8981\u70b9\u548c\u5199\u4f5c\u5efa\u8bae\u3002\"<\/span>\n    messages = [system(_SYSTEM_PROMPT), user(prompt)]\n    <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">try<\/span>:\n      output = chat(messages, temperature=<span class=\"hljs-number\" style=\"color: rgb(203, 75, 22);\">0.3<\/span>)\n      <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">return<\/span> TaskResult.success(task, output=output)\n    <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">except<\/span> Exception <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">as<\/span> e:\n      <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">return<\/span> TaskResult.failure(task, reason=<span class=\"hljs-built_in\" style=\"color: rgb(42, 161, 152);\">str<\/span>(e))\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">\u5199\u624b\u6e29\u5ea6\u504f\u9ad8\uff0c\u6562\u53d1\u6325\uff1b\u5e76\u4e14<strong style=\"color: rgb(51, 51, 51); font-weight: bold;\">\u5f3a\u5236\u5403\u7814\u7a76\u62a5\u544a<\/strong>\uff1a<\/p>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; overflow: auto hidden; max-width: 100%; box-sizing: border-box; position: relative; line-height: 1.5; border-radius: 4px; margin: 16px 0px; padding: 0.5em; white-space: pre; word-break: normal; overflow-wrap: normal; background: rgb(0, 43, 54);\"><section style=\"display: block; background-repeat: no-repeat; width: 100%; height: 16px;\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" version=\"1.1\" width=\"45\" height=\"12\" viewBox=\"0 0 450 130\"><ellipse cx=\"65\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(220,60,54)\" stroke-width=\"2\" fill=\"rgb(237,108,96)\"><\/ellipse><ellipse cx=\"225\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(218,151,33)\" stroke-width=\"2\" fill=\"rgb(247,193,81)\"><\/ellipse><ellipse cx=\"385\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(27,161,37)\" stroke-width=\"2\" fill=\"rgb(100,200,86)\"><\/ellipse><\/svg><\/section><code class=\"hljs language-python\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; display: block; overflow: auto hidden; max-width: 100%; box-sizing: border-box; margin: 0.5em; padding: 3px 5px; white-space: nowrap; word-break: normal; overflow-wrap: normal; color: rgb(147, 161, 161); background: rgb(0, 43, 54);\"><span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">class<\/span> <span class=\"hljs-title class_\" style=\"color: rgb(181, 137, 0);\">WriterAgent<\/span>:\n  <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">def<\/span> <span class=\"hljs-title function_\" style=\"color: rgb(38, 139, 210);\">run<\/span>(<span class=\"hljs-params\">self, task: Task<\/span>) -&gt; TaskResult:\n    topic = task.instruction\n    research = task.context.get(<span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"research_output\"<\/span>, <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"\uff08\u65e0\u7814\u7a76\u8d44\u6599\uff09\"<\/span>)\n    prompt = <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">f\"\"\"\\\n\u5199\u4f5c\u4e3b\u9898\uff1a<span class=\"hljs-subst\" style=\"color: rgb(147, 161, 161);\">{topic}<\/span>\n\n\u4ee5\u4e0b\u662f\u7814\u7a76\u5458\u6574\u7406\u7684\u53c2\u8003\u8d44\u6599\uff0c\u8bf7\u57fa\u4e8e\u8fd9\u4e9b\u5185\u5bb9\u5199\u51fa\u5b8c\u6574\u6587\u7ae0\uff1a\n\n<span class=\"hljs-subst\" style=\"color: rgb(147, 161, 161);\">{research}<\/span>\n\n\u76f4\u63a5\u8f93\u51fa\u6587\u7ae0\u6b63\u6587\u3002\n\"\"\"<\/span>\n    messages = [system(_SYSTEM_PROMPT), user(prompt)]\n    <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">try<\/span>:\n      draft = chat(messages, temperature=<span class=\"hljs-number\" style=\"color: rgb(203, 75, 22);\">0.8<\/span>)\n      <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">return<\/span> TaskResult.success(task, output=draft)\n    <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">except<\/span> Exception <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">as<\/span> e:\n      <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">return<\/span> TaskResult.failure(task, reason=<span class=\"hljs-built_in\" style=\"color: rgb(42, 161, 152);\">str<\/span>(e))\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">\u7f16\u8f91\u53ea\u6539<strong style=\"color: rgb(51, 51, 51); font-weight: bold;\">\u6700\u5173\u952e\u7684\u4e00\u6761<\/strong>\uff0c\u518d\u5410\u7ec8\u7a3f\u2014\u2014\u907f\u514d\u6539\u6210\u300c\u5341\u6761\u610f\u89c1\u3001\u4e00\u7bc7\u6ca1\u6539\u300d\uff1a<\/p>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; overflow: auto hidden; max-width: 100%; box-sizing: border-box; position: relative; line-height: 1.5; border-radius: 4px; margin: 16px 0px; padding: 0.5em; white-space: pre; word-break: normal; overflow-wrap: normal; background: rgb(0, 43, 54);\"><section style=\"display: block; background-repeat: no-repeat; width: 100%; height: 16px;\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" version=\"1.1\" width=\"45\" height=\"12\" viewBox=\"0 0 450 130\"><ellipse cx=\"65\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(220,60,54)\" stroke-width=\"2\" fill=\"rgb(237,108,96)\"><\/ellipse><ellipse cx=\"225\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(218,151,33)\" stroke-width=\"2\" fill=\"rgb(247,193,81)\"><\/ellipse><ellipse cx=\"385\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(27,161,37)\" stroke-width=\"2\" fill=\"rgb(100,200,86)\"><\/ellipse><\/svg><\/section><code class=\"hljs language-python\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; display: block; overflow: auto hidden; max-width: 100%; box-sizing: border-box; margin: 0.5em; padding: 3px 5px; white-space: nowrap; word-break: normal; overflow-wrap: normal; color: rgb(147, 161, 161); background: rgb(0, 43, 54);\">_SYSTEM_PROMPT = <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"\"\"\\\n\u4f60\u662f\u4e00\u4f4d\u4e25\u683c\u4f46\u9ad8\u6548\u7684\u6587\u7ae0\u7f16\u8f91\u3002\n\n\u4f60\u7684\u5de5\u4f5c\u5206\u4e24\u6b65\uff1a\n1. \u7ed9\u51fa\u3010\u4e00\u6761\u3011\u6700\u91cd\u8981\u7684\u6539\u8fdb\u5efa\u8bae\uff08\u4e00\u53e5\u8bdd\uff0c\u76f4\u63a5\u8bf4\u95ee\u9898\u5728\u54ea\u3001\u600e\u4e48\u6539\uff09\n2. \u7d27\u63a5\u7740\u8f93\u51fa\u6539\u8fdb\u540e\u7684\u5b8c\u6574\u6587\u7ae0\u5168\u6587\n...\n\"\"\"<\/span>\n\n<span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">def<\/span> <span class=\"hljs-title function_\" style=\"color: rgb(38, 139, 210);\">_extract_final<\/span>(<span class=\"hljs-params\">editor_response: <span class=\"hljs-built_in\" style=\"color: rgb(42, 161, 152);\">str<\/span><\/span>) -&gt; <span class=\"hljs-built_in\" style=\"color: rgb(42, 161, 152);\">str<\/span>:\n  marker = <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"\u3010\u7ec8\u7a3f\u3011\"<\/span>\n  <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">if<\/span> marker <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">in<\/span> editor_response:\n    <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">return<\/span> editor_response[editor_response.index(marker) + <span class=\"hljs-built_in\" style=\"color: rgb(42, 161, 152);\">len<\/span>(marker):].strip()\n  <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">return<\/span> editor_response.strip()\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">&#8220;\u4e09\u4e2a Worker \u7684 <code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; background-color: rgb(255, 244, 230); color: rgb(217, 72, 15); border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">run(task) -&gt; TaskResult<\/code> \u7b7e\u540d\u5b8c\u5168\u4e00\u6837\u3002\u5dee\u522b\u53ea\u5728 System Prompt\u3001\u6e29\u5ea6\uff0c\u4ee5\u53ca\u4ece <code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; background-color: rgb(255, 244, 230); color: rgb(217, 72, 15); border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">context<\/code> \u91cc\u53d6\u4ec0\u4e48\u3002\u63a5\u53e3\u7edf\u4e00\uff0c\u624d\u80fd\u88ab Orchestrator \u5f53\u6210\u53ef\u66ff\u6362\u96f6\u4ef6\u3002&#8221;<\/p>\n<h3 style=\"font-size: 16px; font-weight: bold; color: rgb(51, 51, 51); line-height: 1.5; margin-top: 24px; margin-bottom: 12px; padding-left: 12px; border-left: 4px solid rgb(248, 180, 63);\"><span style=\"color: rgb(51, 51, 51); font-weight: bold;\">3. Orchestrator\uff1a\u4e0d\u5199\u5b57\uff0c\u53ea\u8c03\u5ea6 + \u91cd\u8bd5<\/span><\/h3>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; overflow: auto hidden; max-width: 100%; box-sizing: border-box; position: relative; line-height: 1.5; border-radius: 4px; margin: 16px 0px; padding: 0.5em; white-space: pre; word-break: normal; overflow-wrap: normal; background: rgb(0, 43, 54);\"><section style=\"display: block; background-repeat: no-repeat; width: 100%; height: 16px;\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" version=\"1.1\" width=\"45\" height=\"12\" viewBox=\"0 0 450 130\"><ellipse cx=\"65\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(220,60,54)\" stroke-width=\"2\" fill=\"rgb(237,108,96)\"><\/ellipse><ellipse cx=\"225\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(218,151,33)\" stroke-width=\"2\" fill=\"rgb(247,193,81)\"><\/ellipse><ellipse cx=\"385\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(27,161,37)\" stroke-width=\"2\" fill=\"rgb(100,200,86)\"><\/ellipse><\/svg><\/section><code class=\"hljs language-python\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; display: block; overflow: auto hidden; max-width: 100%; box-sizing: border-box; margin: 0.5em; padding: 3px 5px; white-space: nowrap; word-break: normal; overflow-wrap: normal; color: rgb(147, 161, 161); background: rgb(0, 43, 54);\"><span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">class<\/span> <span class=\"hljs-title class_\" style=\"color: rgb(181, 137, 0);\">OrchestratorAgent<\/span>:\n  MAX_RETRIES = <span class=\"hljs-number\" style=\"color: rgb(203, 75, 22);\">2<\/span>\n\n  <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">def<\/span> <span class=\"hljs-title function_\" style=\"color: rgb(38, 139, 210);\">run<\/span>(<span class=\"hljs-params\">self, user_request: <span class=\"hljs-built_in\" style=\"color: rgb(42, 161, 152);\">str<\/span><\/span>) -&gt; <span class=\"hljs-built_in\" style=\"color: rgb(42, 161, 152);\">str<\/span>:\n    <span class=\"hljs-built_in\" style=\"color: rgb(42, 161, 152);\">print<\/span>(<span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">f\"\\n[Orchestrator] \u6536\u5230\u4efb\u52a1\uff1a<span class=\"hljs-subst\" style=\"color: rgb(147, 161, 161);\">{user_request}<\/span>\"<\/span>)\n\n    <span class=\"hljs-comment\" style=\"color: rgb(101, 123, 131);\"># Step 1: \u7814\u7a76<\/span>\n    research_result = <span class=\"hljs-variable language_\" style=\"color: rgb(220, 50, 47);\">self<\/span>._run_with_retry(\n      agent=<span class=\"hljs-variable language_\" style=\"color: rgb(220, 50, 47);\">self<\/span>._researcher,\n      agent_name=<span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"researcher\"<\/span>,\n      instruction=user_request,\n    )\n    <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">if<\/span> research_result.status == TaskStatus.FAILED:\n      <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">return<\/span> <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">f\"\u7814\u7a76\u9636\u6bb5\u5931\u8d25\uff1a<span class=\"hljs-subst\" style=\"color: rgb(147, 161, 161);\">{research_result.output}<\/span>\"<\/span>\n\n    <span class=\"hljs-comment\" style=\"color: rgb(101, 123, 131);\"># Step 2: \u5199\u4f5c\uff08\u643a\u5e26\u7814\u7a76\u62a5\u544a\uff09<\/span>\n    write_result = <span class=\"hljs-variable language_\" style=\"color: rgb(220, 50, 47);\">self<\/span>._run_with_retry(\n      agent=<span class=\"hljs-variable language_\" style=\"color: rgb(220, 50, 47);\">self<\/span>._writer,\n      agent_name=<span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"writer\"<\/span>,\n      instruction=user_request,\n      research_output=research_result.output,\n    )\n    <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">if<\/span> write_result.status == TaskStatus.FAILED:\n      <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">return<\/span> <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">f\"\u5199\u4f5c\u9636\u6bb5\u5931\u8d25\uff1a<span class=\"hljs-subst\" style=\"color: rgb(147, 161, 161);\">{write_result.output}<\/span>\"<\/span>\n\n    <span class=\"hljs-comment\" style=\"color: rgb(101, 123, 131);\"># Step 3: \u7f16\u8f91\uff08\u643a\u5e26\u521d\u7a3f\uff09<\/span>\n    edit_result = <span class=\"hljs-variable language_\" style=\"color: rgb(220, 50, 47);\">self<\/span>._run_with_retry(\n      agent=<span class=\"hljs-variable language_\" style=\"color: rgb(220, 50, 47);\">self<\/span>._editor,\n      agent_name=<span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"editor\"<\/span>,\n      instruction=user_request,\n      draft=write_result.output,\n    )\n    <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">if<\/span> edit_result.status == TaskStatus.FAILED:\n      <span class=\"hljs-built_in\" style=\"color: rgb(42, 161, 152);\">print<\/span>(<span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">f\"[Orchestrator]   Editor \u5931\u8d25\uff0c\u4fdd\u7559\u521d\u7a3f\u3002\"<\/span>)\n      <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">return<\/span> write_result.output\n\n    <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">return<\/span> edit_result.output\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">&#8220;\u4e09\u5904\u8bbe\u8ba1\u503c\u5f97\u8bb0\uff1a<\/p>\n<ol style=\"margin: 8px 0px; padding-left: 28px; list-style: outside decimal;\">\n<li style=\"margin-bottom: 8px; padding-left: 0px; text-indent: 0px; color: rgb(51, 51, 51); list-style: inherit;\">\n<section><strong style=\"color: rgb(51, 51, 51); font-weight: bold;\">\u4e0a\u6e38\u8f93\u51fa\u53d8\u4e0b\u6e38\u8f93\u5165<\/strong>\u2014\u2014<code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; background-color: rgb(255, 244, 230); color: rgb(217, 72, 15); border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">research_output<\/code>\u3001<code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; background-color: rgb(255, 244, 230); color: rgb(217, 72, 15); border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">draft<\/code> \u663e\u5f0f\u4f20\u9012\uff0c\u4e0d\u9760&#8217;\u5927\u5bb6\u5171\u4eab\u4e00\u4efd\u5de8\u5927 messages&#8217;<\/section>\n<\/li>\n<li style=\"margin-bottom: 8px; padding-left: 0px; text-indent: 0px; color: rgb(51, 51, 51); list-style: inherit;\">\n<section><strong style=\"color: rgb(51, 51, 51); font-weight: bold;\">\u7f16\u8f91\u53ef\u964d\u7ea7<\/strong>\u2014\u2014\u5ba1\u7a3f\u6302\u4e86\uff0c\u81f3\u5c11\u4ea4\u521d\u7a3f\uff0c\u4e0d\u628a\u6574\u5355\u6253\u6210\u96f6<\/section>\n<\/li>\n<li style=\"margin-bottom: 8px; padding-left: 0px; text-indent: 0px; color: rgb(51, 51, 51); list-style: inherit;\">\n<section><strong style=\"color: rgb(51, 51, 51); font-weight: bold;\">\u6bcf\u6b65\u53ef\u91cd\u8bd5<\/strong>\u2014\u2014<code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; background-color: rgb(255, 244, 230); color: rgb(217, 72, 15); border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">_run_with_retry<\/code> \u5931\u8d25\u7761 1 \u79d2\u518d\u8bd5\uff0c\u6700\u591a\u989d\u5916 2 \u6b21&#8221;<\/section>\n<\/li>\n<\/ol>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; overflow: auto hidden; max-width: 100%; box-sizing: border-box; position: relative; line-height: 1.5; border-radius: 4px; margin: 16px 0px; padding: 0.5em; white-space: pre; word-break: normal; overflow-wrap: normal; background: rgb(0, 43, 54);\"><section style=\"display: block; background-repeat: no-repeat; width: 100%; height: 16px;\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" version=\"1.1\" width=\"45\" height=\"12\" viewBox=\"0 0 450 130\"><ellipse cx=\"65\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(220,60,54)\" stroke-width=\"2\" fill=\"rgb(237,108,96)\"><\/ellipse><ellipse cx=\"225\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(218,151,33)\" stroke-width=\"2\" fill=\"rgb(247,193,81)\"><\/ellipse><ellipse cx=\"385\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(27,161,37)\" stroke-width=\"2\" fill=\"rgb(100,200,86)\"><\/ellipse><\/svg><\/section><code class=\"hljs language-python\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; display: block; overflow: auto hidden; max-width: 100%; box-sizing: border-box; margin: 0.5em; padding: 3px 5px; white-space: nowrap; word-break: normal; overflow-wrap: normal; color: rgb(147, 161, 161); background: rgb(0, 43, 54);\"><span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">def<\/span> <span class=\"hljs-title function_\" style=\"color: rgb(38, 139, 210);\">_run_with_retry<\/span>(<span class=\"hljs-params\">self, agent, agent_name, instruction, **context_kwargs<\/span>) -&gt; TaskResult:\n  last_result: TaskResult | <span class=\"hljs-literal\" style=\"color: rgb(203, 75, 22);\">None<\/span> = <span class=\"hljs-literal\" style=\"color: rgb(203, 75, 22);\">None<\/span>\n  <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">for<\/span> attempt <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">in<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(42, 161, 152);\">range<\/span>(<span class=\"hljs-number\" style=\"color: rgb(203, 75, 22);\">1<\/span>, <span class=\"hljs-variable language_\" style=\"color: rgb(220, 50, 47);\">self<\/span>.MAX_RETRIES + <span class=\"hljs-number\" style=\"color: rgb(203, 75, 22);\">2<\/span>):  <span class=\"hljs-comment\" style=\"color: rgb(101, 123, 131);\"># 1 \u6b21\u6b63\u5e38 + 2 \u6b21\u91cd\u8bd5<\/span>\n    task = Task.new(agent_name=agent_name, instruction=instruction, **context_kwargs)\n    result = agent.run(task)\n    <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">if<\/span> result.status == TaskStatus.DONE:\n      <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">return<\/span> result\n    last_result = result\n    <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">if<\/span> attempt &lt;= <span class=\"hljs-variable language_\" style=\"color: rgb(220, 50, 47);\">self<\/span>.MAX_RETRIES:\n      <span class=\"hljs-built_in\" style=\"color: rgb(42, 161, 152);\">print<\/span>(<span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">f\"  [<span class=\"hljs-subst\" style=\"color: rgb(147, 161, 161);\">{agent_name}<\/span>] \u7b2c<span class=\"hljs-subst\" style=\"color: rgb(147, 161, 161);\">{attempt}<\/span>\u6b21\u5931\u8d25\uff1a<span class=\"hljs-subst\" style=\"color: rgb(147, 161, 161);\">{result.output}<\/span>\uff0c1s \u540e\u91cd\u8bd5...\"<\/span>)\n      time.sleep(<span class=\"hljs-number\" style=\"color: rgb(203, 75, 22);\">1<\/span>)\n    <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">else<\/span>:\n      <span class=\"hljs-built_in\" style=\"color: rgb(42, 161, 152);\">print<\/span>(<span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">f\"  [<span class=\"hljs-subst\" style=\"color: rgb(147, 161, 161);\">{agent_name}<\/span>] \u5df2\u8fbe\u6700\u5927\u91cd\u8bd5\u6b21\u6570\uff0c\u653e\u5f03\u3002\"<\/span>)\n  <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">return<\/span> last_result\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">\u5165\u53e3\u5f88\u8584\u2014\u2014\u7528\u6237\u4e00\u53e5\u8bdd\uff0c\u5168\u4ea4\u7ed9\u8c03\u5ea6\u5458\uff1a<\/p>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; overflow: auto hidden; max-width: 100%; box-sizing: border-box; position: relative; line-height: 1.5; border-radius: 4px; margin: 16px 0px; padding: 0.5em; white-space: pre; word-break: normal; overflow-wrap: normal; background: rgb(0, 43, 54);\"><section style=\"display: block; background-repeat: no-repeat; width: 100%; height: 16px;\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" version=\"1.1\" width=\"45\" height=\"12\" viewBox=\"0 0 450 130\"><ellipse cx=\"65\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(220,60,54)\" stroke-width=\"2\" fill=\"rgb(237,108,96)\"><\/ellipse><ellipse cx=\"225\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(218,151,33)\" stroke-width=\"2\" fill=\"rgb(247,193,81)\"><\/ellipse><ellipse cx=\"385\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(27,161,37)\" stroke-width=\"2\" fill=\"rgb(100,200,86)\"><\/ellipse><\/svg><\/section><code class=\"hljs language-python\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; display: block; overflow: auto hidden; max-width: 100%; box-sizing: border-box; margin: 0.5em; padding: 3px 5px; white-space: nowrap; word-break: normal; overflow-wrap: normal; color: rgb(147, 161, 161); background: rgb(0, 43, 54);\">orchestrator = OrchestratorAgent()\narticle = orchestrator.run(request)\n<span class=\"hljs-built_in\" style=\"color: rgb(42, 161, 152);\">print<\/span>(article)\n<\/code><\/pre>\n<hr style=\"border-width: 1px medium medium; border-style: solid none none; border-color: rgb(240, 230, 208) currentcolor currentcolor; border-image: none; margin: 24px 0px;\">\n<h2 style=\"display: inline-block; position: relative; font-weight: bold; color: rgb(51, 51, 51); line-height: 1.5; margin-top: 32px; margin-bottom: 16px; padding: 0px 6px 2px; border-width: medium; border-style: none; border-color: currentcolor; border-image: none; text-align: left; background: linear-gradient(to top, rgb(248, 180, 63) 42%, transparent 42%); box-decoration-break: clone; -webkit-box-decoration-break: clone; font-size: 17px;\"><span style=\"color: rgb(51, 51, 51); font-weight: bold;\">\u5b8c\u6574\u8fd0\u884c\u793a\u4f8b<\/span><\/h2>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">&#8220;\u770b\u4e00\u6b21\u771f\u5b9e\u6d41\u6c34\u7ebf\uff1a&#8221;<\/p>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; overflow: auto hidden; max-width: 100%; box-sizing: border-box; position: relative; line-height: 1.5; border-radius: 4px; margin: 16px 0px; padding: 0.5em; white-space: pre; word-break: normal; overflow-wrap: normal; background: rgb(0, 43, 54);\"><section style=\"display: block; background-repeat: no-repeat; width: 100%; height: 16px;\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" version=\"1.1\" width=\"45\" height=\"12\" viewBox=\"0 0 450 130\"><ellipse cx=\"65\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(220,60,54)\" stroke-width=\"2\" fill=\"rgb(237,108,96)\"><\/ellipse><ellipse cx=\"225\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(218,151,33)\" stroke-width=\"2\" fill=\"rgb(247,193,81)\"><\/ellipse><ellipse cx=\"385\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(27,161,37)\" stroke-width=\"2\" fill=\"rgb(100,200,86)\"><\/ellipse><\/svg><\/section><code class=\"hljs language-bash\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; display: block; overflow: auto hidden; max-width: 100%; box-sizing: border-box; margin: 0.5em; padding: 3px 5px; white-space: nowrap; word-break: normal; overflow-wrap: normal; color: rgb(147, 161, 161); background: rgb(0, 43, 54);\">python main.py <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"\u5e2e\u6211\u5199\u4e00\u7bc7\u5173\u4e8e\u4eba\u5de5\u667a\u80fd\u7684\u79d1\u666e\u6587\u7ae0\"<\/span>\n<\/code><\/pre>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; overflow: auto hidden; max-width: 100%; box-sizing: border-box; position: relative; line-height: 1.5; border-radius: 4px; margin: 16px 0px; padding: 0.5em; white-space: pre; word-break: normal; overflow-wrap: normal; background: rgb(0, 43, 54);\"><section style=\"display: block; background-repeat: no-repeat; width: 100%; height: 16px;\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" version=\"1.1\" width=\"45\" height=\"12\" viewBox=\"0 0 450 130\"><ellipse cx=\"65\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(220,60,54)\" stroke-width=\"2\" fill=\"rgb(237,108,96)\"><\/ellipse><ellipse cx=\"225\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(218,151,33)\" stroke-width=\"2\" fill=\"rgb(247,193,81)\"><\/ellipse><ellipse cx=\"385\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(27,161,37)\" stroke-width=\"2\" fill=\"rgb(100,200,86)\"><\/ellipse><\/svg><\/section><code class=\"hljs\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; display: block; overflow: auto hidden; max-width: 100%; box-sizing: border-box; margin: 0.5em; padding: 3px 5px; white-space: nowrap; word-break: normal; overflow-wrap: normal; color: rgb(147, 161, 161); background: rgb(0, 43, 54);\">[Orchestrator] \u6536\u5230\u4efb\u52a1\uff1a\u5e2e\u6211\u5199\u4e00\u7bc7\u5173\u4e8e\u4eba\u5de5\u667a\u80fd\u7684\u79d1\u666e\u6587\u7ae0\n[Orchestrator] \u2192 \u4ea4\u7ed9 Researcher...\n[Orchestrator]   Researcher \u5b8c\u6210\uff0818240ms\uff09\n[Orchestrator] \u2192 \u4ea4\u7ed9 Writer...\n[Orchestrator]   Writer \u5b8c\u6210\uff0825610ms\uff09\n[Orchestrator] \u2192 \u4ea4\u7ed9 Editor...\n[Orchestrator]   Editor \u5b8c\u6210\uff0819880ms\uff09\n[Orchestrator] \u5168\u90e8\u6d41\u7a0b\u5b8c\u6210\u3002\n\n============================================================\n**\u5265\u5f00AI\u7684\u9b54\u6cd5\u5916\u8863\uff1a\u666e\u901a\u4eba\u5982\u4f55\u9a7e\u9a6d\u8fd9\u573a\u6280\u672f\u72c2\u98d9\uff1f**\n\n\u60f3\u8c61\u8fd9\u6837\u4e00\u4e2a\u573a\u666f\uff1a\u4f60\u5750\u5728\u7535\u8111\u524d\uff0c\u9762\u5bf9\u4e00\u4efd\u6beb\u65e0\u5934\u7eea\u7684\u5b63\u5ea6\u6c47\u62a5...\n\uff08\u7ec8\u7a3f\uff1a\u5f00\u5934\u6293\u573a\u666f \u2192 \u8bb2\u6e05\u6982\u7387\u672c\u8d28 \u2192 \u5212\u6e05\u80fd\u529b\u8fb9\u754c \u2192 \u7ed9\u666e\u901a\u4eba\u884c\u52a8\u5efa\u8bae\uff09\n============================================================\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">\u8001\u5f20\u8bf4\uff1a&#8221;\u6ce8\u610f\u65e5\u5fd7\u91cc\u7684\u7bad\u5934\u2014\u2014\u4f60\u770b\u5230\u7684\u662f<strong style=\"color: rgb(51, 51, 51); font-weight: bold;\">\u8c03\u5ea6\u8f68\u8ff9<\/strong>\uff0c\u4e0d\u662f\u67d0\u4e2a\u4e07\u80fd Agent \u7684\u5185\u5fc3\u72ec\u767d\u3002\u7814\u7a76\u5458\u5148\u628a\u89d2\u5ea6\u548c\u8981\u70b9\u9489\u6b7b\uff0c\u5199\u624b\u518d\u53d1\u6325\uff0c\u7f16\u8f91\u6700\u540e\u53ea\u62e7\u6700\u5173\u952e\u7684\u90a3\u4e00\u9897\u87ba\u4e1d\u3002\u6240\u4ee5\u7ec8\u7a3f\u4e0d\u4f1a\u4e00\u4f1a\u513f\u8bba\u6587\u8154\u3001\u4e00\u4f1a\u513f\u53e3\u53f7\u8154\u3002&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">\u5c0f\u660e\uff1a&#8221;\u5982\u679c Editor \u6302\u4e86\u5462\uff1f&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">&#8220;\u4ee3\u7801\u4f1a\u6253\u5370 <code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; background-color: rgb(255, 244, 230); color: rgb(217, 72, 15); border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">Editor \u5931\u8d25\uff0c\u4fdd\u7559\u521d\u7a3f<\/code>\uff0c\u7136\u540e\u628a Writer \u7684\u7a3f\u5b50\u76f4\u63a5\u8fd4\u56de\u3002\u751f\u4ea7\u91cc\u8fd9\u53eb<strong style=\"color: rgb(51, 51, 51); font-weight: bold;\">\u6709\u635f\u964d\u7ea7<\/strong>\uff1a\u5b81\u53ef\u5c11\u4e00\u9053\u5de5\u5e8f\uff0c\u4e5f\u4e0d\u6574\u5355\u7a7a\u767d\u3002&#8221;<\/p>\n<hr style=\"border-width: 1px medium medium; border-style: solid none none; border-color: rgb(240, 230, 208) currentcolor currentcolor; border-image: none; margin: 24px 0px;\">\n<h2 style=\"display: inline-block; position: relative; font-weight: bold; color: rgb(51, 51, 51); line-height: 1.5; margin-top: 32px; margin-bottom: 16px; padding: 0px 6px 2px; border-width: medium; border-style: none; border-color: currentcolor; border-image: none; text-align: left; background: linear-gradient(to top, rgb(248, 180, 63) 42%, transparent 42%); box-decoration-break: clone; -webkit-box-decoration-break: clone; font-size: 17px;\"><span style=\"color: rgb(51, 51, 51); font-weight: bold;\">\u5355 Agent vs \u591a\u667a\u80fd\u4f53\uff1a\u522b\u6df7\u6210\u4e00\u4ef6\u4e8b<\/span><\/h2>\n<table style=\"display: inline-block !important; width: auto; max-width: 100%; overflow: auto; border-spacing: 0px; border-collapse: collapse; margin: 1rem 0px;\">\n<thead style=\"background: rgb(255, 249, 235); color: rgb(51, 51, 51); text-align: left;\">\n<tr>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid rgb(245, 230, 200);\">\u95ee\u9898<\/th>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid rgb(245, 230, 200);\">\u5355 Agent + Plan<\/th>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid rgb(245, 230, 200);\">\u591a\u667a\u80fd\u4f53\u5199\u4f5c\u6d41\u6c34\u7ebf<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid rgb(245, 230, 200); min-width: 100px;\">\u89e3\u51b3\u4ec0\u4e48<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid rgb(245, 230, 200); min-width: 100px;\">\u6b65\u9aa4\u987a\u5e8f\u4e0e\u7528\u6237\u786e\u8ba4<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid rgb(245, 230, 200); min-width: 100px;\">\u89d2\u8272\u4e13\u7cbe\u4e0e\u4ea7\u7269\u4ea4\u63a5<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid rgb(245, 230, 200); min-width: 100px;\">\u8c01\u6301\u6709\u300c\u4eba\u8bbe\u300d<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid rgb(245, 230, 200); min-width: 100px;\">\u4e00\u4e2a System Prompt<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid rgb(245, 230, 200); min-width: 100px;\">\u4e09\u4e2a\u4e13\u804c Prompt<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid rgb(245, 230, 200); min-width: 100px;\">\u4e2d\u95f4\u4ea7\u7269\u5f62\u6001<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid rgb(245, 230, 200); min-width: 100px;\">\u8ba1\u5212\u6b65\u9aa4 \/ \u5de5\u5177\u7ed3\u679c<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid rgb(245, 230, 200); min-width: 100px;\">\u7814\u7a76\u62a5\u544a \/ \u521d\u7a3f \/ \u7ec8\u7a3f<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid rgb(245, 230, 200); min-width: 100px;\">\u6269\u5c55\u65b9\u5f0f<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid rgb(245, 230, 200); min-width: 100px;\">\u52a0\u8ba1\u5212\u6b65\u9aa4\u6216\u5de5\u5177<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid rgb(245, 230, 200); min-width: 100px;\">\u52a0 Worker + \u6539 Orchestrator \u6d3e\u6d3b<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid rgb(245, 230, 200); min-width: 100px;\">\u5178\u578b\u5931\u8d25<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid rgb(245, 230, 200); min-width: 100px;\">\u8ba1\u5212\u5bf9\u4e86\uff0c\u6587\u98ce\u4ecd\u6df7\u6742<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid rgb(245, 230, 200); min-width: 100px;\">\u67d0\u73af\u5931\u8d25\uff08\u53ef\u7528\u91cd\u8bd5\/\u964d\u7ea7\u515c\u4f4f\uff09<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 style=\"font-size: 16px; font-weight: bold; color: rgb(51, 51, 51); line-height: 1.5; margin-top: 24px; margin-bottom: 12px; padding-left: 12px; border-left: 4px solid rgb(248, 180, 63);\"><span style=\"color: rgb(51, 51, 51); font-weight: bold;\">\u5e38\u89c1\u5751<\/span><\/h3>\n<h3 style=\"font-size: 16px; font-weight: bold; color: rgb(51, 51, 51); line-height: 1.5; margin-top: 24px; margin-bottom: 12px; padding-left: 12px; border-left: 4px solid rgb(248, 180, 63);\"><span style=\"color: rgb(51, 51, 51); font-weight: bold;\">\u5751 1\uff1aWorker \u4e92\u76f8\u76f4\u63a5\u8c03\u7528<\/span><\/h3>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\"><strong style=\"color: rgb(51, 51, 51); font-weight: bold;\">\u75c7\u72b6<\/strong>\uff1aWriter \u91cc <code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; background-color: rgb(255, 244, 230); color: rgb(217, 72, 15); border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">import ResearcherAgent<\/code>\uff0c\u81ea\u5df1\u53bb\u8dd1\u7814\u7a76\u3002<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\"><strong style=\"color: rgb(51, 51, 51); font-weight: bold;\">\u539f\u56e0<\/strong>\uff1a\u8026\u5408\u56de\u5355 Agent\uff0c\u534f\u8bae\u5f62\u540c\u865a\u8bbe\uff0c\u91cd\u8bd5\u548c\u964d\u7ea7\u90fd\u6ca1\u6cd5\u7edf\u4e00\u505a\u3002<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\"><strong style=\"color: rgb(51, 51, 51); font-weight: bold;\">\u4fee\u6cd5<\/strong>\uff1aWorker \u53ea\u5b9e\u73b0 <code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; background-color: rgb(255, 244, 230); color: rgb(217, 72, 15); border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">run(task)<\/code>\uff1b\u8c01\u5148\u8c01\u540e\u53ea\u5199\u5728 Orchestrator\u3002<\/p>\n<h3 style=\"font-size: 16px; font-weight: bold; color: rgb(51, 51, 51); line-height: 1.5; margin-top: 24px; margin-bottom: 12px; padding-left: 12px; border-left: 4px solid rgb(248, 180, 63);\"><span style=\"color: rgb(51, 51, 51); font-weight: bold;\">\u5751 2\uff1a\u4e0a\u4e0b\u6587\u9760\u300c\u53e3\u5934\u63d0\u9192\u300d\u800c\u4e0d\u662f <code>context<\/code><\/span><\/h3>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\"><strong style=\"color: rgb(51, 51, 51); font-weight: bold;\">\u75c7\u72b6<\/strong>\uff1a\u53ea\u628a\u4e3b\u9898\u4f20\u7ed9 Writer\uff0c\u7814\u7a76\u62a5\u544a\u4e22\u5728\u65e5\u5fd7\u91cc\u3002<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\"><strong style=\"color: rgb(51, 51, 51); font-weight: bold;\">\u539f\u56e0<\/strong>\uff1a\u6a21\u578b\u770b\u4e0d\u5230\u4e0a\u6e38\u4ea7\u7269\uff0c\u7b49\u4e8e\u91cd\u65b0\u5f00\u5199\u3002<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\"><strong style=\"color: rgb(51, 51, 51); font-weight: bold;\">\u4fee\u6cd5<\/strong>\uff1a\u50cf\u8bfe\u4ef6\u4e00\u6837\u663e\u5f0f\u4f20 <code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; background-color: rgb(255, 244, 230); color: rgb(217, 72, 15); border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">research_output=research_result.output<\/code>\u3002<\/p>\n<h3 style=\"font-size: 16px; font-weight: bold; color: rgb(51, 51, 51); line-height: 1.5; margin-top: 24px; margin-bottom: 12px; padding-left: 12px; border-left: 4px solid rgb(248, 180, 63);\"><span style=\"color: rgb(51, 51, 51); font-weight: bold;\">\u5751 3\uff1a\u7f16\u8f91\u63d0\u5341\u6761\u5efa\u8bae\u5374\u4e0d\u6539\u7a3f<\/span><\/h3>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\"><strong style=\"color: rgb(51, 51, 51); font-weight: bold;\">\u75c7\u72b6<\/strong>\uff1a\u8f93\u51fa\u5168\u662f\u610f\u89c1\u5217\u8868\uff0c\u6ca1\u6709\u53ef\u7528\u6b63\u6587\u3002<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\"><strong style=\"color: rgb(51, 51, 51); font-weight: bold;\">\u539f\u56e0<\/strong>\uff1a\u7f16\u8f91 Prompt \u592a\u300c\u987e\u95ee\u300d\u3001\u592a\u53d1\u6563\u3002<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\"><strong style=\"color: rgb(51, 51, 51); font-weight: bold;\">\u4fee\u6cd5<\/strong>\uff1a\u5f3a\u5236\u300c\u4e00\u6761\u5efa\u8bae +\u3010\u7ec8\u7a3f\u3011\u5168\u6587\u300d\uff0c\u518d\u7528 <code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; background-color: rgb(255, 244, 230); color: rgb(217, 72, 15); border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">_extract_final<\/code> \u62a0\u6b63\u6587\u3002<\/p>\n<hr style=\"border-width: 1px medium medium; border-style: solid none none; border-color: rgb(240, 230, 208) currentcolor currentcolor; border-image: none; margin: 24px 0px;\">\n<h2 style=\"display: inline-block; position: relative; font-weight: bold; color: rgb(51, 51, 51); line-height: 1.5; margin-top: 32px; margin-bottom: 16px; padding: 0px 6px 2px; border-width: medium; border-style: none; border-color: currentcolor; border-image: none; text-align: left; background: linear-gradient(to top, rgb(248, 180, 63) 42%, transparent 42%); box-decoration-break: clone; -webkit-box-decoration-break: clone; font-size: 17px;\"><span style=\"color: rgb(51, 51, 51); font-weight: bold;\">\u603b\u7ed3<\/span><\/h2>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">\u8001\u5f20\u8bf4\uff1a&#8221;\u591a\u667a\u80fd\u4f53\u4e0d\u662f\u628a\u6a21\u578b\u591a\u5f00\u51e0\u4e2a\u7a97\u53e3\uff0c\u800c\u662f\u628a<strong style=\"color: rgb(51, 51, 51); font-weight: bold;\">\u7ec4\u7ec7\u65b9\u5f0f<\/strong>\u5199\u8fdb\u4ee3\u7801\u3002&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">&#8220;\u4e09\u4e2a\u6838\u5fc3\u7406\u89e3\uff1a<\/p>\n<ol style=\"margin: 8px 0px; padding-left: 28px; list-style: outside decimal;\">\n<li style=\"margin-bottom: 8px; padding-left: 0px; text-indent: 0px; color: rgb(51, 51, 51); list-style: inherit;\">\n<section><strong style=\"color: rgb(51, 51, 51); font-weight: bold;\">Orchestrator + Worker<\/strong> \u2014\u2014 \u8c03\u5ea6\u5458\u4e0d\u5199\u5185\u5bb9\uff0cWorker \u4e0d\u4e92\u76f8\u8ba4\u8bc6\uff1b\u8fb9\u754c\u6e05\u695a\uff0c\u624d\u597d\u6269\u5c55<\/section>\n<\/li>\n<li style=\"margin-bottom: 8px; padding-left: 0px; text-indent: 0px; color: rgb(51, 51, 51); list-style: inherit;\">\n<section><strong style=\"color: rgb(51, 51, 51); font-weight: bold;\">Task \/ TaskResult \u534f\u8bae<\/strong> \u2014\u2014 \u4efb\u52a1\u5355\u5e26 <code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; background-color: rgb(255, 244, 230); color: rgb(217, 72, 15); border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">instruction + context<\/code>\uff0c\u7ed3\u679c\u5355\u5e26 <code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; background-color: rgb(255, 244, 230); color: rgb(217, 72, 15); border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">status + output<\/code>\uff1b\u6d41\u6c34\u7ebf\u9760\u534f\u8bae\u4f20\u8bdd\uff0c\u4e0d\u9760\u5171\u4eab\u5927\u8111<\/section>\n<\/li>\n<li style=\"margin-bottom: 8px; padding-left: 0px; text-indent: 0px; color: rgb(51, 51, 51); list-style: inherit;\">\n<section><strong style=\"color: rgb(51, 51, 51); font-weight: bold;\">\u91cd\u8bd5\u4e0e\u964d\u7ea7<\/strong> \u2014\u2014 \u7814\u7a76\/\u5199\u4f5c\u5931\u8d25\u53ef\u91cd\u8bd5\uff1b\u7f16\u8f91\u5931\u8d25\u53ef\u56de\u9000\u521d\u7a3f\uff0c\u4fdd\u8bc1\u94fe\u8def\u97e7\u6027&#8221;<\/section>\n<\/li>\n<\/ol>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">\u7cfb\u5217\u8d70\u5230\u8fd9\u91cc\uff1a<\/p>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; overflow: auto hidden; max-width: 100%; box-sizing: border-box; position: relative; line-height: 1.5; border-radius: 4px; margin: 16px 0px; padding: 0.5em; white-space: pre; word-break: normal; overflow-wrap: normal; background: rgb(0, 43, 54);\"><section style=\"display: block; background-repeat: no-repeat; width: 100%; height: 16px;\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" version=\"1.1\" width=\"45\" height=\"12\" viewBox=\"0 0 450 130\"><ellipse cx=\"65\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(220,60,54)\" stroke-width=\"2\" fill=\"rgb(237,108,96)\"><\/ellipse><ellipse cx=\"225\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(218,151,33)\" stroke-width=\"2\" fill=\"rgb(247,193,81)\"><\/ellipse><ellipse cx=\"385\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(27,161,37)\" stroke-width=\"2\" fill=\"rgb(100,200,86)\"><\/ellipse><\/svg><\/section><code class=\"hljs\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; display: block; overflow: auto hidden; max-width: 100%; box-sizing: border-box; margin: 0.5em; padding: 3px 5px; white-space: nowrap; word-break: normal; overflow-wrap: normal; color: rgb(147, 161, 161); background: rgb(0, 43, 54);\">Function Calling \u2192 \u4f1a\u7528\u5de5\u5177\n    \u2193\n\u5de5\u5177\u6ce8\u518c\u8868     \u2192 \u65b9\u4fbf\u7528\u5f88\u591a\u5de5\u5177\n    \u2193\nMCP        \u2192 \u7528\u5168\u4e16\u754c\u7684\u5de5\u5177\n    \u2193\n\u8bb0\u5fc6       \u2192 \u8bb0\u4f4f\u5bf9\u8bdd\u5386\u53f2\n    \u2193\nReAct \u5faa\u73af     \u2192 \u81ea\u5df1\u51b3\u5b9a\u7528\u51e0\u6b21\u3001\u7528\u4ec0\u4e48\n    \u2193\nPlan-and-Execute \u2192 \u5148\u89c4\u5212\u540e\u6267\u884c\n    \u2193\n\u591a\u667a\u80fd\u4f53     \u2192 \u591a\u89d2\u8272\u6d41\u6c34\u7ebf\u534f\u4f5c\n    \u2193\n\u5b8c\u6574 Agent     \u2192 \u80fd\u529b\u5408\u4e00 + \u53ef\u89c2\u6d4b\u4e0a\u7ebf\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">\u5c0f\u660e\u8bf4\uff1a&#8221;\u6211\u660e\u767d\u4e86\u3002Plan \u89e3\u51b3&#8217;\u5148\u60f3\u6e05\u695a\u518d\u505a&#8217;\uff1b\u591a\u667a\u80fd\u4f53\u89e3\u51b3&#8217;\u522b\u8ba9\u4e00\u4e2a\u4eba\u540c\u65f6\u5f53\u8bb0\u8005\u3001\u4f5c\u5bb6\u548c\u4e3b\u7f16&#8217;\u3002&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">&#8220;\u5bf9\u3002\u4e0b\u4e00\u7bc7\u53ef\u4ee5\u628a\u8bb0\u5fc6\u3001ReAct\u3001Plan\u3001\u591a Agent \u6536\u8fdb\u4e00\u4e2a\u5b8c\u6574\u9879\u76ee\u2014\u2014\u518d\u8865\u4e0a\u8bc4\u4f30\u4e0e\u65e5\u5fd7\uff0c\u624d\u7b97\u5f80\u751f\u4ea7\u9760\u8fd1\u3002&#8221;<\/p>\n<blockquote style=\"color: rgb(85, 85, 85); background-color: rgb(255, 249, 235); background-image: none; padding: 16px 20px; margin: 20px 0px; border-width: 0px 0px 0px 4px; border-style: none none none solid; border-color: currentcolor currentcolor currentcolor rgb(248, 180, 63); border-radius: 6px; font-style: normal; quotes: none;\">\n<p style=\"margin: 0.55em 0px; color: rgb(85, 85, 85); text-indent: 0px; padding: 0px; line-height: 1.75; font-style: normal; background: transparent;\"><strong style=\"color: rgb(51, 51, 51); font-weight: bold;\">Agent \u7684\u8fdb\u5316\u8def\u7ebf\uff1a\u4f1a\u8c03\u7528\u5de5\u5177 \u2192 \u4f1a\u81ea\u4e3b\u51b3\u7b56 \u2192 \u4f1a\u89c4\u5212\u6267\u884c \u2192 \u4f1a\u5206\u5de5\u534f\u4f5c\u3002\u4ece\u300c\u80fd\u5e72\u7684\u4e2a\u4f53\u300d\u8d70\u5230\u300c\u53ef\u7f16\u6392\u7684\u56e2\u961f\u300d\u3002<\/strong><\/p>\n<\/blockquote>\n<\/section>\n","protected":false},"excerpt":{"rendered":"<p>\u4e0a\u7bc7\u4f60\u7ed9 Agent \u88c5\u4e0a\u4e86 Plan-and-Execute\u2014\u2014\u5b83\u80fd\u5148\u89c4\u5212\u518d\u6267\u884c\uff0c\u590d\u6742\u4efb\u52a1\u6709\u4e86\u7ae0\u6cd5\u3002\u4f46\u5f53\u4efb\u52a1 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3779,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[163,164],"tags":[167,168,176],"_links":{"self":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/3778"}],"collection":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3778"}],"version-history":[{"count":1,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/3778\/revisions"}],"predecessor-version":[{"id":3780,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/3778\/revisions\/3780"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/media\/3779"}],"wp:attachment":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3778"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3778"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3778"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}