{"id":3628,"date":"2026-08-17T10:23:57","date_gmt":"2026-08-17T02:23:57","guid":{"rendered":"https:\/\/ai.zhousir.top\/?p=3628"},"modified":"2026-08-17T10:23:57","modified_gmt":"2026-08-17T02:23:57","slug":"%e5%a4%9a%e5%b7%a5%e5%85%b7%e4%bd%bf%e7%94%a8-%e4%bb%8e%e7%a1%ac%e7%bc%96%e7%a0%81%e5%88%b0%e6%b3%a8%e5%86%8c%e8%a1%a8","status":"publish","type":"post","link":"https:\/\/ai.zhousir.top\/?p=3628","title":{"rendered":"\u591a\u5de5\u5177\u4f7f\u7528-\u4ece\u786c\u7f16\u7801\u5230\u6ce8\u518c\u8868"},"content":{"rendered":"<section id=\"wenyan\" style=\"font-family: system-ui, 'Apple Color Emoji', 'Segoe UI', 'Segoe UI Symbol', 'Noto Sans', Roboto, sans-serif; word-break: break-word; overflow-wrap: break-word; color: #000000; font-size: 16px; line-height: 1.75; caret-color: #000000;\" data-provider=\"WenYan\">\n<blockquote style=\"color: #555555; background-color: #fff9eb; 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 #f8b43f; border-radius: 6px; font-style: normal; quotes: none;\">\n<p style=\"margin: 0.55em 0px; color: #555555; text-indent: 0px; padding: 0px; line-height: 1.75; font-style: normal; background: transparent;\">\u4e0a\u7bc7\u4f60\u5b66\u4f1a\u4e86 Function Calling\u2014\u2014\u8ba9 AI \u4ece&#8221;\u4f1a\u8bf4&#8221;\u53d8\u6210&#8221;\u4f1a\u5e72&#8221;\u3002\u4f46\u5f53\u5de5\u5177\u4ece 2 \u4e2a\u53d8\u6210 10 \u4e2a\u300120 \u4e2a\uff0c\u4ee3\u7801\u5c31\u5f00\u59cb\u5931\u63a7\u4e86\u3002\u8fd9\u7bc7\u8bb2\u600e\u4e48\u7528<strong style=\"color: #333333; font-weight: bold;\">\u5de5\u5177\u6ce8\u518c\u8868\u6a21\u5f0f<\/strong>\uff0c\u628a\u5de5\u5177\u7ba1\u7406\u8fd9\u4ef6\u4e8b\u53d8\u5f97\u5e72\u51c0\u5229\u843d\u3002<\/p>\n<\/blockquote>\n<hr style=\"border-width: 1px medium medium; border-style: solid none none; border-color: #f0e6d0 currentcolor currentcolor; margin: 24px 0px;\" \/>\n<h2 style=\"display: inline-block; position: relative; font-weight: bold; color: #333333; line-height: 1.5; margin-top: 32px; margin-bottom: 16px; padding: 0px 6px 2px; text-align: left; background: linear-gradient(to top, #f8b43f 42%, transparent 42%); box-decoration-break: clone; -webkit-box-decoration-break: clone; font-size: 17px; border: medium none currentcolor;\"><span style=\"color: #333333; font-weight: bold;\">\u75db\u70b9\uff1a\u5de5\u5177\u4e00\u591a\uff0c\u4ee3\u7801\u5c31\u4e71<\/span><\/h2>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u5c0f\u660e\u6700\u8fd1\u5f88\u5f97\u610f\u3002Function Calling \u8dd1\u901a\u4e86\uff0cAI \u80fd\u67e5\u5929\u6c14\u3001\u80fd\u641c\u65b0\u95fb\uff0c\u8001\u677f\u5938\u4e86\u4ed6\u4e24\u53e5\u3002<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u7136\u540e\u8001\u677f\u8bf4\uff1a&#8221;\u518d\u52a0\u51e0\u4e2a\u529f\u80fd\u5427\u2014\u2014\u67e5\u80a1\u7968\u3001\u67e5\u5feb\u9012\u3001\u7b97\u6c47\u7387\u3001\u7ffb\u8bd1\u3001\u67e5\u6570\u636e\u5e93\u2026\u2026\u5148\u4e0a\u5341\u4e2a\u3002&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u5c0f\u660e\u5fc3\u60f3\u8fd9\u8fd8\u4e0d\u7b80\u5355\uff1f\u590d\u5236\u7c98\u8d34\u5457\u3002\u6253\u5f00\u4ee3\u7801\u4e00\u770b\uff0c\u50bb\u773c\u4e86\u2014\u2014<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u6bcf\u52a0\u4e00\u4e2a\u5de5\u5177\uff0c\u8981\u6539 <strong style=\"color: #333333; font-weight: bold;\">3 \u4e2a\u5730\u65b9<\/strong>\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: #fff9eb; color: #333333; text-align: left;\">\n<tr>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8;\" align=\"left\">\u6539\u52a8\u4f4d\u7f6e<\/th>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8;\" align=\"left\">\u5e72\u4ec0\u4e48<\/th>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8;\" align=\"left\">\u4e3e\u4f8b<\/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 #f5e6c8; min-width: 100px;\" align=\"left\">\u5de5\u5177\u5217\u8868 <code>tools<\/code><\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u52a0\u4e00\u6bb5 JSON Schema \u5b9a\u4e49<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u544a\u8bc9\u6a21\u578b\u6709\u8fd9\u4e2a\u5de5\u5177<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u6620\u5c04\u8868 <code>available_functions<\/code><\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u52a0\u4e00\u884c\u51fd\u6570\u6620\u5c04<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><code>\"query_stock\": query_stock<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u6267\u884c\u903b\u8f91<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u52a0 if-else \u6216\u4fee\u6539\u5faa\u73af<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u5904\u7406\u8fd9\u4e2a\u5de5\u5177\u7684\u7279\u6b8a\u903b\u8f91<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<section style=\"display: block; background-repeat: no-repeat; width: 100%; height: 16px;\"><\/section>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Courier New', 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: #002b36;\"><code class=\"hljs language-python\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', 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: #93a1a1; background: #002b36;\"><span class=\"hljs-comment\" style=\"color: #657b83;\">#\u00a0\u786c\u7f16\u7801\u65f6\u4ee3\u7684\u65e5\u5e38\uff1a\u6bcf\u52a0\u4e00\u4e2a\u5de5\u5177\uff0c\u4e09\u4e2a\u5730\u65b9\u90fd\u8981\u6539<\/span>\ntools\u00a0=\u00a0[\n\u00a0\u00a0{<span class=\"hljs-string\" style=\"color: #859900;\">\"type\"<\/span>:\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"function\"<\/span>,\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"function\"<\/span>:\u00a0{<span class=\"hljs-string\" style=\"color: #859900;\">\"name\"<\/span>:\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"get_weather\"<\/span>,\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"description\"<\/span>:\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"...\"<\/span>,\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"parameters\"<\/span>:\u00a0{...}}},\n\u00a0\u00a0{<span class=\"hljs-string\" style=\"color: #859900;\">\"type\"<\/span>:\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"function\"<\/span>,\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"function\"<\/span>:\u00a0{<span class=\"hljs-string\" style=\"color: #859900;\">\"name\"<\/span>:\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"get_news\"<\/span>,\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"description\"<\/span>:\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"...\"<\/span>,\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"parameters\"<\/span>:\u00a0{...}}},\n\u00a0\u00a0<span class=\"hljs-comment\" style=\"color: #657b83;\">#\u00a0\u60f3\u52a0\u7b2c\u5341\u4e2a\uff1f\u7ee7\u7eed\u590d\u5236\u7c98\u8d34\u2026\u2026<\/span>\n]\n\navailable_functions\u00a0=\u00a0{\n\u00a0\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"get_weather\"<\/span>:\u00a0get_weather,\n\u00a0\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"get_news\"<\/span>:\u00a0get_news,\n\u00a0\u00a0<span class=\"hljs-comment\" style=\"color: #657b83;\">#\u00a0\u7ee7\u7eed\u52a0\u2026\u2026<\/span>\n}\n\n<span class=\"hljs-comment\" style=\"color: #657b83;\">#\u00a0\u6267\u884c\u903b\u8f91\u91cc\u8fd8\u6709\u7279\u6b8a\u5904\u7406<\/span>\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">if<\/span>\u00a0func_name\u00a0==\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"get_news\"<\/span>\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">and<\/span>\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">not<\/span>\u00a0func_args.get(<span class=\"hljs-string\" style=\"color: #859900;\">\"query\"<\/span>):\n\u00a0\u00a0func_args[<span class=\"hljs-string\" style=\"color: #859900;\">\"query\"<\/span>]\u00a0=\u00a0user_message\u00a0\u00a0<span class=\"hljs-comment\" style=\"color: #657b83;\">#\u00a0\u641c\u7d22\u5173\u952e\u8bcd\u7f3a\u5931\u65f6\u7528\u7528\u6237\u539f\u8bdd<\/span>\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u5c0f\u660e\u53bb\u627e\u8001\u5f20\uff1a&#8221;\u8fd9\u4e0d\u5bf9\u52b2\u554a\u3002\u5341\u4e2a\u5de5\u5177\u5c31\u662f 30 \u5904\u6539\u52a8\uff0c\u6f0f\u6539\u4e00\u4e2a\u5c31\u51fa bug\u3002\u800c\u4e14 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">description<\/code> \u548c <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">parameters<\/code> \u6563\u843d\u5728\u4ee3\u7801\u5404\u5904\uff0c\u627e\u4e2a\u5b9a\u4e49\u8981\u7ffb\u534a\u5929\u3002&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u8001\u5f20\u8bf4\uff1a&#8221;\u4f60\u9047\u5230\u7684\u662f\u7ecf\u5178\u7684<strong style=\"color: #333333; font-weight: bold;\">\u5de5\u7a0b\u5316\u95ee\u9898<\/strong>\u3002\u5de5\u5177\u5c11\u7684\u65f6\u5019\u786c\u7f16\u7801\u6ca1\u95ee\u9898\uff0c\u8d85\u8fc7 3 \u4e2a\u5c31\u8be5\u4e0a\u6ce8\u518c\u8868\u4e86\u3002&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u6ce8\u518c\u8868\uff1f&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u4e00\u53e5\u8bdd\u2014\u2014<strong style=\"color: #333333; font-weight: bold;\">\u65b0\u589e\u5de5\u5177\u53ea\u9700 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">register()<\/code> \u4e00\u884c<\/strong>\uff0c\u5176\u4f59\u5168\u81ea\u52a8\u3002&#8221;<\/p>\n<hr style=\"border-width: 1px medium medium; border-style: solid none none; border-color: #f0e6d0 currentcolor currentcolor; margin: 24px 0px;\" \/>\n<h2 style=\"display: inline-block; position: relative; font-weight: bold; color: #333333; line-height: 1.5; margin-top: 32px; margin-bottom: 16px; padding: 0px 6px 2px; text-align: left; background: linear-gradient(to top, #f8b43f 42%, transparent 42%); box-decoration-break: clone; -webkit-box-decoration-break: clone; font-size: 17px; border: medium none currentcolor;\"><span style=\"color: #333333; font-weight: bold;\">\u6838\u5fc3\u601d\u8def\uff1a\u628a&#8221;\u5de5\u5177\u5b9a\u4e49&#8221;\u548c&#8221;\u5bf9\u8bdd\u7f16\u6392&#8221;\u89e3\u8026<\/span><\/h2>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u8001\u5f20\u5728\u767d\u677f\u4e0a\u753b\u4e86\u5f20\u56fe\uff1a<\/p>\n<section style=\"display: block; background-repeat: no-repeat; width: 100%; height: 16px;\"><\/section>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Courier New', 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: #002b36;\"><code class=\"hljs\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', 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: #93a1a1; background: #002b36;\">\u786c\u7f16\u7801\u6a21\u5f0f\uff1a\n\u00a0\u00a0tools\u00a0=\u00a0[...]\u00a0\u2190\u00a0\u624b\u52a8\u7ef4\u62a4\n\u00a0\u00a0available_functions\u00a0=\u00a0{...}\u00a0\u2190\u00a0\u624b\u52a8\u7ef4\u62a4\n\u00a0\u00a0\u6267\u884c\u903b\u8f91\u00a0\u2190\u00a0\u624b\u52a8\u5199\u00a0if-else\n\u00a0\u00a0Agent\u00a0\u7f16\u6392\u00a0\u2190\u00a0\u548c\u4e0a\u9762\u4e09\u5768\u8026\u5408\u5728\u4e00\u8d77\n\n\u6ce8\u518c\u8868\u6a21\u5f0f\uff1a\n\u00a0\u00a0tools\/weather.py\u00a0\u00a0\u00a0\u2190\u00a0\u5de5\u5177\u5b9e\u73b0\uff08\u72ec\u7acb\u6587\u4ef6\uff09\n\u00a0\u00a0tools\/news.py\u00a0\u00a0\u00a0\u00a0\u2190\u00a0\u5de5\u5177\u5b9e\u73b0\uff08\u72ec\u7acb\u6587\u4ef6\uff09\n\u00a0\u00a0\u00a0\u00a0\u00a0\u2193\n\u00a0\u00a0register()\u00a0\u00a0\u00a0\u00a0\u00a0\u2190\u00a0\u4e00\u884c\u6ce8\u518c\n\u00a0\u00a0\u00a0\u00a0\u00a0\u2193\n\u00a0\u00a0_REGISTRY\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u2190\u00a0\u5168\u5c40\u6ce8\u518c\u8868\uff08\u552f\u4e00\u6570\u636e\u6e90\uff09\n\u00a0\u00a0\u00a0\u00a0\u00a0\u2193\n\u00a0\u00a0get_openai_tools()\u00a0\u2190\u00a0\u81ea\u52a8\u751f\u6210\u00a0tools\u00a0\u5217\u8868\n\u00a0\u00a0execute()\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u2190\u00a0\u7edf\u4e00\u6267\u884c\u5165\u53e3\n\u00a0\u00a0\u00a0\u00a0\u00a0\u2193\n\u00a0\u00a0Agent\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u2190\u00a0\u53ea\u7ba1\u7f16\u6392\uff0c\u4e0d\u5173\u5fc3\u5177\u4f53\u6709\u54ea\u4e9b\u5de5\u5177\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u770b\u5230\u4e86\u5427\uff1fAgent \u4ee3\u7801\u4e0d\u518d\u5173\u5fc3&#8217;\u6709\u54ea\u4e9b\u5de5\u5177&#8217;\uff0c\u5b83\u53ea\u7ba1\u8c03 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">get_openai_tools()<\/code> \u62ff\u5217\u8868\u3001\u8c03 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">execute()<\/code> \u6267\u884c\u3002<strong style=\"color: #333333; font-weight: bold;\">\u5de5\u5177\u7684\u589e\u5220\u6539\u548c\u5bf9\u8bdd\u903b\u8f91\u5b8c\u5168\u89e3\u8026\u3002<\/strong>&#8220;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u5c0f\u660e\u95ee\uff1a&#8221;\u600e\u4e48\u505a\u5230\u7684\uff1f&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u4e09\u4e2a\u7ec4\u4ef6\uff1a<strong style=\"color: #333333; font-weight: bold;\">ToolSpec \u5b58\u5b9a\u4e49\u3001Registry \u7ba1\u6ce8\u518c\u3001execute \u505a\u6267\u884c<\/strong>\u3002\u9010\u4e2a\u8bb2\u3002&#8221;<\/p>\n<hr style=\"border-width: 1px medium medium; border-style: solid none none; border-color: #f0e6d0 currentcolor currentcolor; margin: 24px 0px;\" \/>\n<h2 style=\"display: inline-block; position: relative; font-weight: bold; color: #333333; line-height: 1.5; margin-top: 32px; margin-bottom: 16px; padding: 0px 6px 2px; text-align: left; background: linear-gradient(to top, #f8b43f 42%, transparent 42%); box-decoration-break: clone; -webkit-box-decoration-break: clone; font-size: 17px; border: medium none currentcolor;\"><span style=\"color: #333333; font-weight: bold;\">\u7ec4\u4ef6\u4e00\uff1aToolSpec\u2014\u2014\u5de5\u5177\u7684&#8221;\u8eab\u4efd\u8bc1&#8221;<\/span><\/h2>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u8001\u5f20\u8bf4\uff1a&#8221;\u6bcf\u4e2a\u5de5\u5177\u9700\u8981\u643a\u5e26\u5f88\u591a\u4fe1\u606f\u2014\u2014\u51fd\u6570\u672c\u8eab\u3001\u7ed9\u6a21\u578b\u770b\u7684\u63cf\u8ff0\u3001\u53c2\u6570\u5b9a\u4e49\u3001\u4e2d\u6587\u540d\u3001\u53c2\u6570\u56de\u9000\u7b56\u7565\u3002\u7528\u4e00\u4e2a dataclass \u628a\u5b83\u4eec\u6253\u5305\uff1a&#8221;<\/p>\n<section style=\"display: block; background-repeat: no-repeat; width: 100%; height: 16px;\"><\/section>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Courier New', 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: #002b36;\"><code class=\"hljs language-python\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', 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: #93a1a1; background: #002b36;\"><span class=\"hljs-keyword\" style=\"color: #6c71c4;\">from<\/span>\u00a0dataclasses\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">import<\/span>\u00a0dataclass,\u00a0field\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">from<\/span>\u00a0typing\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">import<\/span>\u00a0<span class=\"hljs-type\" style=\"color: #6c71c4;\">Callable<\/span>\n\n<span class=\"hljs-meta\" style=\"color: #d33682;\">@dataclass<\/span>\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">class<\/span>\u00a0<span class=\"hljs-title class_\" style=\"color: #b58900;\">ToolSpec<\/span>:\n\u00a0\u00a0func:\u00a0<span class=\"hljs-type\" style=\"color: #6c71c4;\">Callable<\/span>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-comment\" style=\"color: #657b83;\">#\u00a0\u5b9e\u9645\u00a0Python\u00a0\u51fd\u6570<\/span>\n\u00a0\u00a0description:\u00a0<span class=\"hljs-built_in\" style=\"color: #2aa198;\">str<\/span>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-comment\" style=\"color: #657b83;\">#\u00a0\u7ed9\u6a21\u578b\u770b\u7684\u63cf\u8ff0<\/span>\n\u00a0\u00a0parameters:\u00a0<span class=\"hljs-built_in\" style=\"color: #2aa198;\">dict<\/span>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-comment\" style=\"color: #657b83;\">#\u00a0JSON\u00a0Schema\u00a0\u53c2\u6570\u5b9a\u4e49<\/span>\n\u00a0\u00a0label:\u00a0<span class=\"hljs-built_in\" style=\"color: #2aa198;\">str<\/span>\u00a0=\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"\"<\/span>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-comment\" style=\"color: #657b83;\">#\u00a0\u7b80\u77ed\u4e2d\u6587\u540d\uff08UI\u00a0\u5c55\u793a\u7528\uff09<\/span>\n\u00a0\u00a0fill_from_user:\u00a0<span class=\"hljs-built_in\" style=\"color: #2aa198;\">list<\/span>[<span class=\"hljs-built_in\" style=\"color: #2aa198;\">str<\/span>]\u00a0=\u00a0field(default_factory=<span class=\"hljs-built_in\" style=\"color: #2aa198;\">list<\/span>)\u00a0\u00a0<span class=\"hljs-comment\" style=\"color: #657b83;\">#\u00a0\u53c2\u6570\u56de\u9000<\/span>\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u9010\u5b57\u6bb5\u89e3\u91ca\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: #fff9eb; color: #333333; text-align: left;\">\n<tr>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8;\" align=\"left\">\u5b57\u6bb5<\/th>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8;\" align=\"left\">\u4f5c\u7528<\/th>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8;\" align=\"left\">\u4e3e\u4f8b<\/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 #f5e6c8; min-width: 100px;\" align=\"left\"><code>func<\/code><\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u771f\u6b63\u5e72\u6d3b\u7684 Python \u51fd\u6570<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><code>get_current_weather_online<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><code>description<\/code><\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u6a21\u578b\u9760\u5b83\u5224\u65ad\u4f55\u65f6\u8c03\u7528<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><code>\"\u83b7\u53d6\u6307\u5b9a\u57ce\u5e02\u5f53\u524d\u7684\u5929\u6c14\u60c5\u51b5\"<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><code>parameters<\/code><\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">JSON Schema\uff0c\u63cf\u8ff0\u53c2\u6570\u7ed3\u6784<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><code>{\"type\": \"object\", \"properties\": {...}}<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><code>label<\/code><\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u4e2d\u6587\u540d\uff0c\u7ed9 UI \u6216\u65e5\u5fd7\u5c55\u793a\u7528<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><code>\"\u5929\u6c14\"<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><code>fill_from_user<\/code><\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u53c2\u6570\u7f3a\u5931\u65f6\u7528\u7528\u6237\u539f\u8bdd\u586b\u5145<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><code>[\"query\"]<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u5c0f\u660e\u95ee\uff1a&#8221;\u8fd9\u4e2a <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">fill_from_user<\/code> \u662f\u4ec0\u4e48\u610f\u601d\uff1f&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u8fd8\u8bb0\u5f97\u4f60\u4e4b\u524d\u641c\u7d22\u5de5\u5177\u90a3\u4e2a\u7279\u6b8a\u5904\u7406\u5417\uff1f\u6a21\u578b\u6709\u65f6\u5019\u4e0d\u4f20 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">query<\/code> \u53c2\u6570\uff0c\u4f60\u60f3\u7528\u7528\u6237\u539f\u8bdd\u515c\u5e95\u3002\u4e4b\u524d\u662f\u786c\u7f16\u7801\u5728\u6267\u884c\u903b\u8f91\u91cc\u7684 if-else\uff0c\u73b0\u5728\u53d8\u6210\u4e00\u4e2a\u914d\u7f6e\u9879\u2014\u2014\u6ce8\u518c\u65f6\u58f0\u660e <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">fill_from_user=[\"query\"]<\/code>\uff0c\u6267\u884c\u65f6\u81ea\u52a8\u515c\u5e95\u3002&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u539f\u6765\u662f\u628a\u7279\u6b8a\u903b\u8f91\u53d8\u6210\u4e86\u914d\u7f6e\u9879\u3002&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u5bf9\u3002<strong style=\"color: #333333; font-weight: bold;\">\u914d\u7f6e\u4f18\u4e8e\u7f16\u7801<\/strong>\u2014\u2014\u80fd\u914d\u7f6e\u7684\u5c31\u4e0d\u8981\u5199\u6b7b\u3002&#8221;<\/p>\n<hr style=\"border-width: 1px medium medium; border-style: solid none none; border-color: #f0e6d0 currentcolor currentcolor; margin: 24px 0px;\" \/>\n<h2 style=\"display: inline-block; position: relative; font-weight: bold; color: #333333; line-height: 1.5; margin-top: 32px; margin-bottom: 16px; padding: 0px 6px 2px; text-align: left; background: linear-gradient(to top, #f8b43f 42%, transparent 42%); box-decoration-break: clone; -webkit-box-decoration-break: clone; font-size: 17px; border: medium none currentcolor;\"><span style=\"color: #333333; font-weight: bold;\">\u7ec4\u4ef6\u4e8c\uff1aRegistry\u2014\u2014\u6ce8\u518c\u8868<\/span><\/h2>\n<h3 style=\"font-size: 16px; font-weight: bold; color: #333333; line-height: 1.5; margin-top: 24px; margin-bottom: 12px; padding-left: 12px; border-left: 4px solid #f8b43f;\"><span style=\"color: #333333; font-weight: bold;\">\u6ce8\u518c\u51fd\u6570<\/span><\/h3>\n<section style=\"display: block; background-repeat: no-repeat; width: 100%; height: 16px;\"><\/section>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Courier New', 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: #002b36;\"><code class=\"hljs language-python\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', 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: #93a1a1; background: #002b36;\">_REGISTRY:\u00a0<span class=\"hljs-built_in\" style=\"color: #2aa198;\">dict<\/span>[<span class=\"hljs-built_in\" style=\"color: #2aa198;\">str<\/span>,\u00a0ToolSpec]\u00a0=\u00a0{}\n\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">def<\/span>\u00a0<span class=\"hljs-title function_\" style=\"color: #268bd2;\">register<\/span>(<span class=\"hljs-params\">func,\u00a0description,\u00a0parameters,\u00a0label=<span class=\"hljs-string\" style=\"color: #859900;\">\"\"<\/span>,\u00a0fill_from_user=<span class=\"hljs-literal\" style=\"color: #cb4b16;\">None<\/span><\/span>):\n\u00a0\u00a0_REGISTRY[func.__name__]\u00a0=\u00a0ToolSpec(\n\u00a0\u00a0\u00a0\u00a0func=func,\n\u00a0\u00a0\u00a0\u00a0description=description,\n\u00a0\u00a0\u00a0\u00a0parameters=parameters,\n\u00a0\u00a0\u00a0\u00a0label=label\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">or<\/span>\u00a0func.__name__,\n\u00a0\u00a0\u00a0\u00a0fill_from_user=fill_from_user\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">or<\/span>\u00a0[],\n\u00a0\u00a0)\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u6838\u5fc3\u5c31\u662f\u4e00\u4e2a\u5b57\u5178\u2014\u2014<code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">_REGISTRY<\/code>\u3002\u952e\u662f\u51fd\u6570\u540d\uff0c\u503c\u662f <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">ToolSpec<\/code>\u3002<code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">register()<\/code> \u505a\u7684\u4e8b\u5c31\u662f\u628a\u51fd\u6570\u548c\u5b83\u7684\u5143\u4fe1\u606f\u6253\u5305\u5b58\u8fdb\u53bb\u3002&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u7528\u51fd\u6570\u540d <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">func.__name__<\/code> \u4f5c\u4e3a\u952e\uff0c\u4fdd\u8bc1\u548c\u6a21\u578b\u8fd4\u56de\u7684\u51fd\u6570\u540d\u5929\u7136\u5bf9\u5e94\u2014\u2014\u6a21\u578b\u8bf4\u8c03 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">get_current_weather_online<\/code>\uff0c\u4f60\u76f4\u63a5\u5728\u6ce8\u518c\u8868\u91cc\u67e5\u8fd9\u4e2a\u540d\u5b57\u3002&#8221;<\/p>\n<h3 style=\"font-size: 16px; font-weight: bold; color: #333333; line-height: 1.5; margin-top: 24px; margin-bottom: 12px; padding-left: 12px; border-left: 4px solid #f8b43f;\"><span style=\"color: #333333; font-weight: bold;\">\u81ea\u52a8\u751f\u6210 OpenAI Tools<\/span><\/h3>\n<section style=\"display: block; background-repeat: no-repeat; width: 100%; height: 16px;\"><\/section>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Courier New', 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: #002b36;\"><code class=\"hljs language-python\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', 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: #93a1a1; background: #002b36;\"><span class=\"hljs-keyword\" style=\"color: #6c71c4;\">def<\/span>\u00a0<span class=\"hljs-title function_\" style=\"color: #268bd2;\">get_openai_tools<\/span>()\u00a0-&gt;\u00a0<span class=\"hljs-built_in\" style=\"color: #2aa198;\">list<\/span>[<span class=\"hljs-built_in\" style=\"color: #2aa198;\">dict<\/span>]:\n\u00a0\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">return<\/span>\u00a0[\n\u00a0\u00a0\u00a0\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"type\"<\/span>:\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"function\"<\/span>,\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"function\"<\/span>:\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"name\"<\/span>:\u00a0name,\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"description\"<\/span>:\u00a0spec.description,\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"parameters\"<\/span>:\u00a0spec.parameters,\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0},\n\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">for<\/span>\u00a0name,\u00a0spec\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">in<\/span>\u00a0_REGISTRY.items()\n\u00a0\u00a0]\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u5c0f\u660e\u8bf4\uff1a&#8221;\u8fd9\u4e0d\u5c31\u662f\u904d\u5386\u6ce8\u518c\u8868\uff0c\u628a\u6bcf\u4e2a <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">ToolSpec<\/code> \u8f6c\u6210 OpenAI \u8981\u6c42\u7684\u683c\u5f0f\u5417\uff1f&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u5bf9\u3002\u4ee5\u524d\u4f60\u624b\u52a8\u7ef4\u62a4 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">tools<\/code> \u5217\u8868\uff0c\u73b0\u5728<strong style=\"color: #333333; font-weight: bold;\">\u81ea\u52a8\u751f\u6210<\/strong>\u3002\u6ce8\u518c\u8868\u662f\u552f\u4e00\u6570\u636e\u6e90\uff0c<code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">get_openai_tools()<\/code> \u53ea\u662f\u4e2a\u683c\u5f0f\u8f6c\u6362\u5668\u3002\u6c38\u8fdc\u4e0d\u4f1a\u51fa\u73b0&#8217;tools \u5217\u8868\u91cc\u6709\u4f46\u6620\u5c04\u8868\u91cc\u6ca1\u6709&#8217;\u8fd9\u79cd\u4e0d\u4e00\u81f4\u95ee\u9898\u3002&#8221;<\/p>\n<h3 style=\"font-size: 16px; font-weight: bold; color: #333333; line-height: 1.5; margin-top: 24px; margin-bottom: 12px; padding-left: 12px; border-left: 4px solid #f8b43f;\"><span style=\"color: #333333; font-weight: bold;\">\u7edf\u4e00\u6267\u884c\u5165\u53e3<\/span><\/h3>\n<section style=\"display: block; background-repeat: no-repeat; width: 100%; height: 16px;\"><\/section>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Courier New', 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: #002b36;\"><code class=\"hljs language-python\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', 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: #93a1a1; background: #002b36;\"><span class=\"hljs-keyword\" style=\"color: #6c71c4;\">def<\/span>\u00a0<span class=\"hljs-title function_\" style=\"color: #268bd2;\">execute<\/span>(<span class=\"hljs-params\">name,\u00a0args,\u00a0user_message=<span class=\"hljs-string\" style=\"color: #859900;\">\"\"<\/span><\/span>)\u00a0-&gt;\u00a0<span class=\"hljs-built_in\" style=\"color: #2aa198;\">str<\/span>:\n\u00a0\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">if<\/span>\u00a0name\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">not<\/span>\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">in<\/span>\u00a0_REGISTRY:\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">return<\/span>\u00a0json.dumps({<span class=\"hljs-string\" style=\"color: #859900;\">\"error\"<\/span>:\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">f\"\u672a\u77e5\u5de5\u5177:\u00a0<span class=\"hljs-subst\" style=\"color: #93a1a1;\">{name}<\/span>\"<\/span>},\u00a0ensure_ascii=<span class=\"hljs-literal\" style=\"color: #cb4b16;\">False<\/span>)\n\n\u00a0\u00a0spec\u00a0=\u00a0_REGISTRY[name]\n\n\u00a0\u00a0<span class=\"hljs-comment\" style=\"color: #657b83;\">#\u00a0\u53c2\u6570\u56de\u9000\uff1a\u6a21\u578b\u6f0f\u4f20\u65f6\u7528\u7528\u6237\u539f\u8bdd\u586b\u5145<\/span>\n\u00a0\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">for<\/span>\u00a0key\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">in<\/span>\u00a0spec.fill_from_user:\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">if<\/span>\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">not<\/span>\u00a0args.get(key)\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">and<\/span>\u00a0user_message:\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0args[key]\u00a0=\u00a0user_message\n\n\u00a0\u00a0result\u00a0=\u00a0spec.func(**args)\n\u00a0\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">return<\/span>\u00a0json.dumps(result,\u00a0ensure_ascii=<span class=\"hljs-literal\" style=\"color: #cb4b16;\">False<\/span>)\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u8001\u5f20\u9010\u884c\u8bb2\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: #333333; list-style: inherit;\">\n<section><strong style=\"color: #333333; font-weight: bold;\">\u67e5\u6ce8\u518c\u8868<\/strong> \u2014 \u51fd\u6570\u540d\u4e0d\u5728\u8868\u91cc\uff1f\u8fd4\u56de\u9519\u8bef JSON\uff0c\u4e0d\u4f1a KeyError \u5d29\u6e83<\/section>\n<\/li>\n<li style=\"margin-bottom: 8px; padding-left: 0px; text-indent: 0px; color: #333333; list-style: inherit;\">\n<section><strong style=\"color: #333333; font-weight: bold;\">\u53c2\u6570\u56de\u9000<\/strong> \u2014 \u904d\u5386 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">fill_from_user<\/code>\uff0c\u7f3a\u5931\u7684\u53c2\u6570\u7528\u7528\u6237\u539f\u8bdd\u8865\u4e0a<\/section>\n<\/li>\n<li style=\"margin-bottom: 8px; padding-left: 0px; text-indent: 0px; color: #333333; list-style: inherit;\">\n<section><strong style=\"color: #333333; font-weight: bold;\">\u6267\u884c\u51fd\u6570<\/strong> \u2014 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">spec.func(**args)<\/code> \u89e3\u5305\u53c2\u6570\u8c03\u7528\u771f\u6b63\u7684\u51fd\u6570<\/section>\n<\/li>\n<li style=\"margin-bottom: 8px; padding-left: 0px; text-indent: 0px; color: #333333; list-style: inherit;\">\n<section><strong style=\"color: #333333; font-weight: bold;\">\u5e8f\u5217\u5316\u7ed3\u679c<\/strong> \u2014 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">json.dumps<\/code> \u8f6c\u5b57\u7b26\u4e32\uff0c<code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">ensure_ascii=False<\/code> \u4fdd\u7559\u4e2d\u6587<\/section>\n<\/li>\n<\/ol>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u4ee5\u524d\u4f60\u7684\u6267\u884c\u903b\u8f91\u5185\u8054\u5728 Agent \u5faa\u73af\u91cc\uff0c\u73b0\u5728\u7edf\u4e00\u6536\u5230 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">execute()<\/code> \u4e00\u4e2a\u51fd\u6570\u91cc\u3002Agent \u53ea\u7ba1\u8c03 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">execute()<\/code>\uff0c\u4e0d\u5173\u5fc3\u53c2\u6570\u56de\u9000\u3001\u9519\u8bef\u5904\u7406\u8fd9\u4e9b\u7ec6\u8282\u3002&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u5c0f\u660e\u604d\u7136\uff1a&#8221;\u6240\u4ee5\u6ce8\u518c\u8868\u505a\u4e86\u4e09\u4ef6\u4e8b\u2014\u2014<strong style=\"color: #333333; font-weight: bold;\">\u5b58\u5b9a\u4e49\u3001\u8f6c\u683c\u5f0f\u3001\u7ba1\u6267\u884c<\/strong>\u3002&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u8bf4\u5230\u70b9\u5b50\u4e0a\u4e86\u3002&#8221;<\/p>\n<hr style=\"border-width: 1px medium medium; border-style: solid none none; border-color: #f0e6d0 currentcolor currentcolor; margin: 24px 0px;\" \/>\n<h2 style=\"display: inline-block; position: relative; font-weight: bold; color: #333333; line-height: 1.5; margin-top: 32px; margin-bottom: 16px; padding: 0px 6px 2px; text-align: left; background: linear-gradient(to top, #f8b43f 42%, transparent 42%); box-decoration-break: clone; -webkit-box-decoration-break: clone; font-size: 17px; border: medium none currentcolor;\"><span style=\"color: #333333; font-weight: bold;\">\u6ce8\u518c\u5de5\u5177\uff1a\u53ea\u9700\u4e24\u884c<\/span><\/h2>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u8001\u5f20\u8bf4\uff1a&#8221;\u770b\u5b9e\u9645\u600e\u4e48\u7528\u3002\u5728 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">tool_registry.py<\/code> \u5e95\u90e8\uff1a&#8221;<\/p>\n<section style=\"display: block; background-repeat: no-repeat; width: 100%; height: 16px;\"><\/section>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Courier New', 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: #002b36;\"><code class=\"hljs language-python\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', 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: #93a1a1; background: #002b36;\"><span class=\"hljs-keyword\" style=\"color: #6c71c4;\">from<\/span>\u00a0tools.weather\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">import<\/span>\u00a0get_current_weather_online\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">from<\/span>\u00a0tools.news\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">import<\/span>\u00a0get_news_by_tavily\n\nregister(\n\u00a0\u00a0get_current_weather_online,\n\u00a0\u00a0label=<span class=\"hljs-string\" style=\"color: #859900;\">\"\u5929\u6c14\"<\/span>,\n\u00a0\u00a0description=<span class=\"hljs-string\" style=\"color: #859900;\">\"\u83b7\u53d6\u6307\u5b9a\u57ce\u5e02\u5f53\u524d\u7684\u5929\u6c14\u60c5\u51b5\"<\/span>,\n\u00a0\u00a0parameters={\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"type\"<\/span>:\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"object\"<\/span>,\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"properties\"<\/span>:\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"city\"<\/span>:\u00a0{<span class=\"hljs-string\" style=\"color: #859900;\">\"type\"<\/span>:\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"string\"<\/span>,\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"description\"<\/span>:\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"\u57ce\u5e02\u540d\u79f0\uff0c\u4f8b\u5982\uff1a\u5317\u4eac\u3001\u4e0a\u6d77\"<\/span>}\n\u00a0\u00a0\u00a0\u00a0},\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"required\"<\/span>:\u00a0[<span class=\"hljs-string\" style=\"color: #859900;\">\"city\"<\/span>],\n\u00a0\u00a0},\n)\n\nregister(\n\u00a0\u00a0get_news_by_tavily,\n\u00a0\u00a0label=<span class=\"hljs-string\" style=\"color: #859900;\">\"\u641c\u7d22\"<\/span>,\n\u00a0\u00a0description=<span class=\"hljs-string\" style=\"color: #859900;\">\"\u641c\u7d22\u6307\u5b9a\u5173\u952e\u8bcd\u7684\u6700\u65b0\u65b0\u95fb\u548c\u5b9e\u65f6\u8d44\u8baf\"<\/span>,\n\u00a0\u00a0parameters={\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"type\"<\/span>:\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"object\"<\/span>,\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"properties\"<\/span>:\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"query\"<\/span>:\u00a0{<span class=\"hljs-string\" style=\"color: #859900;\">\"type\"<\/span>:\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"string\"<\/span>,\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"description\"<\/span>:\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"\u641c\u7d22\u5173\u952e\u8bcd\"<\/span>}\n\u00a0\u00a0\u00a0\u00a0},\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"required\"<\/span>:\u00a0[<span class=\"hljs-string\" style=\"color: #859900;\">\"query\"<\/span>],\n\u00a0\u00a0},\n\u00a0\u00a0fill_from_user=[<span class=\"hljs-string\" style=\"color: #859900;\">\"query\"<\/span>],\u00a0\u00a0\u00a0<span class=\"hljs-comment\" style=\"color: #657b83;\">#\u00a0query\u00a0\u7f3a\u5931\u65f6\u7528\u7528\u6237\u539f\u8bdd<\/span>\n)\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\"><strong style=\"color: #333333; font-weight: bold;\">\u65b0\u589e\u5de5\u5177\u53ea\u9700\u4e24\u6b65<\/strong>\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: #333333; list-style: inherit;\">\n<section>\u5728 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">tools\/<\/code> \u4e0b\u5199\u51fd\u6570\u5b9e\u73b0\uff08\u72ec\u7acb\u6587\u4ef6\uff0c\u4e0d\u78b0\u5176\u4ed6\u4ee3\u7801\uff09<\/section>\n<\/li>\n<li style=\"margin-bottom: 8px; padding-left: 0px; text-indent: 0px; color: #333333; list-style: inherit;\">\n<section><code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">import<\/code> + <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">register(...)<\/code><\/section>\n<\/li>\n<\/ol>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u60f3\u52a0\u4e2a\u8ba1\u7b97\u5668\uff1f\u65b0\u5efa <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">tools\/calculator.py<\/code>\uff0c\u5199\u4e2a <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">calculate<\/code> \u51fd\u6570\uff0c\u7136\u540e\uff1a&#8221;<\/p>\n<section style=\"display: block; background-repeat: no-repeat; width: 100%; height: 16px;\"><\/section>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Courier New', 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: #002b36;\"><code class=\"hljs language-python\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', 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: #93a1a1; background: #002b36;\"><span class=\"hljs-keyword\" style=\"color: #6c71c4;\">from<\/span>\u00a0tools.calculator\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">import<\/span>\u00a0calculate\n\nregister(\n\u00a0\u00a0calculate,\n\u00a0\u00a0label=<span class=\"hljs-string\" style=\"color: #859900;\">\"\u8ba1\u7b97\u5668\"<\/span>,\n\u00a0\u00a0description=<span class=\"hljs-string\" style=\"color: #859900;\">\"\u8ba1\u7b97\u6570\u5b66\u8868\u8fbe\u5f0f\u7684\u503c\"<\/span>,\n\u00a0\u00a0parameters={\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"type\"<\/span>:\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"object\"<\/span>,\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"properties\"<\/span>:\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"expression\"<\/span>:\u00a0{<span class=\"hljs-string\" style=\"color: #859900;\">\"type\"<\/span>:\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"string\"<\/span>,\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"description\"<\/span>:\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"\u6570\u5b66\u8868\u8fbe\u5f0f\uff0c\u4f8b\u5982\uff1a123\u00a0*\u00a0456\"<\/span>}\n\u00a0\u00a0\u00a0\u00a0},\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"required\"<\/span>:\u00a0[<span class=\"hljs-string\" style=\"color: #859900;\">\"expression\"<\/span>],\n\u00a0\u00a0},\n\u00a0\u00a0fill_from_user=[<span class=\"hljs-string\" style=\"color: #859900;\">\"expression\"<\/span>],\n)\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u5b8c\u4e8b\u3002Agent \u4ee3\u7801\u4e00\u884c\u4e0d\u7528\u6539\u3002&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u5c0f\u660e\u5bf9\u6bd4\u4e86\u4e00\u4e0b\u4e4b\u524d\u7684\u505a\u6cd5\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: #fff9eb; color: #333333; text-align: left;\">\n<tr>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8;\" align=\"left\">\u5bf9\u6bd4\u9879<\/th>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8;\" align=\"left\">\u786c\u7f16\u7801\u7248<\/th>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8;\" align=\"left\">\u6ce8\u518c\u8868\u7248<\/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 #f5e6c8; min-width: 100px;\" align=\"left\">\u65b0\u589e\u5de5\u5177<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u6539 3 \u5904\u4ee3\u7801<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><code>register()<\/code> 1 \u5904<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u53c2\u6570\u56de\u9000<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u624b\u5199 if-else<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><code>fill_from_user<\/code> \u914d\u7f6e<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u5de5\u5177\u5217\u8868<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u624b\u52a8\u7ef4\u62a4\uff0c\u5bb9\u6613\u4e0d\u4e00\u81f4<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><code>get_openai_tools()<\/code> \u81ea\u52a8\u751f\u6210<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u6267\u884c\u903b\u8f91<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u5185\u8054\u5728 Agent \u5faa\u73af\u4e2d<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><code>execute()<\/code> \u7edf\u4e00\u5165\u53e3<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u5de5\u5177\u5b9e\u73b0<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u6563\u843d\u5728\u4e3b\u6587\u4ef6\u91cc<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u72ec\u7acb\u6587\u4ef6\uff0c\u4e92\u4e0d\u5e72\u6270<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u5dee\u8ddd\u5f88\u660e\u663e\u3002&#8221;\u5c0f\u660e\u8bf4\uff0c&#8221;\u5de5\u5177\u8d8a\u591a\uff0c\u6ce8\u518c\u8868\u7684\u4f18\u52bf\u8d8a\u5927\u3002&#8221;<\/p>\n<hr style=\"border-width: 1px medium medium; border-style: solid none none; border-color: #f0e6d0 currentcolor currentcolor; margin: 24px 0px;\" \/>\n<h2 style=\"display: inline-block; position: relative; font-weight: bold; color: #333333; line-height: 1.5; margin-top: 32px; margin-bottom: 16px; padding: 0px 6px 2px; text-align: left; background: linear-gradient(to top, #f8b43f 42%, transparent 42%); box-decoration-break: clone; -webkit-box-decoration-break: clone; font-size: 17px; border: medium none currentcolor;\"><span style=\"color: #333333; font-weight: bold;\">Agent \u7c7b\uff1a\u5e72\u51c0\u7684\u7f16\u6392\u903b\u8f91<\/span><\/h2>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u8001\u5f20\u8bf4\uff1a&#8221;\u6ce8\u518c\u8868\u628a\u810f\u6d3b\u90fd\u5e72\u4e86\uff0cAgent \u7c7b\u5c31\u53d8\u5f97\u5f88\u5e72\u51c0\u2014\u2014\u5b83\u4e0d\u518d\u5173\u5fc3\u5177\u4f53\u6709\u54ea\u4e9b\u5de5\u5177\uff1a&#8221;<\/p>\n<section style=\"display: block; background-repeat: no-repeat; width: 100%; height: 16px;\"><\/section>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Courier New', 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: #002b36;\"><code class=\"hljs language-python\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', 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: #93a1a1; background: #002b36;\"><span class=\"hljs-keyword\" style=\"color: #6c71c4;\">class<\/span>\u00a0<span class=\"hljs-title class_\" style=\"color: #b58900;\">Agent<\/span>:\n\u00a0\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">def<\/span>\u00a0<span class=\"hljs-title function_\" style=\"color: #268bd2;\">run<\/span>(<span class=\"hljs-params\">self,\u00a0user_message:\u00a0<span class=\"hljs-built_in\" style=\"color: #2aa198;\">str<\/span><\/span>)\u00a0-&gt;\u00a0<span class=\"hljs-built_in\" style=\"color: #2aa198;\">str<\/span>:\n\u00a0\u00a0\u00a0\u00a0messages\u00a0=\u00a0[\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{<span class=\"hljs-string\" style=\"color: #859900;\">\"role\"<\/span>:\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"system\"<\/span>,\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"content\"<\/span>:\u00a0<span class=\"hljs-variable language_\" style=\"color: #dc322f;\">self<\/span>.system_prompt},\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{<span class=\"hljs-string\" style=\"color: #859900;\">\"role\"<\/span>:\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"user\"<\/span>,\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"content\"<\/span>:\u00a0user_message},\n\u00a0\u00a0\u00a0\u00a0]\n\n\u00a0\u00a0\u00a0\u00a0response\u00a0=\u00a0<span class=\"hljs-variable language_\" style=\"color: #dc322f;\">self<\/span>.client.chat.completions.create(\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0model=MODEL,\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0messages=messages,\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0tools=get_openai_tools(),\u00a0\u00a0<span class=\"hljs-comment\" style=\"color: #657b83;\">#\u00a0\u4ece\u6ce8\u518c\u8868\u81ea\u52a8\u83b7\u53d6<\/span>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0tool_choice=<span class=\"hljs-string\" style=\"color: #859900;\">\"auto\"<\/span>,\n\u00a0\u00a0\u00a0\u00a0)\n\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">if<\/span>\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">not<\/span>\u00a0response.choices[<span class=\"hljs-number\" style=\"color: #cb4b16;\">0<\/span>].message.tool_calls:\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">return<\/span>\u00a0response.choices[<span class=\"hljs-number\" style=\"color: #cb4b16;\">0<\/span>].message.content\n\n\u00a0\u00a0\u00a0\u00a0messages.append(response.choices[<span class=\"hljs-number\" style=\"color: #cb4b16;\">0<\/span>].message)\n\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">for<\/span>\u00a0tool_call\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">in<\/span>\u00a0response.choices[<span class=\"hljs-number\" style=\"color: #cb4b16;\">0<\/span>].message.tool_calls:\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0name\u00a0=\u00a0tool_call.function.name\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0args\u00a0=\u00a0json.loads(tool_call.function.arguments)\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0content\u00a0=\u00a0execute(name,\u00a0args,\u00a0user_message)\u00a0\u00a0<span class=\"hljs-comment\" style=\"color: #657b83;\">#\u00a0\u7edf\u4e00\u6267\u884c<\/span>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0messages.append({\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"role\"<\/span>:\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"tool\"<\/span>,\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"tool_call_id\"<\/span>:\u00a0tool_call.<span class=\"hljs-built_in\" style=\"color: #2aa198;\">id<\/span>,\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"name\"<\/span>:\u00a0name,\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"content\"<\/span>:\u00a0content,\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0})\n\n\u00a0\u00a0\u00a0\u00a0final\u00a0=\u00a0<span class=\"hljs-variable language_\" style=\"color: #dc322f;\">self<\/span>.client.chat.completions.create(model=MODEL,\u00a0messages=messages)\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">return<\/span>\u00a0final.choices[<span class=\"hljs-number\" style=\"color: #cb4b16;\">0<\/span>].message.content\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u5bf9\u6bd4\u4f60\u4e4b\u524d\u786c\u7f16\u7801\u7684\u7248\u672c\uff0c\u7ed3\u6784\u4e00\u6a21\u4e00\u6837\u2014\u2014\u4e24\u8f6e\u8c03\u7528\u3001messages \u7d2f\u79ef\u3001tool \u6d88\u606f\u8ffd\u52a0\u3002\u533a\u522b\u53ea\u6709\u4e24\u5904\uff1a&#8221;<\/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: #333333; list-style: inherit;\">\n<section><code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">tools=get_openai_tools()<\/code> \u2014 \u4e0d\u518d\u4f20\u786c\u7f16\u7801\u5217\u8868\uff0c\u4ece\u6ce8\u518c\u8868\u81ea\u52a8\u83b7\u53d6<\/section>\n<\/li>\n<li style=\"margin-bottom: 8px; padding-left: 0px; text-indent: 0px; color: #333333; list-style: inherit;\">\n<section><code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">execute(name, args, user_message)<\/code> \u2014 \u4e0d\u518d\u624b\u52a8\u67e5\u6620\u5c04\u8868 + \u624b\u52a8\u6267\u884c\uff0c\u7edf\u4e00\u5165\u53e3<\/section>\n<\/li>\n<\/ol>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;Agent \u4ee3\u7801\u4ece\u6b64<strong style=\"color: #333333; font-weight: bold;\">\u7a33\u5b9a\u4e0d\u52a8<\/strong>\u3002\u52a0\u5de5\u5177\u3001\u5220\u5de5\u5177\u3001\u6539\u5de5\u5177\uff0c\u90fd\u53ea\u5728 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">tools\/<\/code> \u76ee\u5f55\u548c <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">register()<\/code> \u8c03\u7528\u91cc\u6298\u817e\uff0cAgent \u8fde\u91cd\u65b0\u90e8\u7f72\u90fd\u4e0d\u7528\u3002&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u5c0f\u660e\u95ee\uff1a&#8221;\u90a3\u5165\u53e3\u6587\u4ef6\u5462\uff1f&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u66f4\u7b80\u5355\u4e86\uff0c\u542f\u52a8\u65f6\u6253\u5370\u4e00\u4e0b\u5f53\u524d\u6ce8\u518c\u4e86\u54ea\u4e9b\u5de5\u5177\uff1a&#8221;<\/p>\n<section style=\"display: block; background-repeat: no-repeat; width: 100%; height: 16px;\"><\/section>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Courier New', 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: #002b36;\"><code class=\"hljs language-python\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', 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: #93a1a1; background: #002b36;\"><span class=\"hljs-keyword\" style=\"color: #6c71c4;\">from<\/span>\u00a0agent\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">import<\/span>\u00a0Agent\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">from<\/span>\u00a0tool_registry\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">import<\/span>\u00a0list_tool_labels\n\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">def<\/span>\u00a0<span class=\"hljs-title function_\" style=\"color: #268bd2;\">main<\/span>():\n\u00a0\u00a0agent\u00a0=\u00a0Agent(verbose=<span class=\"hljs-literal\" style=\"color: #cb4b16;\">False<\/span>)\n\u00a0\u00a0tools\u00a0=\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"\u00a0\/\u00a0\"<\/span>.join(list_tool_labels())\n\u00a0\u00a0<span class=\"hljs-built_in\" style=\"color: #2aa198;\">print<\/span>(<span class=\"hljs-string\" style=\"color: #859900;\">f\"===\u00a0\u5de5\u5177\u6ce8\u518c\u8868\u00a0Agent\u00a0===\"<\/span>)\n\u00a0\u00a0<span class=\"hljs-built_in\" style=\"color: #2aa198;\">print<\/span>(<span class=\"hljs-string\" style=\"color: #859900;\">f\"\u5de5\u5177\uff1a<span class=\"hljs-subst\" style=\"color: #93a1a1;\">{tools}<\/span>\"<\/span>)\n\u00a0\u00a0<span class=\"hljs-built_in\" style=\"color: #2aa198;\">print<\/span>(<span class=\"hljs-string\" style=\"color: #859900;\">\"\u8f93\u5165\u00a0quit\u00a0\u9000\u51fa\\n\"<\/span>)\n\n\u00a0\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">while<\/span>\u00a0<span class=\"hljs-literal\" style=\"color: #cb4b16;\">True<\/span>:\n\u00a0\u00a0\u00a0\u00a0user_input\u00a0=\u00a0<span class=\"hljs-built_in\" style=\"color: #2aa198;\">input<\/span>(<span class=\"hljs-string\" style=\"color: #859900;\">\"\u4f60\uff1a\"<\/span>).strip()\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">if<\/span>\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">not<\/span>\u00a0user_input:\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">continue<\/span>\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">if<\/span>\u00a0user_input.lower()\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">in<\/span>\u00a0(<span class=\"hljs-string\" style=\"color: #859900;\">\"quit\"<\/span>,\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"exit\"<\/span>):\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">break<\/span>\n\u00a0\u00a0\u00a0\u00a0result\u00a0=\u00a0agent.run(user_input)\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-built_in\" style=\"color: #2aa198;\">print<\/span>(<span class=\"hljs-string\" style=\"color: #859900;\">f\"Agent\uff1a<span class=\"hljs-subst\" style=\"color: #93a1a1;\">{result}<\/span>\\n\"<\/span>)\n<\/code><\/pre>\n<section style=\"display: block; background-repeat: no-repeat; width: 100%; height: 16px;\"><\/section>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Courier New', 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: #002b36;\"><code class=\"hljs\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', 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: #93a1a1; background: #002b36;\">===\u00a0\u5de5\u5177\u6ce8\u518c\u8868\u00a0Agent\u00a0===\n\u5de5\u5177\uff1a\u5929\u6c14\u00a0\/\u00a0\u641c\u7d22\n\u8f93\u5165\u00a0quit\u00a0\u9000\u51fa\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u52a0\u4e2a\u8ba1\u7b97\u5668\u540e\uff0c\u542f\u52a8\u81ea\u52a8\u53d8\u6210 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">\u5de5\u5177\uff1a\u5929\u6c14 \/ \u641c\u7d22 \/ \u8ba1\u7b97\u5668<\/code>\u2014\u2014\u4f60\u4e0d\u7528\u6539\u4e00\u884c\u5165\u53e3\u4ee3\u7801\u3002&#8221;<\/p>\n<hr style=\"border-width: 1px medium medium; border-style: solid none none; border-color: #f0e6d0 currentcolor currentcolor; margin: 24px 0px;\" \/>\n<h2 style=\"display: inline-block; position: relative; font-weight: bold; color: #333333; line-height: 1.5; margin-top: 32px; margin-bottom: 16px; padding: 0px 6px 2px; text-align: left; background: linear-gradient(to top, #f8b43f 42%, transparent 42%); box-decoration-break: clone; -webkit-box-decoration-break: clone; font-size: 17px; border: medium none currentcolor;\"><span style=\"color: #333333; font-weight: bold;\">\u9879\u76ee\u7ed3\u6784\uff1a\u5404\u5f52\u5404\u4f4d<\/span><\/h2>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u8001\u5f20\u753b\u4e86\u5b8c\u6574\u7684\u76ee\u5f55\u7ed3\u6784\uff1a<\/p>\n<section style=\"display: block; background-repeat: no-repeat; width: 100%; height: 16px;\"><\/section>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Courier New', 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: #002b36;\"><code class=\"hljs\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', 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: #93a1a1; background: #002b36;\">\u793a\u4f8b\/\n\u251c\u2500\u2500\u00a0main.py\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u2190\u00a0\u5165\u53e3\uff0c\u542f\u52a8\u00a0Agent\n\u251c\u2500\u2500\u00a0agent.py\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u2190\u00a0Agent\u00a0\u7c7b\uff08\u5bf9\u8bdd\u7f16\u6392\uff09\n\u251c\u2500\u2500\u00a0config.py\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u2190\u00a0API\u00a0\u914d\u7f6e\uff08\u5bc6\u94a5\u3001\u6a21\u578b\u540d\u3001System\u00a0Prompt\uff09\n\u251c\u2500\u2500\u00a0tool_registry.py\u00a0\u00a0\u00a0\u2190\u00a0\u5de5\u5177\u6ce8\u518c\u8868\uff08\u6838\u5fc3\uff09\n\u2514\u2500\u2500\u00a0tools\/\n\u00a0\u00a0\u251c\u2500\u2500\u00a0__init__.py\u00a0\u00a0\u00a0\u00a0\u2190\u00a0\u5305\u521d\u59cb\u5316\n\u00a0\u00a0\u251c\u2500\u2500\u00a0weather.py\u00a0\u00a0\u00a0\u00a0\u00a0\u2190\u00a0\u5929\u6c14\u5de5\u5177\u5b9e\u73b0\n\u00a0\u00a0\u2514\u2500\u2500\u00a0news.py\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u2190\u00a0\u641c\u7d22\u5de5\u5177\u5b9e\u73b0\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u6bcf\u4e2a\u6587\u4ef6\u804c\u8d23\u5355\u4e00\uff1a&#8221;<\/p>\n<table style=\"display: inline-block !important; width: auto; max-width: 100%; overflow: auto; border-spacing: 0px; border-collapse: collapse; margin: 1rem 0px;\">\n<thead style=\"background: #fff9eb; color: #333333; text-align: left;\">\n<tr>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8;\" align=\"left\">\u6587\u4ef6<\/th>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8;\" align=\"left\">\u804c\u8d23<\/th>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8;\" align=\"left\">\u6539\u52a8\u9891\u7387<\/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 #f5e6c8; min-width: 100px;\" align=\"left\"><code>main.py<\/code><\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u542f\u52a8\u5165\u53e3<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u51e0\u4e4e\u4e0d\u6539<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><code>agent.py<\/code><\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u5bf9\u8bdd\u7f16\u6392\u903b\u8f91<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u51e0\u4e4e\u4e0d\u6539<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><code>config.py<\/code><\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">API \u914d\u7f6e<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u6362\u6a21\u578b\u65f6\u6539<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><code>tool_registry.py<\/code><\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u6ce8\u518c\u8868\u6838\u5fc3 + \u6ce8\u518c\u8c03\u7528<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u52a0\u5de5\u5177\u65f6\u6539\uff08\u52a0\u4e24\u884c\uff09<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><code>tools\/*.py<\/code><\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u5de5\u5177\u51fd\u6570\u5b9e\u73b0<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u52a0\u5de5\u5177\u65f6\u65b0\u5efa\u6587\u4ef6<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u5c0f\u660e\u6ce8\u610f\u5230\uff1a&#8221;\u5de5\u5177\u5b9e\u73b0\u653e\u5728\u72ec\u7acb\u6587\u4ef6\u91cc\uff1f&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u5bf9\u3002\u6bcf\u4e2a\u5de5\u5177\u4e00\u4e2a\u6587\u4ef6\uff0c\u4e92\u76f8\u4e0d\u5e72\u6270\u3002<code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">weather.py<\/code> \u91cc\u53ea\u6709\u5929\u6c14\u903b\u8f91\uff0c<code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">news.py<\/code> \u91cc\u53ea\u6709\u641c\u7d22\u903b\u8f91\u3002\u4f60\u60f3\u6539\u5929\u6c14\u5de5\u5177\uff0c\u6253\u5f00 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">weather.py<\/code> \u6539\u5c31\u662f\u4e86\uff0c\u4e0d\u7528\u62c5\u5fc3\u78b0\u574f\u522b\u7684\u5de5\u5177\u3002&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u8fd9\u548c\u5199\u4ee3\u7801\u7684\u6a21\u5757\u5316\u539f\u5219\u662f\u4e00\u6837\u7684\u2014\u2014<strong style=\"color: #333333; font-weight: bold;\">\u5355\u4e00\u804c\u8d23\u3001\u9ad8\u5185\u805a\u4f4e\u8026\u5408<\/strong>\u3002&#8221;<\/p>\n<hr style=\"border-width: 1px medium medium; border-style: solid none none; border-color: #f0e6d0 currentcolor currentcolor; margin: 24px 0px;\" \/>\n<h2 style=\"display: inline-block; position: relative; font-weight: bold; color: #333333; line-height: 1.5; margin-top: 32px; margin-bottom: 16px; padding: 0px 6px 2px; text-align: left; background: linear-gradient(to top, #f8b43f 42%, transparent 42%); box-decoration-break: clone; -webkit-box-decoration-break: clone; font-size: 17px; border: medium none currentcolor;\"><span style=\"color: #333333; font-weight: bold;\">\u53c2\u6570\u56de\u9000\uff1a\u4e00\u4e2a\u5bb9\u6613\u88ab\u5ffd\u7565\u7684\u7ec6\u8282<\/span><\/h2>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u8001\u5f20\u8bf4\uff1a&#8221;\u6ce8\u518c\u8868\u91cc\u6709\u4e2a\u8bbe\u8ba1\u503c\u5f97\u5355\u72ec\u8bb2\u2014\u2014<code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">fill_from_user<\/code>\u3002&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u4ec0\u4e48\u573a\u666f\u4f1a\u7528\u5230\uff1f&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u7528\u6237\u8bf4&#8217;\u5e2e\u6211\u641c\u4e00\u4e0b\u6700\u65b0\u7684 AI \u8fdb\u5c55&#8217;\u3002\u6a21\u578b\u53ef\u80fd\u6b63\u786e\u63d0\u53d6\u4e86 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">query=\"AI \u8fdb\u5c55\"<\/code>\uff0c\u4e5f\u53ef\u80fd\u5077\u61d2\u4e0d\u4f20\u53c2\u6570\uff0c\u53ea\u8fd4\u56de\u4e00\u4e2a\u7a7a\u7684 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">arguments: {}<\/code>\u3002&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u4e4b\u524d\u4f60\u7684\u505a\u6cd5\u662f\uff1a&#8221;<\/p>\n<section style=\"display: block; background-repeat: no-repeat; width: 100%; height: 16px;\"><\/section>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Courier New', 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: #002b36;\"><code class=\"hljs language-python\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', 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: #93a1a1; background: #002b36;\"><span class=\"hljs-comment\" style=\"color: #657b83;\">#\u00a0\u786c\u7f16\u7801\uff1a\u6bcf\u4e2a\u5de5\u5177\u5355\u72ec\u5199\u00a0if<\/span>\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">if<\/span>\u00a0func_name\u00a0==\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"get_news\"<\/span>\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">and<\/span>\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">not<\/span>\u00a0func_args.get(<span class=\"hljs-string\" style=\"color: #859900;\">\"query\"<\/span>):\n\u00a0\u00a0func_args[<span class=\"hljs-string\" style=\"color: #859900;\">\"query\"<\/span>]\u00a0=\u00a0user_message\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u8fd9\u79cd\u5199\u6cd5\u7684\u95ee\u9898\u2014\u2014\u6bcf\u52a0\u4e00\u4e2a\u9700\u8981\u56de\u9000\u7684\u5de5\u5177\uff0c\u5c31\u8981\u52a0\u4e00\u6bb5 if\u3002\u5de5\u5177\u591a\u4e86\uff0cif-else \u8d8a\u6765\u8d8a\u957f\u3002&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u6ce8\u518c\u8868\u7684\u505a\u6cd5\u662f\u628a\u56de\u9000\u7b56\u7565<strong style=\"color: #333333; font-weight: bold;\">\u914d\u7f6e\u5316<\/strong>\uff1a&#8221;<\/p>\n<section style=\"display: block; background-repeat: no-repeat; width: 100%; height: 16px;\"><\/section>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Courier New', 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: #002b36;\"><code class=\"hljs language-python\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', 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: #93a1a1; background: #002b36;\"><span class=\"hljs-comment\" style=\"color: #657b83;\">#\u00a0\u6ce8\u518c\u65f6\u58f0\u660e\uff1aquery\u00a0\u7f3a\u5931\u65f6\u7528\u7528\u6237\u539f\u8bdd\u515c\u5e95<\/span>\nregister(\n\u00a0\u00a0get_news_by_tavily,\n\u00a0\u00a0label=<span class=\"hljs-string\" style=\"color: #859900;\">\"\u641c\u7d22\"<\/span>,\n\u00a0\u00a0description=<span class=\"hljs-string\" style=\"color: #859900;\">\"\u641c\u7d22\u6307\u5b9a\u5173\u952e\u8bcd\u7684\u6700\u65b0\u65b0\u95fb\u548c\u5b9e\u65f6\u8d44\u8baf\"<\/span>,\n\u00a0\u00a0parameters={...},\n\u00a0\u00a0fill_from_user=[<span class=\"hljs-string\" style=\"color: #859900;\">\"query\"<\/span>],\u00a0\u00a0\u00a0<span class=\"hljs-comment\" style=\"color: #657b83;\">#\u00a0\u2190\u00a0\u4e00\u884c\u914d\u7f6e\u641e\u5b9a<\/span>\n)\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u6267\u884c\u65f6 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">execute()<\/code> \u81ea\u52a8\u5904\u7406\uff1a&#8221;<\/p>\n<section style=\"display: block; background-repeat: no-repeat; width: 100%; height: 16px;\"><\/section>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Courier New', 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: #002b36;\"><code class=\"hljs language-python\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', 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: #93a1a1; background: #002b36;\"><span class=\"hljs-keyword\" style=\"color: #6c71c4;\">for<\/span>\u00a0key\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">in<\/span>\u00a0spec.fill_from_user:\n\u00a0\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">if<\/span>\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">not<\/span>\u00a0args.get(key)\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">and<\/span>\u00a0user_message:\n\u00a0\u00a0\u00a0\u00a0args[key]\u00a0=\u00a0user_message\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u4e0d\u7528\u5199 if\uff0c\u4e0d\u7528\u6539 Agent \u4ee3\u7801\uff0c\u4e0d\u7528\u5173\u5fc3\u662f\u54ea\u4e2a\u5de5\u5177\u3002<strong style=\"color: #333333; font-weight: bold;\">\u58f0\u660e\u5f0f\u4f18\u4e8e\u547d\u4ee4\u5f0f<\/strong>\u2014\u2014\u4f60\u544a\u8bc9\u7cfb\u7edf&#8217;\u8fd9\u4e2a\u53c2\u6570\u7f3a\u5931\u65f6\u600e\u4e48\u529e&#8217;\uff0c\u7cfb\u7edf\u81ea\u5df1\u5904\u7406\u3002&#8221;<\/p>\n<table style=\"display: inline-block !important; width: auto; max-width: 100%; overflow: auto; border-spacing: 0px; border-collapse: collapse; margin: 1rem 0px;\">\n<thead style=\"background: #fff9eb; color: #333333; text-align: left;\">\n<tr>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8;\" align=\"left\">\u65b9\u5f0f<\/th>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8;\" align=\"left\">\u4ee3\u7801\u91cf<\/th>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8;\" align=\"left\">\u53ef\u7ef4\u62a4\u6027<\/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 #f5e6c8; min-width: 100px;\" align=\"left\">\u786c\u7f16\u7801 if-else<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u6bcf\u4e2a\u5de5\u5177 N \u884c<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u4f4e\uff0c\u5bb9\u6613\u9057\u6f0f<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><code>fill_from_user<\/code> \u914d\u7f6e<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u6bcf\u4e2a\u5de5\u5177 1 \u884c<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u9ad8\uff0c\u4e00\u76ee\u4e86\u7136<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr style=\"border-width: 1px medium medium; border-style: solid none none; border-color: #f0e6d0 currentcolor currentcolor; margin: 24px 0px;\" \/>\n<h2 style=\"display: inline-block; position: relative; font-weight: bold; color: #333333; line-height: 1.5; margin-top: 32px; margin-bottom: 16px; padding: 0px 6px 2px; text-align: left; background: linear-gradient(to top, #f8b43f 42%, transparent 42%); box-decoration-break: clone; -webkit-box-decoration-break: clone; font-size: 17px; border: medium none currentcolor;\"><span style=\"color: #333333; font-weight: bold;\">\u8dd1\u8d77\u6765\u770b\u770b<\/span><\/h2>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u5c0f\u660e\u628a\u6ce8\u518c\u8868\u7248\u4ee3\u7801\u8dd1\u4e86\u8d77\u6765\uff1a<\/p>\n<section style=\"display: block; background-repeat: no-repeat; width: 100%; height: 16px;\"><\/section>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Courier New', 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: #002b36;\"><code class=\"hljs language-bash\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', 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: #93a1a1; background: #002b36;\"><span class=\"hljs-built_in\" style=\"color: #2aa198;\">cd<\/span>\u00a0\u793a\u4f8b\u00a0&amp;&amp;\u00a0python\u00a0main.py\n<\/code><\/pre>\n<section style=\"display: block; background-repeat: no-repeat; width: 100%; height: 16px;\"><\/section>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Courier New', 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: #002b36;\"><code class=\"hljs\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', 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: #93a1a1; background: #002b36;\">===\u00a0\u5de5\u5177\u6ce8\u518c\u8868\u00a0Agent\u00a0===\n\u5de5\u5177\uff1a\u5929\u6c14\u00a0\/\u00a0\u641c\u7d22\n\u8f93\u5165\u00a0quit\u00a0\u9000\u51fa\n\n\u4f60\uff1a\u6210\u90fd\u4eca\u5929\u5929\u6c14\u600e\u4e48\u6837\uff1f\nAgent\uff1a\u6210\u90fd\u76ee\u524d\u6c14\u6e29\u00a030\u00b0C\uff0c\u9634\u5929\uff0c\u6e7f\u5ea6\u00a065%\uff0c\u98ce\u901f\u00a010km\/h\u3002\n\n\u4f60\uff1a\u641c\u4e00\u4e0b\u6700\u65b0\u7684\u00a0AI\u00a0\u5927\u6a21\u578b\u8fdb\u5c55\nAgent\uff1a\u6839\u636e\u641c\u7d22\u7ed3\u679c\uff0c\u8fd1\u671f\u00a0AI\u00a0\u5927\u6a21\u578b\u9886\u57df\u6709\u4ee5\u4e0b\u8fdb\u5c55\u2026\u2026\n\n\u4f60\uff1a\u4f60\u597d\nAgent\uff1a\u4f60\u597d\uff01\u6211\u662f\u4e00\u4e2a\u667a\u80fd\u52a9\u624b\uff0c\u53ef\u4ee5\u5e2e\u4f60\u67e5\u8be2\u5929\u6c14\u548c\u641c\u7d22\u6700\u65b0\u8d44\u8baf\uff0c\u8bf7\u95ee\u6709\u4ec0\u4e48\u53ef\u4ee5\u5e2e\u60a8\u7684\uff1f\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u5c0f\u660e\u52a0\u4e86\u8ba1\u7b97\u5668\u5de5\u5177\u540e\uff0c\u91cd\u65b0\u8fd0\u884c\uff1a<\/p>\n<section style=\"display: block; background-repeat: no-repeat; width: 100%; height: 16px;\"><\/section>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Courier New', 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: #002b36;\"><code class=\"hljs\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', 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: #93a1a1; background: #002b36;\">===\u00a0\u5de5\u5177\u6ce8\u518c\u8868\u00a0Agent\u00a0===\n\u5de5\u5177\uff1a\u5929\u6c14\u00a0\/\u00a0\u641c\u7d22\u00a0\/\u00a0\u8ba1\u7b97\u5668\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u6ca1\u6539 Agent \u4e00\u884c\u4ee3\u7801\uff0c\u5de5\u5177\u5217\u8868\u81ea\u52a8\u66f4\u65b0\u4e86\u3002&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u8001\u5f20\u8bf4\uff1a&#8221;\u8fd9\u5c31\u662f\u6ce8\u518c\u8868\u7684\u4ef7\u503c\u2014\u2014<strong style=\"color: #333333; font-weight: bold;\">\u5de5\u5177\u7684\u589e\u5220\u6539\u548c\u5bf9\u8bdd\u903b\u8f91\u5f7b\u5e95\u5206\u79bb<\/strong>\u3002\u4f60\u7684 Agent \u4ee3\u7801\u5199\u4e00\u6b21\u5c31\u4e0d\u7528\u52a8\u4e86\uff0c\u540e\u9762\u5168\u662f\u914d\u7f6e\u548c\u65b0\u589e\u6587\u4ef6\u3002&#8221;<\/p>\n<hr style=\"border-width: 1px medium medium; border-style: solid none none; border-color: #f0e6d0 currentcolor currentcolor; margin: 24px 0px;\" \/>\n<h2 style=\"display: inline-block; position: relative; font-weight: bold; color: #333333; line-height: 1.5; margin-top: 32px; margin-bottom: 16px; padding: 0px 6px 2px; text-align: left; background: linear-gradient(to top, #f8b43f 42%, transparent 42%); box-decoration-break: clone; -webkit-box-decoration-break: clone; font-size: 17px; border: medium none currentcolor;\"><span style=\"color: #333333; font-weight: bold;\">\u56db\u4e2a\u8bbe\u8ba1\u539f\u5219<\/span><\/h2>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u8001\u5f20\u603b\u7ed3\u4e86\u6ce8\u518c\u8868\u6a21\u5f0f\u80cc\u540e\u7684\u56db\u4e2a\u8bbe\u8ba1\u539f\u5219\uff1a<\/p>\n<h3 style=\"font-size: 16px; font-weight: bold; color: #333333; line-height: 1.5; margin-top: 24px; margin-bottom: 12px; padding-left: 12px; border-left: 4px solid #f8b43f;\"><span style=\"color: #333333; font-weight: bold;\">1. \u5355\u4e00\u6570\u636e\u6e90<\/span><\/h3>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u6ce8\u518c\u8868\u662f\u552f\u4e00\u7684\u6570\u636e\u6e90\u3002<code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">get_openai_tools()<\/code> \u4ece\u5b83\u751f\u6210\u5de5\u5177\u5217\u8868\uff0c<code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">execute()<\/code> \u4ece\u5b83\u67e5\u627e\u51fd\u6570\u3002\u6c38\u8fdc\u4e0d\u4f1a\u51fa\u73b0&#8221;\u5217\u8868\u91cc\u6709\u4f46\u6620\u5c04\u8868\u91cc\u6ca1\u6709&#8221;\u7684\u4e0d\u4e00\u81f4\u95ee\u9898\u3002<\/p>\n<h3 style=\"font-size: 16px; font-weight: bold; color: #333333; line-height: 1.5; margin-top: 24px; margin-bottom: 12px; padding-left: 12px; border-left: 4px solid #f8b43f;\"><span style=\"color: #333333; font-weight: bold;\">2. \u914d\u7f6e\u4f18\u4e8e\u7f16\u7801<\/span><\/h3>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u53c2\u6570\u56de\u9000\u7528 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">fill_from_user<\/code> \u914d\u7f6e\uff0c\u4e0d\u7528\u5199 if-else\u3002\u80fd\u914d\u7f6e\u7684\u5c31\u4e0d\u8981\u5199\u6b7b\uff0c\u56e0\u4e3a\u914d\u7f6e\u6bd4\u4ee3\u7801\u66f4\u5bb9\u6613\u4fee\u6539\u3001\u66f4\u5bb9\u6613\u5ba1\u67e5\u3002<\/p>\n<h3 style=\"font-size: 16px; font-weight: bold; color: #333333; line-height: 1.5; margin-top: 24px; margin-bottom: 12px; padding-left: 12px; border-left: 4px solid #f8b43f;\"><span style=\"color: #333333; font-weight: bold;\">3. \u58f0\u660e\u5f0f\u6ce8\u518c<\/span><\/h3>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\"><code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">register()<\/code> \u662f\u58f0\u660e\u5f0f\u7684\u2014\u2014\u4f60\u58f0\u660e&#8221;\u8fd9\u4e2a\u51fd\u6570\u662f\u4e2a\u5de5\u5177\uff0c\u957f\u8fd9\u6837&#8221;\uff0c\u7cfb\u7edf\u81ea\u52a8\u5904\u7406\u540e\u7eed\u3002\u4e0d\u9700\u8981\u4f60\u5199&#8221;\u5148\u628a\u8fd9\u4e2a\u52a0\u5230\u5217\u8868\u91cc\uff0c\u518d\u628a\u5b83\u52a0\u5230\u6620\u5c04\u8868\u91cc\uff0c\u518d\u5904\u7406\u5b83\u7684\u7279\u6b8a\u903b\u8f91&#8221;\u3002<\/p>\n<h3 style=\"font-size: 16px; font-weight: bold; color: #333333; line-height: 1.5; margin-top: 24px; margin-bottom: 12px; padding-left: 12px; border-left: 4px solid #f8b43f;\"><span style=\"color: #333333; font-weight: bold;\">4. \u5f00\u653e\u5c01\u95ed\u539f\u5219<\/span><\/h3>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u5bf9\u6269\u5c55\u5f00\u653e\uff08\u52a0\u65b0\u5de5\u5177\u53ea\u9700 register\uff09\uff0c\u5bf9\u4fee\u6539\u5c01\u95ed\uff08Agent \u4ee3\u7801\u4e0d\u7528\u6539\uff09\u3002\u8fd9\u662f\u5de5\u7a0b\u8bbe\u8ba1\u7684\u57fa\u672c\u539f\u5219\u2014\u2014<strong style=\"color: #333333; font-weight: bold;\">\u52a0\u529f\u80fd\u4e0d\u5e94\u8be5\u6539\u8001\u4ee3\u7801<\/strong>\u3002<\/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: #fff9eb; color: #333333; text-align: left;\">\n<tr>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8;\" align=\"left\">\u539f\u5219<\/th>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8;\" align=\"left\">\u6ce8\u518c\u8868\u600e\u4e48\u505a\u5230\u7684<\/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 #f5e6c8; min-width: 100px;\" align=\"left\">\u5355\u4e00\u6570\u636e\u6e90<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><code>_REGISTRY<\/code> \u662f\u552f\u4e00\u6570\u636e\u6e90\uff0c\u5217\u8868\u548c\u6267\u884c\u90fd\u4ece\u5b83\u6d3e\u751f<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u914d\u7f6e\u4f18\u4e8e\u7f16\u7801<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><code>fill_from_user<\/code> \u66ff\u4ee3 if-else<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u58f0\u660e\u5f0f\u6ce8\u518c<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><code>register()<\/code> \u4e00\u884c\u58f0\u660e\uff0c\u7cfb\u7edf\u81ea\u52a8\u5904\u7406<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u5f00\u653e\u5c01\u95ed<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u52a0\u5de5\u5177 = \u65b0\u6587\u4ef6 + register\uff0cAgent \u4e0d\u52a8<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr style=\"border-width: 1px medium medium; border-style: solid none none; border-color: #f0e6d0 currentcolor currentcolor; margin: 24px 0px;\" \/>\n<h2 style=\"display: inline-block; position: relative; font-weight: bold; color: #333333; line-height: 1.5; margin-top: 32px; margin-bottom: 16px; padding: 0px 6px 2px; text-align: left; background: linear-gradient(to top, #f8b43f 42%, transparent 42%); box-decoration-break: clone; -webkit-box-decoration-break: clone; font-size: 17px; border: medium none currentcolor;\"><span style=\"color: #333333; font-weight: bold;\">\u603b\u7ed3<\/span><\/h2>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u4e0a\u7bc7\u4f60\u5b66\u4f1a\u4e86 Function Calling \u7684\u4e24\u8f6e\u5bf9\u8bdd\u673a\u5236\u3002\u8fd9\u7bc7\u4f60\u5b66\u4f1a\u4e86\u5f53\u5de5\u5177\u53d8\u591a\u65f6\uff0c\u600e\u4e48\u7528<strong style=\"color: #333333; font-weight: bold;\">\u6ce8\u518c\u8868\u6a21\u5f0f<\/strong>\u7ba1\u7406\u5b83\u4eec\u2014\u2014<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u6838\u5fc3\u5c31\u4e09\u4ef6\u4e8b\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: #333333; list-style: inherit;\">\n<section><strong style=\"color: #333333; font-weight: bold;\">ToolSpec<\/strong> \u628a\u51fd\u6570\u3001\u63cf\u8ff0\u3001\u53c2\u6570\u3001\u56de\u9000\u7b56\u7565\u6253\u5305\u6210\u4e00\u4e2a\u6570\u636e\u7ed3\u6784<\/section>\n<\/li>\n<li style=\"margin-bottom: 8px; padding-left: 0px; text-indent: 0px; color: #333333; list-style: inherit;\">\n<section><strong style=\"color: #333333; font-weight: bold;\">register()<\/strong> \u4e00\u884c\u6ce8\u518c\uff0c\u81ea\u52a8\u8fdb\u5165\u5168\u5c40\u6ce8\u518c\u8868<\/section>\n<\/li>\n<li style=\"margin-bottom: 8px; padding-left: 0px; text-indent: 0px; color: #333333; list-style: inherit;\">\n<section><strong style=\"color: #333333; font-weight: bold;\">get_openai_tools() + execute()<\/strong> \u4ece\u6ce8\u518c\u8868\u81ea\u52a8\u751f\u6210\u5de5\u5177\u5217\u8868\u548c\u7edf\u4e00\u6267\u884c\u5165\u53e3<\/section>\n<\/li>\n<\/ol>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">Agent \u4ee3\u7801\u4ece\u6b64\u7a33\u5b9a\u4e0d\u52a8\uff0c\u5de5\u5177\u7684\u589e\u5220\u6539\u5168\u662f\u914d\u7f6e\u548c\u72ec\u7acb\u6587\u4ef6\u2014\u2014<strong style=\"color: #333333; font-weight: bold;\">\u65b0\u589e\u5de5\u5177\u53ea\u9700\u4e00\u884c <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">register()<\/code><\/strong>\u3002<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u5c0f\u660e\u628a\u6ce8\u518c\u8868\u91cd\u6784\u5b8c\u6210\u540e\uff0c\u8001\u5f20\u95ee\u4ed6\u611f\u89c9\u600e\u4e48\u6837\u3002<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u5c0f\u660e\u8bf4\uff1a&#8221;\u4ee5\u524d\u52a0\u5de5\u5177\u50cf\u505a\u624b\u672f\u2014\u2014\u8981\u7ffb\u5f00 Agent \u4ee3\u7801\uff0c\u5c0f\u5fc3\u7ffc\u7ffc\u5730\u6539\u4e09\u5904\u5730\u65b9\uff0c\u751f\u6015\u78b0\u574f\u522b\u7684\u903b\u8f91\u3002\u73b0\u5728\u50cf\u63d2 USB\u2014\u2014\u5199\u597d\u9a71\u52a8\u6587\u4ef6\uff0c\u63d2\u4e0a\u5c31\u884c\uff0c\u7cfb\u7edf\u81ea\u52a8\u8bc6\u522b\u3002&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u8001\u5f20\u7b11\u4e86\uff1a&#8221;\u8fd9\u4e2a\u6bd4\u55bb\u4e0d\u9519\u3002<strong style=\"color: #333333; font-weight: bold;\">\u6ce8\u518c\u8868\u5c31\u662f\u5de5\u5177\u7684 USB \u63a5\u53e3\u2014\u2014\u70ed\u63d2\u62d4\uff0c\u5373\u63d2\u5373\u7528\u3002<\/strong>&#8220;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u5c31\u50cf\u4ece USB \u8fdb\u5316\u5230\u4e86\u65e0\u7ebf\u2014\u2014\u534f\u8bae\u6ca1\u53d8\uff0c\u4f20\u8f93\u65b9\u5f0f\u5347\u7ea7\u4e86\u3002&#8221;<\/p>\n<\/section>\n","protected":false},"excerpt":{"rendered":"<p>\u4e0a\u7bc7\u4f60\u5b66\u4f1a\u4e86 Function Calling\u2014\u2014\u8ba9 AI \u4ece&#8221;\u4f1a\u8bf4&#8221;\u53d8\u6210&#038;#8221 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3630,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[164,163],"tags":[167,168],"_links":{"self":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/3628"}],"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=3628"}],"version-history":[{"count":1,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/3628\/revisions"}],"predecessor-version":[{"id":3631,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/3628\/revisions\/3631"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/media\/3630"}],"wp:attachment":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3628"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3628"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3628"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}