{"id":3772,"date":"2026-08-17T15:09:30","date_gmt":"2026-08-17T07:09:30","guid":{"rendered":"https:\/\/ai.zhousir.top\/?p=3772"},"modified":"2026-08-17T15:09:30","modified_gmt":"2026-08-17T07:09:30","slug":"react-%e5%be%aa%e7%8e%af%ef%bc%9aagent-%e5%ae%9e%e7%8e%b0%e8%87%aa%e4%b8%bb%e5%86%b3%e7%ad%96%e7%9a%84%e6%a0%b8%e5%bf%83%e5%bc%95%e6%93%8e","status":"publish","type":"post","link":"https:\/\/ai.zhousir.top\/?p=3772","title":{"rendered":"ReAct\u00a0\u5faa\u73af\uff1aAgent\u00a0\u5b9e\u73b0\u81ea\u4e3b\u51b3\u7b56\u7684\u6838\u5fc3\u5f15\u64ce"},"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 \u52a0\u4e0a\u4e86\u8bb0\u5fc6\u2014\u2014\u6d88\u606f\u94fe\u8ba9\u5b83\u8bb0\u4f4f\u6574\u4e2a\u4f1a\u8bdd\u3002\u4f46\u8bb0\u5fc6\u53ea\u662f\u57fa\u7840\uff0c\u771f\u6b63\u7684 Agent \u9700\u8981<strong style=\"color: rgb(51, 51, 51); font-weight: bold;\">\u53cd\u590d\u601d\u8003\u3001\u53cd\u590d\u884c\u52a8<\/strong>\uff0c\u76f4\u5230\u4efb\u52a1\u5b8c\u6210\u3002\u8fd9\u7bc7\u8bb2 Agent \u7684\u7075\u9b42\u2014\u2014ReAct \u5faa\u73af\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\u53d1\u73b0 Agent &#8220;\u4e0d\u60f3\u591a\u5e72\u6d3b&#8221;<\/span><\/h2>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">\u5c0f\u660e\u628a\u8bb0\u5fc6\u3001\u5de5\u5177\u6ce8\u518c\u8868\u3001MCP \u90fd\u63a5\u4e0a\u4e86\u3002Agent \u80fd\u804a\u5929\u3001\u80fd\u67e5\u5929\u6c14\u3001\u80fd\u641c\u65b0\u95fb\uff0c\u770b\u8d77\u6765\u5f88\u5b8c\u7f8e\u3002<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">\u4f46\u4ed6\u53d1\u73b0\u4e00\u4e2a\u95ee\u9898\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\u5e2e\u6211\u67e5\u5317\u4eac\u548c\u4e0a\u6d77\u7684\u5929\u6c14\uff0c\u7136\u540e\u544a\u8bc9\u6211\u54ea\u4e2a\u57ce\u5e02\u66f4\u9002\u5408\u51fa\u53bb\u73a9\nAgent\uff1a\uff08\u8c03\u7528 get_weather(city=\"\u5317\u4eac\")\uff09\nAgent\uff1a\u5317\u4eac\u6674\uff0c15\u00b0C\u3002\u6211\u53ea\u80fd\u544a\u8bc9\u4f60\u5317\u4eac\u7684\u5929\u6c14\u3002\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">&#8220;\u5b83\u53ea\u67e5\u4e86\u5317\u4eac\uff01\u4e0a\u6d77\u5462\uff1f&#8221; \u5c0f\u660e\u5f88\u56f0\u60d1\u3002<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">\u4ed6\u53bb\u95ee\u8001\u5f20\u3002\u8001\u5f20\u770b\u4e86\u4e00\u773c\u4ee3\u7801\uff1a&#8221;\u4f60\u5199\u7684\u903b\u8f91\u662f <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;\">if tool_calls \u2192 \u6267\u884c \u2192 \u5582\u56de\u53bb \u2192 \u7ed3\u675f<\/code>\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u6bcf\u6b21\u53ea\u80fd\u8c03\u4e00\u6b21\u5de5\u5177\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\u6211\u8ba9\u5b83\u67e5\u4e24\u4e2a\u57ce\u5e02\uff0c\u5b83\u5e94\u8be5\u5148\u67e5\u5317\u4eac\uff0c\u518d\u67e5\u4e0a\u6d77\uff0c\u7136\u540e\u5bf9\u6bd4\u2014\u2014\u8fd9\u4e0d\u5c31\u662f\u591a\u505a\u51e0\u6b65\u7684\u4e8b\u5417\uff1f&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">&#8220;\u5bf9\uff0c\u4f60\u9700\u8981\u7684\u662f\u2014\u2014<strong style=\"color: rgb(51, 51, 51); font-weight: bold;\">\u5faa\u73af<\/strong>\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 ReAct<\/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\u4e2a\u4e09\u89d2\u5f62\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);\">  Thought\uff08\u601d\u8003\uff09\n   \u2193\n  Action\uff08\u884c\u52a8\uff09\n   \u2193\nObservation\uff08\u89c2\u5bdf\uff09\n   \u2193\n  Thought\uff08\u518d\u601d\u8003\uff09\n   \u2193\n   ...\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">&#8220;\u8fd9\u4e2a\u6a21\u5f0f\u53eb <strong style=\"color: rgb(51, 51, 51); font-weight: bold;\">ReAct<\/strong>\u2014\u2014Reasoning + Acting \u7684\u7ed3\u5408\u3002\u6700\u65e9\u662f Google \u5728 2022 \u5e74\u7684\u4e00\u7bc7\u8bba\u6587\u91cc\u63d0\u51fa\u7684\uff0c\u73b0\u5728\u51e0\u4e4e\u6210\u4e86\u6240\u6709 Agent \u7cfb\u7edf\u7684\u6807\u51c6\u5faa\u73af\u3002&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">&#8220;\u8ddf\u4eba\u7c7b\u7684\u505a\u4e8b\u65b9\u5f0f\u4e00\u6837\uff1a\u60f3 \u2192 \u505a \u2192 \u770b\u5230\u7ed3\u679c \u2192 \u518d\u60f3 \u2192 \u518d\u505a\u3002\u5faa\u73af\u5f80\u590d\uff0c\u76f4\u5230\u95ee\u9898\u89e3\u51b3\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\u8ddf\u6211\u4eec\u4e4b\u524d\u5199\u7684 Function Calling \u6709\u4ec0\u4e48\u533a\u522b\uff1f&#8221; \u5c0f\u660e\u95ee\u3002<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">&#8220;\u4e4b\u524d\u662f\u5355\u6b65\u7684\uff1a\u6a21\u578b\u8bf4\u6709 tool_calls \u2192 \u4f60\u6267\u884c \u2192 \u5582\u7ed3\u679c \u2192 \u6a21\u578b\u56de\u7b54\u3002\u4e00\u6b21\u5c31\u7ed3\u675f\u4e86\u3002ReAct \u628a\u8fd9\u4e2a\u8fc7\u7a0b\u653e\u8fdb\u4e86\u4e00\u4e2a <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;\">while<\/code> \u5faa\u73af\u91cc\u2014\u2014\u53ea\u8981\u6a21\u578b\u8fd8\u89c9\u5f97\u4fe1\u606f\u4e0d\u591f\uff0c\u5c31\u7ee7\u7eed\u8c03\u5de5\u5177\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;\">\u5b98\u65b9 FC \u534f\u8bae\u4e0b\u7684 ReAct<\/span><\/h2>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">\u8001\u5f20\u628a\u5173\u952e\u5dee\u5f02\u753b\u4e86\u51fa\u6765\uff1a<\/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\u6b65 FC\uff08\u4e4b\u524d\uff09<\/th>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid rgb(245, 230, 200);\">ReAct\uff08\u73b0\u5728\uff09<\/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;\">\u63a7\u5236\u7ed3\u6784<\/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;\"><code>if tool_calls<\/code><\/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;\"><code>while tool_calls<\/code><\/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;\">\u5de5\u5177\u8c03\u7528\u6b21\u6570<\/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;\">\u6700\u591a 1 \u6b21<\/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;\">\u4e0d\u9650\uff0c\u76f4\u5230\u591f\u4e86<\/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;\">\u7ec8\u6b62\u6761\u4ef6<\/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;\">\u8c03\u5b8c\u5c31\u56de\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;\">\u6a21\u578b\u81ea\u5df1\u5224\u65ad&#8221;\u4fe1\u606f\u591f\u4e86&#8221;<\/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;\">\u5b89\u5168\u515c\u5e95<\/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;\">\u4e0d\u9700\u8981<\/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;\"><code>max_steps<\/code> \u9632\u65e0\u9650\u5faa\u73af<\/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;\">\u5faa\u73af\u4fe1\u53f7<\/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;\">\u65e0<\/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;\">\u6709 <code>tool_calls<\/code> = \u7ee7\u7eed\uff1b\u65e0 = \u7ed3\u675f<\/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;\">&#8220;\u6838\u5fc3\u601d\u60f3\u5c31\u4e00\u53e5\u8bdd\uff1a<strong style=\"color: rgb(51, 51, 51); font-weight: bold;\"><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;\">tool_calls<\/code> \u662f\u5426\u5b58\u5728\uff0c\u5c31\u662f Agent \u662f\u5426\u9700\u8981\u7ee7\u7eed\u884c\u52a8\u7684\u4fe1\u53f7\u3002<\/strong>&#8220;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">&#8220;\u6709 tool_calls \u2192 \u7ee7\u7eed\u5faa\u73af\uff0c\u6267\u884c\u5de5\u5177\uff0c\u89c2\u5bdf\u7ed3\u679c\uff0c\u518d\u95ee\u6a21\u578b\u3002\u65e0 tool_calls \u2192 \u4efb\u52a1\u5b8c\u6210\uff0c\u8fd4\u56de\u6700\u7ec8\u7b54\u6848\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\u609f\u4e86\uff1a&#8221;\u6240\u4ee5\u4e0d\u662f&#8217;\u6700\u591a\u8c03\u4e00\u6b21&#8217;\uff0c\u800c\u662f&#8217;\u8c03\u5230\u6a21\u578b\u89c9\u5f97\u591f\u4e86\u4e3a\u6b62&#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\u800c\u4e14\u8fd9\u4e2a\u5224\u65ad\u662f\u6a21\u578b\u81ea\u5df1\u505a\u7684\u2014\u2014\u5b83\u5728\u6bcf\u4e00\u6b65\u90fd\u4f1a\u8bc4\u4f30\uff1a\u6211\u5df2\u83b7\u53d6\u7684\u4fe1\u606f\u591f\u4e0d\u591f\u56de\u7b54\u7528\u6237\uff1f\u591f\u4e86\u5c31\u4e0d\u8c03\u5de5\u5177\u4e86\uff0c\u76f4\u63a5\u8f93\u51fa\u6587\u5b57\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\u6218<\/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 <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;\">agent_loop.py<\/code>\uff0c\u8fd9\u662f\u4eca\u5929\u6700\u6838\u5fc3\u7684\u6587\u4ef6\u3002<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">&#8220;\u5148\u770b\u6574\u4f53\u7ed3\u6784\uff0c\u4e00\u5171\u5c31 60 \u884c\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-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);\">ReactAgent<\/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);\">__init__<\/span>(<span class=\"hljs-params\">self, max_steps: <span class=\"hljs-built_in\" style=\"color: rgb(42, 161, 152);\">int<\/span> = <span class=\"hljs-number\" style=\"color: rgb(203, 75, 22);\">5<\/span><\/span>) -&gt; <span class=\"hljs-literal\" style=\"color: rgb(203, 75, 22);\">None<\/span>:\n    <span class=\"hljs-variable language_\" style=\"color: rgb(220, 50, 47);\">self<\/span>.max_steps = max_steps\n    <span class=\"hljs-variable language_\" style=\"color: rgb(220, 50, 47);\">self<\/span>.tools = get_tools_schema()\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_task: <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    memory = ShortTermMemory(max_messages=<span class=\"hljs-number\" style=\"color: rgb(203, 75, 22);\">60<\/span>)\n    memory.add_system(SYSTEM_PROMPT)\n    memory.add({<span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"role\"<\/span>: <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"user\"<\/span>, <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"content\"<\/span>: <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">f\"\u8bf7\u5e2e\u6211\u5b8c\u6210\u8fd9\u4e2a\u4efb\u52a1\uff1a<span class=\"hljs-subst\" style=\"color: rgb(147, 161, 161);\">{user_task}<\/span>\"<\/span>})\n\n    <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">for<\/span> step <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_steps + <span class=\"hljs-number\" style=\"color: rgb(203, 75, 22);\">1<\/span>):\n      <span class=\"hljs-comment\" style=\"color: rgb(101, 123, 131);\"># 1. \u8c03\u7528 LLM<\/span>\n      message = chat(memory.to_api_format(), tools=<span class=\"hljs-variable language_\" style=\"color: rgb(220, 50, 47);\">self<\/span>.tools)\n\n      <span class=\"hljs-comment\" style=\"color: rgb(101, 123, 131);\"># 2. \u65e0 tool_calls \u2192 \u4efb\u52a1\u5b8c\u6210<\/span>\n      <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">if<\/span> <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">not<\/span> message.tool_calls:\n        <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">return<\/span> message.content <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">or<\/span> <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"\"<\/span>\n\n      <span class=\"hljs-comment\" style=\"color: rgb(101, 123, 131);\"># 3. \u6709 tool_calls \u2192 \u6267\u884c<\/span>\n      memory.add(assistant_to_dict(message))\n      <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">for<\/span> tool_call <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">in<\/span> message.tool_calls:\n        result = execute_tool(tool_call.function.name,\n                    tool_call.function.arguments)\n        memory.add({\n          <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"role\"<\/span>: <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"tool\"<\/span>,\n          <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"tool_call_id\"<\/span>: tool_call.<span class=\"hljs-built_in\" style=\"color: rgb(42, 161, 152);\">id<\/span>,\n          <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"content\"<\/span>: result,\n        })\n\n    <span class=\"hljs-comment\" style=\"color: rgb(101, 123, 131);\"># 4. \u8fbe\u5230\u4e0a\u9650 \u2192 \u5f3a\u5236\u6536\u5c3e<\/span>\n    memory.add({<span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"role\"<\/span>: <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"user\"<\/span>,\n           <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"content\"<\/span>: <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"\u4f60\u5df2\u7528\u5b8c\u5de5\u5177\u8c03\u7528\u6b21\u6570\uff0c\u8bf7\u57fa\u4e8e\u5df2\u6709\u4fe1\u606f\u7ed9\u51fa\u6700\u7ec8\u7b54\u6848\u3002\"<\/span>})\n    <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">return<\/span> chat(memory.to_api_format(), tools=<span class=\"hljs-literal\" style=\"color: rgb(203, 75, 22);\">None<\/span>).content\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">&#8220;\u4e00\u884c\u884c\u62c6\u89e3\uff1a&#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;\">\u7b2c\u4e00\u6b65\uff1a\u521d\u59cb\u5316<\/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);\">def<\/span> <span class=\"hljs-title function_\" style=\"color: rgb(38, 139, 210);\">__init__<\/span>(<span class=\"hljs-params\">self, max_steps: <span class=\"hljs-built_in\" style=\"color: rgb(42, 161, 152);\">int<\/span> = <span class=\"hljs-number\" style=\"color: rgb(203, 75, 22);\">5<\/span><\/span>):\n  <span class=\"hljs-variable language_\" style=\"color: rgb(220, 50, 47);\">self<\/span>.max_steps = max_steps\n  <span class=\"hljs-variable language_\" style=\"color: rgb(220, 50, 47);\">self<\/span>.tools = get_tools_schema()\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">&#8220;\u4e24\u4e2a\u914d\u7f6e\uff1a<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;\">max_steps<\/code> \u662f\u5b89\u5168\u9600\uff0c\u9632\u6b62\u65e0\u9650\u5faa\u73af\uff1b<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;\">tools<\/code> \u662f\u5de5\u5177 Schema\uff0c\u6bcf\u6b21\u5faa\u73af\u90fd\u8981\u4f20\u7ed9 LLM\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;\">\u7b2c\u4e8c\u6b65\uff1a\u51c6\u5907\u8bb0\u5fc6<\/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);\">memory = ShortTermMemory(max_messages=<span class=\"hljs-number\" style=\"color: rgb(203, 75, 22);\">60<\/span>)\nmemory.add_system(SYSTEM_PROMPT)\nmemory.add({<span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"role\"<\/span>: <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"user\"<\/span>, <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"content\"<\/span>: <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">f\"\u8bf7\u5e2e\u6211\u5b8c\u6210\u8fd9\u4e2a\u4efb\u52a1\uff1a<span class=\"hljs-subst\" style=\"color: rgb(147, 161, 161);\">{user_task}<\/span>\"<\/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;\u6bcf\u6b21 <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()<\/code> \u90fd\u65b0\u5efa\u4e00\u4e2a <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;\">ShortTermMemory<\/code>\uff0c\u704c\u5165 system \u6307\u4ee4\u548c\u7528\u6237\u4efb\u52a1\u3002\u8fd9\u548c\u4e0a\u7bc7\u8bb2\u7684\u8bb0\u5fc6\u673a\u5236\u5b8c\u5168\u4e00\u81f4\u3002&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">&#8220;\u8fd9\u91cc\u7684\u5173\u952e\u662f <strong style=\"color: rgb(51, 51, 51); font-weight: bold;\">system prompt \u7684\u8bbe\u8ba1<\/strong>\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\" 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\u662f\u4e00\u4e2a\u80fd\u5b8c\u6210\u590d\u6742\u4efb\u52a1\u7684\u667a\u80fd\u52a9\u624b\uff0c\u53ef\u4ee5\u53cd\u590d\u4f7f\u7528\u5de5\u5177\u76f4\u5230\u4fe1\u606f\u8db3\u591f\u3002\n\u89c4\u5219\uff1a\n- \u9700\u8981\u4fe1\u606f\u65f6\u8c03\u7528\u5de5\u5177\uff08\u53ef\u591a\u6b21\u3001\u53ef\u6362\u5de5\u5177\uff09\n- \u6536\u96c6\u5230\u8db3\u591f\u4fe1\u606f\u540e\uff0c\u76f4\u63a5\u7528\u81ea\u7136\u8bed\u8a00\u7ed9\u51fa\u6700\u7ec8\u7b54\u6848\uff08\u4e0d\u518d\u8c03\u7528\u5de5\u5177\uff09\n- \u4e0d\u8981\u7528\u76f8\u540c\u53c2\u6570\u91cd\u590d\u8c03\u7528\u540c\u4e00\u4e2a\u5de5\u5177\n- \u56de\u7b54\u7528\u4e2d\u6587\uff0c\u7b80\u6d01\u6e05\u6670\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">&#8220;\u6ce8\u610f\u8fd9\u6761\uff1a&#8217;\u4e0d\u8981\u7528\u76f8\u540c\u53c2\u6570\u91cd\u590d\u8c03\u7528\u540c\u4e00\u4e2a\u5de5\u5177&#8217;\u3002\u5982\u679c\u6ca1\u6709\u8fd9\u6761\uff0c\u6a21\u578b\u53ef\u80fd\u5728\u67d0\u4e2a\u95ee\u9898\u4e0a\u6b7b\u5faa\u73af\u2014\u2014\u6bd4\u5982\u67e5\u5929\u6c14\u5931\u8d25\uff0c\u5b83\u53cd\u590d\u7528\u540c\u6837\u7684\u53c2\u6570\u91cd\u8bd5\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;\">\u7b2c\u4e09\u6b65\uff1a\u4e3b\u5faa\u73af<\/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);\">for<\/span> step <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_steps + <span class=\"hljs-number\" style=\"color: rgb(203, 75, 22);\">1<\/span>):\n  message = chat(memory.to_api_format(), tools=<span class=\"hljs-variable language_\" style=\"color: rgb(220, 50, 47);\">self<\/span>.tools)\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">&#8220;\u6bcf\u6b65\u505a\u4e09\u4ef6\u4e8b\uff1a\u8c03 LLM \u2192 \u5224\u65ad \u2192 \u6267\u884c\u6216\u8fd4\u56de\u3002&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">&#8220;\u6ce8\u610f\u8fd9\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;\">tools=self.tools<\/code>\u2014\u2014<strong style=\"color: rgb(51, 51, 51); font-weight: bold;\">\u6bcf\u4e00\u6b65\u90fd\u628a\u5b8c\u6574\u7684\u5de5\u5177 Schema \u4f20\u8fdb\u53bb<\/strong>\u3002\u56e0\u4e3a\u6a21\u578b\u9700\u8981\u5728\u6bcf\u4e00\u8f6e\u8bc4\u4f30&#8217;\u6211\u8fd8\u80fd\u7528\u4ec0\u4e48\u5de5\u5177&#8217;\u3002&#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-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-comment\" style=\"color: rgb(101, 123, 131);\"># \u65e0 tool_calls \u2192 \u4efb\u52a1\u5b8c\u6210<\/span>\n<span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">if<\/span> <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">not<\/span> message.tool_calls:\n  <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">return<\/span> message.content <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">or<\/span> <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"\"<\/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;\u8fd9\u662f\u5faa\u73af\u552f\u4e00\u7684\u6b63\u5e38\u51fa\u53e3\u3002\u6a21\u578b\u5224\u65ad\u4fe1\u606f\u591f\u4e86\uff0c\u76f4\u63a5\u8fd4\u56de\u81ea\u7136\u8bed\u8a00\u56de\u7b54\u3002<strong style=\"color: rgb(51, 51, 51); font-weight: bold;\">\u6ce8\u610f\uff1a\u6b64\u65f6\u4e0d\u8ffd\u52a0\u4efb\u4f55 user \u6d88\u606f<\/strong>\uff0c\u56e0\u4e3a\u6a21\u578b\u5df2\u7ecf\u5728 assistant \u6d88\u606f\u91cc\u8bf4\u8bdd\u4e86\u3002&#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-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-comment\" style=\"color: rgb(101, 123, 131);\"># \u6709 tool_calls \u2192 \u6267\u884c<\/span>\nmemory.add(assistant_to_dict(message))\n<span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">for<\/span> tool_call <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">in<\/span> message.tool_calls:\n  result = execute_tool(name, args)\n  memory.add({\n    <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"role\"<\/span>: <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"tool\"<\/span>,\n    <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"tool_call_id\"<\/span>: tool_call.<span class=\"hljs-built_in\" style=\"color: rgb(42, 161, 152);\">id<\/span>,\n    <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"content\"<\/span>: result,\n  })\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">&#8220;\u5173\u952e\u52a8\u4f5c\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>\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;\">assistant(tool_calls)<\/code> \u5199\u5165\u8bb0\u5fc6\uff08\u5b8c\u6574\u4fdd\u7559 tool_call.id\uff09<\/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>\u9010\u4e2a\u6267\u884c\u5de5\u5177<\/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>\u628a\u6bcf\u4e2a\u5de5\u5177\u7ed3\u679c\u4ee5 <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;\">role=tool<\/code> \u5199\u5165\u8bb0\u5fc6\uff0c<strong style=\"color: rgb(51, 51, 51); font-weight: bold;\">tool_call_id \u5fc5\u987b\u548c\u4e0a\u9762\u7684 assistant \u5bf9\u5e94<\/strong><\/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;\"><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;\">continue<\/code> \u662f\u9690\u5f0f\u7684\u2014\u2014Python for \u5faa\u73af\u81ea\u52a8\u8fdb\u5165\u4e0b\u4e00\u6b65\u3002&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">&#8220;\u4e0a\u7bc7\u8bb2\u8bb0\u5fc6\u7684\u65f6\u5019\u5f3a\u8c03\u8fc7\uff1aassistant(tool_calls) \u548c tool \u6d88\u606f\u5fc5\u987b\u6210\u5bf9\uff0cID \u5fc5\u987b\u5bf9\u5e94\u3002\u8fd9\u91cc\u4e25\u683c\u6267\u884c\u4e86\u8fd9\u4e2a\u89c4\u5219\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;\">\u7b2c\u56db\u6b65\uff1a\u5f3a\u5236\u6536\u5c3e<\/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);\">memory.add({<span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"role\"<\/span>: <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"user\"<\/span>,\n       <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"content\"<\/span>: <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"\u4f60\u5df2\u7528\u5b8c\u5de5\u5177\u8c03\u7528\u6b21\u6570\uff0c\u8bf7\u57fa\u4e8e\u5df2\u6709\u4fe1\u606f\u7ed9\u51fa\u6700\u7ec8\u7b54\u6848\u3002\"<\/span>})\n<span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">return<\/span> chat(memory.to_api_format(), tools=<span class=\"hljs-literal\" style=\"color: rgb(203, 75, 22);\">None<\/span>).content\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">&#8220;\u5f53\u5faa\u73af\u8dd1\u6ee1 <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;\">max_steps<\/code> \u8fd8\u6ca1\u7ed3\u675f\u2014\u2014\u8bf4\u660e\u6a21\u578b\u592a&#8217;\u8d2a\u5fc3&#8217;\u4e86\uff0c\u4e00\u76f4\u5728\u8c03\u5de5\u5177\u3002\u8fd9\u65f6\u5f3a\u5236\u8ffd\u52a0\u4e00\u6761 user \u6d88\u606f\u8ba9\u5b83\u6536\u5c3e\uff0c\u540c\u65f6 <strong style=\"color: rgb(51, 51, 51); font-weight: bold;\"><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;\">tools=None<\/code> \u4e0d\u8ba9\u5b83\u518d\u8c03\u4efb\u4f55\u5de5\u5177<\/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;\u4e24\u4e2a\u4fdd\u9669\u624b\u6bb5\u7ec4\u5408\u4f7f\u7528\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>\u8ffd\u52a0 user \u6d88\u606f\u2014\u2014&#8217;\u4f60\u5df2\u7ecf\u4e0d\u80fd\u518d\u8c03\u5de5\u5177\u4e86&#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><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;\">tools=None<\/code>\u2014\u2014\u4ece\u534f\u8bae\u5c42\u9762\u7981\u6b62\u8c03\u5de5\u5177<\/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;\">\u53ea\u505a\u5176\u4e2d\u4e00\u9879\u4e0d\u591f\u3002\u5149\u9760\u6587\u5b57\u63d0\u793a\uff0c\u6a21\u578b\u53ef\u80fd\u5ffd\u7565\uff1b\u5149\u9760 <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;\">tools=None<\/code>\uff0c\u6a21\u578b\u53ef\u80fd\u8fd4\u56de\u7a7a\u5185\u5bb9\u3002\u4e24\u9879\u4e00\u8d77\u624d\u7a33\u59a5\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;\">\u5b8c\u6574\u8fd0\u884c\u8fc7\u7a0b<\/span><\/h2>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">\u8001\u5f20\u62ff\u4e00\u4e2a\u771f\u5b9e\u4efb\u52a1\u6765\u6f14\u793a\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\u5e2e\u6211\u641c\u7d22\u6700\u8fd1 AI \u9886\u57df\u7684\u65b0\u95fb\uff0c\u603b\u7ed3\u51fa 3 \u6761\u6700\u91cd\u8981\u7684\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">\u8fd0\u884c\u8fc7\u7a0b\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);\">[\u6b65\u9aa4 1\/5]\n[\u8c03\u7528\u5de5\u5177]: web_search\n[\u53c2\u6570]: {\"query\": \"AI \u65b0\u95fb 2026\u5e748\u6708\"}\n[\u5de5\u5177\u7ed3\u679c]: 1. OpenAI \u53d1\u5e03\u65b0\u6a21\u578b | ... 2. AI \u82af\u7247\u65b0\u7a81\u7834 | ... 3. ...\n\n[\u6b65\u9aa4 2\/5]\n[\u8c03\u7528\u5de5\u5177]: web_search\n[\u53c2\u6570]: {\"query\": \"AI \u884c\u4e1a\u52a8\u6001 2026\"}\n[\u5de5\u5177\u7ed3\u679c]: 1. \u56fd\u4ea7\u5927\u6a21\u578b\u8fdb\u5c55 | ... 2. AI \u6295\u8d44\u8d8b\u52bf | ...\n\n[\u6b65\u9aa4 3\/5]\n[\u4efb\u52a1\u5b8c\u6210\uff0c\u5171 3 \u6b65]\nAgent\uff1a\u6839\u636e\u641c\u7d22\u7ed3\u679c\uff0c\u8fd1\u671f AI \u9886\u57df\u6700\u91cd\u8981\u7684 3 \u6761\u65b0\u95fb\u662f\uff1a\n1. OpenAI \u53d1\u5e03\u4e86\u65b0\u4e00\u4ee3\u63a8\u7406\u6a21\u578b...\n2. \u56fd\u5185\u591a\u6b3e\u5927\u6a21\u578b\u901a\u8fc7\u56fd\u5bb6\u5907\u6848...\n3. AI \u82af\u7247\u4f9b\u5e94\u7684\u5730\u7f18\u653f\u6cbb\u5f71\u54cd\u6301\u7eed\u5347\u6e29...\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">&#8220;\u6a21\u578b\u505a\u4e86 3 \u6b65\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>\u641c\u7b2c\u4e00\u8f6e\u2014\u2014\u62ff\u5230\u4e00\u4e9b\u7ed3\u679c<\/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>\u89c9\u5f97\u4fe1\u606f\u4e0d\u591f\u5168\u9762\uff0c\u6362\u4e86\u4e2a\u5173\u952e\u8bcd\u518d\u641c\u4e00\u8f6e<\/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>\u4e24\u8f6e\u4fe1\u606f\u591f\u4e86\uff0c\u5f00\u59cb\u603b\u7ed3<\/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;\"><strong style=\"color: rgb(51, 51, 51); font-weight: bold;\">\u6bcf\u4e00\u6b65\u90fd\u662f\u6a21\u578b\u81ea\u5df1\u505a\u7684\u51b3\u7b56<\/strong>\u2014\u2014\u8981\u4e0d\u8981\u7ee7\u7eed\u3001\u6362\u4ec0\u4e48\u5de5\u5177\u3001\u7528\u4ec0\u4e48\u53c2\u6570\u3002\u4f60\u53ea\u5199\u4e86\u5faa\u73af\u6846\u67b6\uff0c\u7b56\u7565\u5168\u5728\u6a21\u578b\u4fa7\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;\">\u5bf9\u6bd4\uff1a\u5355\u6b65 FC vs ReAct<\/span><\/h2>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">\u5c0f\u660e\u60f3\u8d77\u4e4b\u524d\u7684\u4ee3\u7801\uff1a&#8221;\u6211\u4eec\u4e4b\u524d\u5199\u7684\u4e5f\u662f\u8c03\u5de5\u5177\uff0c\u8ddf\u73b0\u5728\u6709\u4ec0\u4e48\u533a\u522b\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\u628a\u4e24\u6bb5\u4ee3\u7801\u5e76\u6392\uff1a<\/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;\">\u5355\u6b65\uff08\u4e4b\u524d\uff09<\/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);\">message = chat(messages, tools=tools)\n<span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">if<\/span> message.tool_calls:\n  <span class=\"hljs-comment\" style=\"color: rgb(101, 123, 131);\"># \u6267\u884c\u5de5\u5177\uff0c\u5582\u7ed3\u679c<\/span>\n  messages.append(tool_result)\n  <span class=\"hljs-comment\" style=\"color: rgb(101, 123, 131);\"># \u7b2c\u4e8c\u8f6e\uff0c\u4e0d\u5e26 tools\uff0c\u5f3a\u5236\u56de\u7b54<\/span>\n  final = chat(messages, tools=<span class=\"hljs-literal\" style=\"color: rgb(203, 75, 22);\">None<\/span>)\n  <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">return<\/span> final.content\n<span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">else<\/span>:\n  <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">return<\/span> message.content\n<\/code><\/pre>\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;\">\u591a\u6b65\uff08\u73b0\u5728\uff09<\/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);\">for<\/span> step <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>, max_steps + <span class=\"hljs-number\" style=\"color: rgb(203, 75, 22);\">1<\/span>):\n  message = chat(messages, tools=tools)\n  <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">if<\/span> <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">not<\/span> message.tool_calls:\n    <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">return<\/span> message.content\n  <span class=\"hljs-comment\" style=\"color: rgb(101, 123, 131);\"># \u6267\u884c\u5de5\u5177\uff0c\u5199\u7ed3\u679c\uff0c\u7ee7\u7eed\u5faa\u73af<\/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;\u5dee\u5f02\u4e00\u76ee\u4e86\u7136\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>\u5355\u6b65\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;\">if<\/code>\u2014\u2014\u6700\u591a\u8c03\u4e00\u6b21\u5de5\u5177\uff1b\u591a\u6b65\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;\">for<\/code>\u2014\u2014\u4e00\u76f4\u8c03\u5230\u591f<\/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>\u5355\u6b65\u7b2c\u4e8c\u8f6e <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;\">tools=None<\/code> \u662f<strong style=\"color: rgb(51, 51, 51); font-weight: bold;\">\u56fa\u5b9a\u884c\u4e3a<\/strong>\uff1b\u591a\u6b65\u53ea\u5728\u515c\u5e95\u65f6\u624d <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;\">tools=None<\/code><\/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>\u591a\u6b65\u6bcf\u8f6e\u90fd\u4f20 tools\uff0c\u8ba9\u6a21\u578b\u6709\u6301\u7eed\u7684\u884c\u52a8\u80fd\u529b<\/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>\u591a\u6b65\u9700\u8981 <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;\">max_steps<\/code> \u515c\u5e95\uff0c\u5355\u6b65\u4e0d\u9700\u8981&#8221;<\/section>\n<\/li>\n<\/ol>\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;\">\u4e24\u4e2a\u5e38\u89c1\u5751<\/span><\/h2>\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\uff1a\u65e0\u9650\u5faa\u73af<\/span><\/h3>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">&#8220;\u5982\u679c\u4e0d\u8bbe <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;\">max_steps<\/code>\uff0c\u6a21\u578b\u53ef\u80fd\u5728\u67d0\u4e2a\u95ee\u9898\u4e0a\u6b7b\u5faa\u73af\u3002\u6bd4\u5982\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\u5e2e\u6211\u627e\u4e00\u4e2a\u6c38\u8fdc\u4e0d\u4f1a\u4e0b\u96e8\u7684\u57ce\u5e02\nAgent\uff1a\u67e5\u5317\u4eac\u5929\u6c14 \u2192 \u6709\u96e8\nAgent\uff1a\u67e5\u4e0a\u6d77\u5929\u6c14 \u2192 \u6709\u96e8\nAgent\uff1a\u67e5\u5e7f\u5dde\u5929\u6c14 \u2192 \u6709\u96e8\nAgent\uff1a\u67e5\u6df1\u5733\u5929\u6c14 \u2192 \u6709\u96e8\n...\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">&#8220;\u6a21\u578b\u6c38\u8fdc\u627e\u4e0d\u5230&#8217;\u6c38\u8fdc\u4e0d\u4f1a\u4e0b\u96e8\u7684\u57ce\u5e02&#8217;\uff0c\u4f46\u6bcf\u6b21\u5de5\u5177\u90fd\u6b63\u5e38\u8fd4\u56de\u2014\u2014\u5b83\u5c31\u4f1a\u4e00\u76f4\u5faa\u73af\u4e0b\u53bb\u3002<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;\">max_steps<\/code> \u662f\u552f\u4e00\u7684\u786c\u505c\u673a\u5236\u3002&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">&#8220;\u53e6\u4e00\u4e2a\u9632\u5fa1\u624b\u6bb5\u662f system prompt \u91cc\u7684&#8217;\u4e0d\u8981\u7528\u76f8\u540c\u53c2\u6570\u91cd\u590d\u8c03\u7528&#8217;\u2014\u2014\u4f46\u8fd9\u662f\u8f6f\u7684\uff0c\u4e0d\u80fd 100% \u4f9d\u8d56\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;\">\u5751 2\uff1a\u5de5\u5177\u7ed3\u679c\u683c\u5f0f\u4e0d\u5bf9\u5bfc\u81f4\u5faa\u73af\u4e71\u6389<\/span><\/h3>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">&#8220;\u5982\u679c\u5de5\u5177\u8fd4\u56de\u7684\u4e0d\u662f\u7eaf\u6587\u672c\uff08\u6bd4\u5982\u8fd4\u56de\u4e86\u4e00\u4e2a JSON \u5bf9\u8c61\u3001\u6216\u8005\u62a5\u9519\u6808\uff09\uff0c\u6a21\u578b\u53ef\u80fd\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>\u628a\u5b83\u5f53\u6210\u64cd\u4f5c\u6307\u4ee4\u6765\u6267\u884c<\/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>\u8bc6\u522b\u4e0d\u4e86\u91cc\u9762\u7684\u5173\u952e\u4fe1\u606f<\/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>\u53cd\u590d\u8c03\u540c\u4e00\u4e2a\u5de5\u5177\u8bd5\u56fe\u83b7\u5f97&#8217;\u5bf9\u7684\u683c\u5f0f&#8217;<\/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;\">\u6240\u4ee5\u5de5\u5177\u51fd\u6570\u5728\u6ce8\u518c\u8868\u91cc\u7edf\u4e00 <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;\">return str(...)<\/code>\uff0c\u786e\u4fdd\u8fd4\u56de\u7684\u662f\u6587\u672c\u5b57\u7b26\u4e32\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;\">\u65e7\u7248 ReAct vs \u5b98\u65b9 FC \u7248<\/span><\/h2>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">\u5c0f\u660e\u67e5\u4e86\u8d44\u6599\uff1a&#8221;ReAct \u4e0d\u662f\u65b0\u4e1c\u897f\u5427\uff1f\u6211\u597d\u50cf\u89c1\u8fc7\u5f88\u65e9\u5c31\u6709\u6587\u7ae0\u8bb2\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\u3002ReAct \u8bba\u6587\u662f 2022 \u5e74\u7684\uff0c\u4f46\u5728 OpenAI \u63a8\u51fa Function Calling \u4e4b\u524d\uff0c\u5927\u5bb6\u600e\u4e48\u505a ReAct\uff1f&#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-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-comment\" style=\"color: rgb(101, 123, 131);\"># \u65e7\u7248\uff1a\u7528 JSON \u683c\u5f0f\u533a\u5206\"\u8c03\u5de5\u5177\"\u548c\"\u6700\u7ec8\u7b54\u6848\"<\/span>\nresponse = chat(messages)  <span class=\"hljs-comment\" style=\"color: rgb(101, 123, 131);\"># \u6a21\u578b\u8fd4\u56de\u666e\u901a\u6587\u672c<\/span>\n<span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">if<\/span> <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">'\"type\": \"tool_call\"'<\/span> <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">in<\/span> response:\n  <span class=\"hljs-comment\" style=\"color: rgb(101, 123, 131);\"># \u89e3\u6790 JSON\uff0c\u8c03\u5de5\u5177<\/span>\n  result = call_tool(json.loads(response))\n  messages.append(<span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">f\"Observation: <span class=\"hljs-subst\" style=\"color: rgb(147, 161, 161);\">{result}<\/span>\"<\/span>)\n<span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">elif<\/span> <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">'\"type\": \"final_answer\"'<\/span> <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">in<\/span> response:\n  <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">return<\/span> json.loads(response)[<span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"content\"<\/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;\u95ee\u9898\u591a\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>\u6a21\u578b\u8f93\u51fa\u683c\u5f0f\u4e0d\u7a33\u5b9a\u2014\u2014JSON \u5076\u5c14\u5c11\u4e2a\u5f15\u53f7\uff0c\u6574\u4e2a\u6d41\u7a0b\u5c31\u5d29\u4e86<\/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>\u9700\u8981\u81ea\u5b9a\u4e49\u534f\u8bae\u2014\u2014\u4f60\u5f97\u544a\u8bc9\u6a21\u578b&#8217;\u8f93\u51fa\u683c\u5f0f\u5fc5\u987b\u662f JSON\uff0ctype \u5b57\u6bb5\u5fc5\u987b\u662f\u4ec0\u4e48&#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>\u6ca1\u6709 tool_call_id\u2014\u2014\u591a\u5de5\u5177\u5e76\u884c\u8c03\u7528\u65f6\u5bb9\u6613\u4e71&#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;\">&#8220;\u5b98\u65b9 Function Calling \u89e3\u51b3\u4e86\u6240\u6709\u8fd9\u4e9b\u95ee\u9898\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;\">\u534f\u8bae\u6807\u51c6\u5316<\/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;\">tool_calls<\/code> \u662f SDK \u539f\u751f\u5b57\u6bb5\uff0c\u683c\u5f0f\u96f6\u51fa\u9519<\/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;\">\u5e76\u884c\u8c03\u7528\u5929\u7136\u652f\u6301<\/strong>\u2014\u2014\u4e00\u4e2a\u6d88\u606f\u91cc\u53ef\u4ee5\u6709\u591a\u4e2a <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;\">tool_calls<\/code><\/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;\">ID \u8ffd\u8e2a<\/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;\">tool_call_id<\/code> \u8ba9\u7ed3\u679c\u7cbe\u786e\u5bf9\u5e94\u5230\u8c03\u7528&#8221;<\/section>\n<\/li>\n<\/ul>\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);\">\u65e7\u7248 ReAct<\/th>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid rgb(245, 230, 200);\">\u5b98\u65b9 FC \u7248 ReAct<\/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;\">\u81ea\u5b9a\u4e49 JSON \u534f\u8bae<\/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;\">\u539f\u751f <code>tool_calls<\/code> \u5b57\u6bb5<\/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;\">\u683c\u5f0f\u4e0d\u7a33\u5b9a\uff0c\u9700\u8981\u5bb9\u9519<\/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;\">SDK \u4fdd\u8bc1\u683c\u5f0f\u6b63\u786e<\/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;\">Observation \u5199\u6210 user \u6587\u672c<\/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;\">\u6807\u51c6 <code>role=tool<\/code> \u6d88\u606f<\/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;\">\u591a\u5de5\u5177\u5e76\u884c\u5b9e\u73b0\u590d\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;\">\u5929\u7136\u652f\u6301\u5e76\u884c <code>tool_calls<\/code><\/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;\">\u4f9d\u8d56 prompt \u5de5\u7a0b<\/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;\">\u4f9d\u8d56\u534f\u8bae\uff0cprompt \u66f4\u7b80\u6d01<\/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;\">&#8220;\u601d\u60f3\u6ca1\u53d8\u2014\u2014Thought \u2192 Action \u2192 Observation \u5faa\u73af\u3002\u53d8\u7684\u662f\u8f7d\u4f53\u2014\u2014\u4ece\u624b\u5199 JSON \u53d8\u6210\u4e86\u539f\u751f\u534f\u8bae\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;\">\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;\u8fd9\u4e00\u7bc7\uff0c\u4f60\u628a Agent \u4ece&#8217;\u80fd\u8c03\u5de5\u5177&#8217;\u53d8\u6210\u4e86&#8217;\u80fd\u81ea\u4e3b\u51b3\u7b56&#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;\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;\">ReAct \u5c31\u662f while \u5faa\u73af<\/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;\">while tool_calls \u2192 \u6267\u884c \u2192 \u7ee7\u7eed<\/code>\uff0c\u76f4\u5230\u6a21\u578b\u89c9\u5f97\u591f\u4e86<\/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;\"><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;\">tool_calls<\/code> \u662f\u4fe1\u53f7<\/strong>\u2014\u2014\u6709\u5c31\u7ee7\u7eed\uff0c\u6ca1\u6709\u5c31\u7ed3\u675f\u3002\u4e0d\u9700\u8981\u4efb\u4f55\u989d\u5916\u7684\u5224\u65ad\u903b\u8f91<\/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;\"><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;\">max_steps<\/code> + <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;\">tools=None<\/code> \u515c\u5e95<\/strong>\u2014\u2014\u9632\u65e0\u9650\u5faa\u73af\uff0c\u5f3a\u5236\u6536\u5c3e<\/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;\">\u8ddf\u4e4b\u524d\u7684\u6587\u7ae0\u4e32\u8d77\u6765\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 \u8ba9\u6a21\u578b\"\u4f1a\u7528\u5de5\u5177\"\n\u5de5\u5177\u6ce8\u518c\u8868   \u2192 \u8ba9\u6a21\u578b\"\u65b9\u4fbf\u7528\u5f88\u591a\u5de5\u5177\"\nMCP      \u2192 \u8ba9\u6a21\u578b\"\u7528\u5168\u4e16\u754c\u7684\u5de5\u5177\"\n\u8bb0\u5fc6       \u2192 \u8ba9\u6a21\u578b\"\u8bb0\u4f4f\u5bf9\u8bdd\u5386\u53f2\"\nReAct \u5faa\u73af   \u2192 \u8ba9\u6a21\u578b\"\u81ea\u5df1\u51b3\u5b9a\u7528\u51e0\u6b21\u3001\u7528\u4ec0\u4e48\"\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: rgb(51, 51, 51); text-indent: 0px; padding-left: 0px;\">\u6bcf\u4e00\u6b65\u90fd\u5728\u8ba9 Agent \u66f4\u81ea\u4e3b\u3002\u5230\u4e86 ReAct \u5faa\u73af\u8fd9\u4e00\u6b65\uff0cAgent \u5df2\u7ecf\u5177\u5907\u4e86&#8217;\u63a5\u5230\u4efb\u52a1 \u2192 \u5206\u89e3\u6b65\u9aa4 \u2192 \u8c03\u7528\u5de5\u5177 \u2192 \u7efc\u5408\u5206\u6790 \u2192 \u7ed9\u51fa\u7b54\u6848&#8217; \u7684\u5b8c\u6574\u80fd\u529b\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\u8bf4\uff1a&#8221;\u90a3\u6211\u7406\u89e3\u4e86\u3002ReAct \u4e0d\u662f\u53e6\u4e00\u4e2a\u529f\u80fd\uff0c\u662f\u628a\u524d\u9762\u6240\u6709\u80fd\u529b\u4e32\u8d77\u6765\u7684<strong style=\"color: rgb(51, 51, 51); font-weight: bold;\">\u8fd0\u884c\u5f15\u64ce<\/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\u4f60\u4ee5\u524d\u5199\u7684\u4ee3\u7801\uff0c\u6a21\u578b\u662f\u88ab\u52a8\u7684\u2014\u2014\u4f60\u8bf4\u8c03\u4ec0\u4e48\u5b83\u8c03\u4ec0\u4e48\u3002\u73b0\u5728\u6a21\u578b\u662f\u4e3b\u52a8\u7684\u2014\u2014\u5b83\u81ea\u5df1\u51b3\u5b9a\u4e0b\u4e00\u6b65\u505a\u4ec0\u4e48\u3002\u8fd9\u4e2a\u4ece\u88ab\u52a8\u5230\u4e3b\u52a8\u7684\u8f6c\u53d8\uff0c\u5c31\u662f Agent \u7684\u7075\u9b42\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\u7075\u9b42\u4e0d\u662f\u80fd\u8c03\u591a\u5c11\u4e2a\u5de5\u5177\uff0c\u800c\u662f\u80fd\u81ea\u5df1\u51b3\u5b9a\u4e0b\u4e00\u6b65\u505a\u4ec0\u4e48\u3002<\/strong><\/p>\n<\/blockquote>\n<\/section>\n","protected":false},"excerpt":{"rendered":"<p>\u4e0a\u7bc7\u4f60\u7ed9 Agent \u52a0\u4e0a\u4e86\u8bb0\u5fc6\u2014\u2014\u6d88\u606f\u94fe\u8ba9\u5b83\u8bb0\u4f4f\u6574\u4e2a\u4f1a\u8bdd\u3002\u4f46\u8bb0\u5fc6\u53ea\u662f\u57fa\u7840\uff0c\u771f\u6b63\u7684 Agent \u9700\u8981\u53cd\u590d\u601d\u8003\u3001 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3773,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[163,164],"tags":[167,168,175],"_links":{"self":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/3772"}],"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=3772"}],"version-history":[{"count":1,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/3772\/revisions"}],"predecessor-version":[{"id":3774,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/3772\/revisions\/3774"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/media\/3773"}],"wp:attachment":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3772"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3772"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3772"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}