{"id":20389,"date":"2026-03-09T14:49:27","date_gmt":"2026-03-09T06:49:27","guid":{"rendered":"https:\/\/92it.top\/?p=20389"},"modified":"2026-03-09T14:49:42","modified_gmt":"2026-03-09T06:49:42","slug":"agent-skill-%e5%92%8c-tool%e7%9a%84%e5%85%b3%e7%b3%bb","status":"publish","type":"post","link":"https:\/\/92it.top\/?p=20389","title":{"rendered":"Agent \uff0c Skill \u548c Tool\u7684\u5173\u7cfb"},"content":{"rendered":"\n<p><strong>\u524d\u8a00\ud83d\udd16<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u6211\u4f1a\u7528<strong>\u901a\u4fd7\u7c7b\u6bd4 + \u6e05\u6670\u5bf9\u6bd4\u8868 + \u6838\u5fc3\u903b\u8f91\u56fe<\/strong>\uff0c\u5e2e\u4f60\u5f7b\u5e95\u7406\u6e05 <code>Agent<\/code>\u3001<code>Skill<\/code>\u3001<code>Tool<\/code> \u4e09\u8005\u7684\u5173\u7cfb \u2014\u2014 \u8fd9\u4e09\u4e2a\u6982\u5ff5\u672c\u8d28\u662f\u300c\u5c42\u7ea7\u9012\u8fdb + \u529f\u80fd\u5206\u5de5\u300d\uff0c\u5728\u4e0d\u540c\u6846\u67b6\uff08\u5982 LangChain\uff09\u4e2d\u53eb\u6cd5\u7565\u6709\u5dee\u5f02\uff0c\u4f46\u6838\u5fc3\u903b\u8f91\u5b8c\u5168\u4e00\u81f4\u3002<\/p>\n\n\n\n<p>\u3000\u3000<\/p>\n\n\n\n<p><strong>\u4e00\u3001\u6838\u5fc3\u5b9a\u4e49\uff08\u901a\u4fd7\u7248\uff0c\u5148\u5efa\u7acb\u8ba4\u77e5\uff09\ud83d\udd16<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u5148\u7ed9\u4e00\u4e2a\u751f\u6d3b\u5316\u7684\u7c7b\u6bd4\uff1a\u628a Agent \u770b\u4f5c\u300c\u53a8\u5e08\u300d\uff0cSkill \u662f\u300c\u505a\u83dc\u7684\u80fd\u529b\u300d\uff0cTool \u662f\u300c\u9505\u94f2 \/ \u83dc\u5200 \/ \u7535\u78c1\u7089\u300d\u3002<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><thead><tr><th>\u6982\u5ff5<\/th><th>\u672c\u8d28<\/th><th>\u7c7b\u6bd4\uff08\u53a8\u5e08\u573a\u666f\uff09<\/th><th>\u6280\u672f\u573a\u666f\u793a\u4f8b<\/th><\/tr><\/thead><tbody><tr><td>Tool<\/td><td>\u300c\u5177\u4f53\u7684\u7269\u7406\u5de5\u5177\u300d\uff0c\u4e0d\u53ef\u518d\u62c6\u5206\u7684\u6700\u5c0f\u6267\u884c\u5355\u5143<\/td><td>\u9505\u94f2\u3001\u83dc\u5200\u3001\u7535\u78c1\u7089<\/td><td>\u4e00\u4e2a\u67e5\u8be2\u5929\u6c14\u7684\u51fd\u6570\u3001\u8c03\u7528 API \u7684\u65b9\u6cd5\u3001\u8ba1\u7b97\u5668\u51fd\u6570<\/td><\/tr><tr><td>Skill<\/td><td>\u300c\u7ec4\u5408\u5de5\u5177\u5b8c\u6210\u67d0\u7c7b\u4efb\u52a1\u7684\u80fd\u529b\u300d\uff0c\u7531\u4e00\u4e2a \/ \u591a\u4e2a Tool \u6784\u6210<\/td><td>\u505a\u7ea2\u70e7\u8089\u7684\u80fd\u529b\uff08= \u83dc\u5200\u5207\u8089 + \u7092\u9505\u7ffb\u7092 + \u7535\u78c1\u7089\u52a0\u70ed\uff09<\/td><td>\u300c\u5929\u6c14\u67e5\u8be2 Skill\u300d\uff08= \u8c03\u7528\u5929\u6c14 API \u7684 Tool + \u6570\u636e\u683c\u5f0f\u5316 Tool\uff09<\/td><\/tr><tr><td>Agent<\/td><td>\u300c\u51b3\u7b56\u8005\u300d\uff0c\u638c\u63e1\u591a\u4e2a Skill\uff0c\u6839\u636e\u9700\u6c42\u9009\u62e9 \/ \u7ec4\u5408 Skill \u5b8c\u6210\u590d\u6742\u4efb\u52a1<\/td><td>\u53a8\u5e08\uff08\u638c\u63e1\u300c\u505a\u7ea2\u70e7\u8089\u300d\u300c\u7092\u9752\u83dc\u300d\u7b49\u591a\u4e2a Skill\uff0c\u6839\u636e\u987e\u5ba2\u9700\u6c42\u9009\u5bf9\u5e94\u7684 Skill \u505a\u83dc\uff09<\/td><td>\u70b9\u9910 Agent\uff08\u638c\u63e1\u300c\u83dc\u54c1\u67e5\u8be2 Skill\u300d\u300c\u4ef7\u683c\u8ba1\u7b97 Skill\u300d\uff0c\u6839\u636e\u7528\u6237\u70b9\u9910\u9700\u6c42\u8c03\u7528\u5bf9\u5e94 Skill\uff09<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u3000\u3000<\/p>\n\n\n\n<p><strong>\u4e8c\u3001\u6838\u5fc3\u5173\u7cfb\uff08\u903b\u8f91\u56fe + \u62c6\u89e3\uff09\ud83d\udd16<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"532\" src=\"https:\/\/92it.top\/wp-content\/uploads\/2026\/03\/image-16-1024x532.png\" alt=\"\" class=\"wp-image-20390\" style=\"width:506px;height:auto\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2026\/03\/image-16-1024x532.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2026\/03\/image-16-300x156.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2026\/03\/image-16-768x399.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2026\/03\/image-16-830x431.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2026\/03\/image-16-230x119.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2026\/03\/image-16-350x182.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2026\/03\/image-16-480x249.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2026\/03\/image-16.png 1100w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<p><strong>\u5173\u952e\u62c6\u89e3\uff1a<\/strong><\/p>\n\n\n\n<ol>\n<li><strong>Tool \u662f\u57fa\u7840\uff1aSkill \u548c Agent \u7684\u300c\u6700\u5c0f\u6267\u884c\u5355\u5143\u300d<\/strong>\n<ul>\n<li>Tool \u662f\u300c\u539f\u5b50\u7ea7\u300d\u7684\uff0c\u53ea\u80fd\u505a\u4e00\u4ef6\u6700\u5177\u4f53\u7684\u4e8b\uff08\u6bd4\u5982\u300c\u8c03\u7528\u5929\u6c14 API \u67e5\u5317\u4eac\u5929\u6c14\u300d\u300c\u8ba1\u7b97\u4e24\u4e2a\u6570\u7684\u548c\u300d\uff09\uff0c\u65e0\u4efb\u4f55\u51b3\u7b56\u80fd\u529b\uff1b<\/li>\n\n\n\n<li>Tool \u662f Skill \u548c Agent \u80fd\u843d\u5730\u7684\u300c\u7269\u7406\u57fa\u7840\u300d\u2014\u2014 \u6ca1\u6709 Tool\uff0cSkill \u53ea\u662f\u300c\u7a7a\u80fd\u529b\u300d\uff0cAgent \u53ea\u662f\u300c\u7a7a\u5927\u8111\u300d\u3002<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Skill \u662f\u4e2d\u95f4\u5c42\uff1aTool \u7684\u300c\u7ec4\u5408\u5c01\u88c5\u300d\uff0cAgent \u7684\u300c\u53ef\u7528\u80fd\u529b\u300d<\/strong>\n<ul>\n<li>Skill \u662f\u4e3a\u4e86\u5b8c\u6210\u300c\u67d0\u4e00\u7c7b\u4e1a\u52a1\u4efb\u52a1\u300d\uff0c\u628a\u4e00\u4e2a\u6216\u591a\u4e2a Tool \u6309\u903b\u8f91\u7ec4\u5408\u8d77\u6765\u7684\u300c\u80fd\u529b\u5305\u300d\uff1b<\/li>\n\n\n\n<li>\u6bd4\u5982\u300c\u4ef7\u683c\u8ba1\u7b97 Skill\u300d=\u300c\u8bfb\u53d6\u83dc\u54c1\u5355\u4ef7\u7684 Tool\u300d+\u300c\u7d2f\u52a0\u8ba1\u7b97\u7684 Tool\u300d+\u300c\u6298\u6263\u8ba1\u7b97\u7684 Tool\u300d\uff1b<\/li>\n\n\n\n<li>Skill \u662f Agent \u80fd\u300c\u76f4\u63a5\u8c03\u7528\u300d\u7684\u5355\u4f4d \u2014\u2014Agent \u4e0d\u4f1a\u76f4\u63a5\u8c03\u7528\u96f6\u6563\u7684 Tool\uff0c\u800c\u662f\u8c03\u7528\u5c01\u88c5\u597d\u7684 Skill\uff08\u5c31\u50cf\u53a8\u5e08\u4e0d\u4f1a\u76f4\u63a5\u8bf4\u300c\u6211\u8981\u7528\u9505\u94f2\u300d\uff0c\u800c\u662f\u8bf4\u300c\u6211\u8981\u505a\u7ea2\u70e7\u8089\u300d\uff09\u3002<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Agent \u662f\u9876\u5c42\uff1aSkill \u7684\u300c\u51b3\u7b56\u8005 + \u6574\u5408\u8005\u300d<\/strong>\n<ul>\n<li>Agent \u4e0d\u5173\u5fc3 Skill \u5185\u90e8\u7531\u54ea\u4e9b Tool \u6784\u6210\uff0c\u53ea\u5173\u5fc3\u300c\u8fd9\u4e2a Skill \u80fd\u5b8c\u6210\u4ec0\u4e48\u4efb\u52a1\u300d\uff1b<\/li>\n\n\n\n<li>Agent \u7684\u6838\u5fc3\u5de5\u4f5c\uff1a\u63a5\u6536\u7528\u6237\u9700\u6c42 \u2192 \u5224\u65ad\u9700\u8981\u8c03\u7528\u54ea\u4e2a \/ \u54ea\u4e9b Skill \u2192 \u8ba9 Skill \u6267\u884c\uff08\u5e95\u5c42\u8c03\u7528 Tool\uff09\u2192 \u6574\u5408 Skill \u7684\u7ed3\u679c\u8fd4\u56de\u7ed9\u7528\u6237\uff1b<\/li>\n\n\n\n<li>\u6bd4\u5982\u70b9\u9910 Agent \u6536\u5230\u300c\u6211\u8981\u70b9\u7ea2\u70e7\u8089\u7b97\u603b\u4ef7\u300d\u7684\u9700\u6c42\u540e\uff0c\u51b3\u7b56\u8c03\u7528\u300c\u83dc\u54c1\u67e5\u8be2 Skill\u300d\u2192 \u518d\u8c03\u7528\u300c\u4ef7\u683c\u8ba1\u7b97 Skill\u300d\u2192 \u6574\u5408\u4e24\u4e2a Skill \u7684\u7ed3\u679c\uff0c\u544a\u8bc9\u7528\u6237\u300c\u7ea2\u70e7\u8089\u5728\u552e\uff0c\u603b\u4ef7 48 \u5143\u300d\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<p>\u3000\u3000<\/p>\n\n\n\n<p><strong>\u4e8c\u3001\u6846\u67b6\u4e2d\u7684\u5bf9\u5e94\u5173\u7cfb\uff08\u4ee5 LangChain \u4e3a\u4f8b\uff09\ud83d\udd16<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u5728 LangChain \u7b49\u4e3b\u6d41\u6846\u67b6\u4e2d\uff0c<strong>Skill \u548c Tool \u5e38\u5e38\u6df7\u7528<\/strong>\uff08\u6846\u67b6\u91cc\u4e00\u822c\u53ea\u63d0 Tool\uff0cSkill \u662f\u4e1a\u52a1\u5c42\u5bf9 Tool \u7684\u5c01\u88c5\uff09\uff0c\u8fd9\u662f\u65b0\u624b\u6700\u5bb9\u6613\u6df7\u6dc6\u7684\u70b9\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><thead><tr><th>\u901a\u7528\u6982\u5ff5<\/th><th>LangChain \u4e2d\u7684\u53eb\u6cd5<\/th><th>\u6846\u67b6\u5185\u5b9a\u4f4d<\/th><\/tr><\/thead><tbody><tr><td>Tool<\/td><td>Tool<\/td><td>\u6846\u67b6\u5e95\u5c42\u7684\u6700\u5c0f\u6267\u884c\u5355\u5143\uff08\u76f4\u63a5\u5b9a\u4e49\u51fd\u6570\uff09<\/td><\/tr><tr><td>Skill<\/td><td>\u65e0\u660e\u786e\u5bf9\u5e94\uff08\u4e1a\u52a1\u5c42\u5c01\u88c5\uff09<\/td><td>\u5f00\u53d1\u8005\u57fa\u4e8e\u591a\u4e2a Tool \u5c01\u88c5\u7684\u4e1a\u52a1\u80fd\u529b<\/td><\/tr><tr><td>Agent<\/td><td>Agent<\/td><td>\u6846\u67b6\u6838\u5fc3\uff0c\u8c03\u7528 Tool\uff08\u5373\u4e1a\u52a1\u5c42\u7684 Skill\uff09\u5b8c\u6210\u4efb\u52a1<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u3000\u3000<\/p>\n\n\n\n<p>\u4e3e\u4e2a LangChain \u4e2d\u7684\u5b9e\u9645\u4f8b\u5b50\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># 1. \u5b9a\u4e49 Tool\uff08\u6846\u67b6\u7ea7\u6700\u5c0f\u5355\u5143\uff09\ndef get_dish_price_tool(dish_name):  # Tool\uff1a\u67e5\u5355\u4e2a\u83dc\u54c1\u4ef7\u683c\uff08\u539f\u5b50\u64cd\u4f5c\uff09\n    menu = {\"\u7ea2\u70e7\u8089\":48, \"\u756a\u8304\u7092\u86cb\":18}\n    return menu.get(dish_name, 0)\n\ndef calculate_sum_tool(prices):  # Tool\uff1a\u7d2f\u52a0\u8ba1\u7b97\uff08\u539f\u5b50\u64cd\u4f5c\uff09\n    return sum(prices)\n\n# 2. \u5c01\u88c5 Skill\uff08\u4e1a\u52a1\u5c42\u80fd\u529b\uff0c\u6846\u67b6\u4e0d\u5173\u5fc3\uff0c\u5f00\u53d1\u8005\u81ea\u5df1\u5c01\u88c5\uff09\ndef calculate_order_skill(dish_list):  # Skill\uff1a\u8ba1\u7b97\u70b9\u9910\u603b\u4ef7\uff08\u7ec4\u5408Tool\uff09\n    prices = [get_dish_price_tool(d) for d in dish_list]\n    total = calculate_sum_tool(prices)\n    return total\n\n# 3. Agent\uff08\u6846\u67b6\u7ea7\uff0c\u8c03\u7528 Skill\/\u76f4\u63a5\u8c03\u7528 Tool\uff09\nclass OrderAgent:\n    def handle_order(self, dish_list):\n        total = calculate_order_skill(dish_list)  # Agent \u8c03\u7528 Skill\n        return f\"\u603b\u4ef7\uff1a{total}\u5143\"<\/pre>\n\n\n\n<p>\u3000\u3000<\/p>\n\n\n\n<p><strong>\u56db\u3001\u5173\u952e\u6613\u9519\u70b9\u6f84\u6e05\uff09\ud83d\udd16<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><strong>Skill \u548c Tool \u4e0d\u662f\u7edd\u5bf9\u5272\u88c2\u7684<\/strong>\uff1a<\/p>\n\n\n\n<ul>\n<li>\u7b80\u5355\u573a\u666f\u4e0b\uff0c\u4e00\u4e2a Skill \u53ef\u4ee5\u53ea\u5305\u542b\u4e00\u4e2a Tool\uff08\u6bd4\u5982\u300c\u5929\u6c14\u67e5\u8be2 Skill\u300d=\u300c\u8c03\u7528\u5929\u6c14 API \u7684 Tool\u300d\uff09\uff0c\u6b64\u65f6 Skill \u548c Tool \u51e0\u4e4e\u7b49\u4ef7\uff1b<\/li>\n\n\n\n<li>\u590d\u6742\u573a\u666f\u4e0b\uff0c\u4e00\u4e2a Skill \u5fc5\u987b\u7ec4\u5408\u591a\u4e2a Tool\uff08\u6bd4\u5982\u300c\u65c5\u6e38\u89c4\u5212 Skill\u300d=\u300c\u67e5\u673a\u7968 Tool\u300d+\u300c\u67e5\u9152\u5e97 Tool\u300d+\u300c\u67e5\u5929\u6c14 Tool\u300d\uff09\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>Agent \u4e0d\u76f4\u63a5\u64cd\u4f5c Tool\uff08\u6700\u4f73\u5b9e\u8df5\uff09<\/strong>\uff1a<\/p>\n\n\n\n<ul>\n<li>\u867d\u7136\u6280\u672f\u4e0a Agent \u53ef\u4ee5\u76f4\u63a5\u8c03\u7528 Tool\uff0c\u4f46\u5b9e\u9645\u5f00\u53d1\u4e2d\uff0c\u4e00\u5b9a\u8981\u5148\u5c01\u88c5\u6210 Skill\u2014\u2014 \u8fd9\u6837 Agent \u53ea\u9700\u5173\u6ce8\u300c\u4e1a\u52a1\u4efb\u52a1\u300d\uff0c\u65e0\u9700\u5173\u6ce8\u300c\u5e95\u5c42\u64cd\u4f5c\u300d\uff0c\u4ee3\u7801\u66f4\u6613\u7ef4\u62a4\u3001\u6269\u5c55\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>\u4e0d\u540c\u573a\u666f\u7684\u53eb\u6cd5\u5dee\u5f02<\/strong>\uff1a<\/p>\n\n\n\n<ul>\n<li>\u901a\u7528 AI \u9886\u57df\uff1a\u5e38\u8bf4\u300cAgent + Skill\u300d\uff1b<\/li>\n\n\n\n<li>LangChain\/AutoGen \u7b49\u6846\u67b6\uff1a\u5e38\u8bf4\u300cAgent + Tool\u300d\uff1b<\/li>\n\n\n\n<li>\u672c\u8d28\uff1aSkill \u662f\u300c\u4e1a\u52a1\u89c6\u89d2\u7684\u80fd\u529b\u300d\uff0cTool \u662f\u300c\u6280\u672f\u89c6\u89d2\u7684\u6267\u884c\u5355\u5143\u300d\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>\u603b\u7ed3<\/strong>\uff1a<\/p>\n\n\n\n<ol>\n<li><strong>\u5c42\u7ea7\u5173\u7cfb<\/strong>\uff1aTool\uff08\u6700\u5c0f\u6267\u884c\u5355\u5143\uff09\u2192 Skill\uff08Tool \u7ec4\u5408\u6210\u7684\u4e1a\u52a1\u80fd\u529b\uff09\u2192 Agent\uff08\u8c03\u7528 Skill \u7684\u51b3\u7b56\u8005\uff09\uff1b<\/li>\n\n\n\n<li><strong>\u529f\u80fd\u5206\u5de5<\/strong>\uff1aTool \u505a\u300c\u5177\u4f53\u64cd\u4f5c\u300d\uff0cSkill \u505a\u300c\u80fd\u529b\u5c01\u88c5\u300d\uff0cAgent \u505a\u300c\u51b3\u7b56 + \u6574\u5408\u300d\uff1b<\/li>\n\n\n\n<li><strong>\u6846\u67b6\u9002\u914d<\/strong>\uff1aLangChain \u7b49\u6846\u67b6\u4e2d\u300cTool\u300d\u5bf9\u5e94\u901a\u7528\u6982\u5ff5\u7684\u300cTool\u300d\uff0c\u300cSkill\u300d\u662f\u5f00\u53d1\u8005\u57fa\u4e8e Tool \u5c01\u88c5\u7684\u4e1a\u52a1\u5c42\u80fd\u529b\uff0cAgent \u7edf\u4e00\u8c03\u7528\u8fd9\u4e9b\u80fd\u529b\u5b8c\u6210\u4efb\u52a1\u3002<\/li>\n<\/ol>\n\n\n\n<p>\u3000\u3000<\/p>\n\n\n\n<p><strong>\u4e94\u3001\u4e0d\u540c\u5e73\u53f0\u5bf9Skill\u7684\u7406\u89e3\u4e0d\u540c\ud83d\udd16<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u8bf7\u770b\u4e0b\u9762\u7684\u535a\u5ba2\uff0c\u8fd9\u4e2a\u535a\u4e3b\u7684\u5bf9Skill \u7406\u89e3 = Tool<\/p>\n\n\n\n<p><a href=\"https:\/\/blog.csdn.net\/chunmiao3032\/article\/details\/157734862\">https:\/\/blog.csdn.net\/chunmiao3032\/article\/details\/157734862<\/a><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"668\" src=\"https:\/\/92it.top\/wp-content\/uploads\/2026\/03\/image-18-1024x668.png\" alt=\"\" class=\"wp-image-20394\" style=\"width:556px;height:auto\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2026\/03\/image-18-1024x668.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2026\/03\/image-18-300x196.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2026\/03\/image-18-768x501.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2026\/03\/image-18-1536x1002.png 1536w, https:\/\/92it.top\/wp-content\/uploads\/2026\/03\/image-18-830x542.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2026\/03\/image-18-230x150.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2026\/03\/image-18-350x228.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2026\/03\/image-18-480x313.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2026\/03\/image-18.png 1591w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<p>\u8fd9\u5176\u5b9e\u662f<strong>\u6982\u5ff5\u5206\u5c42\u548c\u89c6\u89d2\u4e0d\u540c<\/strong>\u5bfc\u81f4\u7684\u5dee\u5f02\uff0c\u6211\u4eec\u53ef\u4ee5\u628a\u8fd9\u4e24\u79cd\u7406\u89e3\u653e\u5728\u4e00\u8d77\u5bf9\u6bd4\u4e00\u4e0b\uff1a<\/p>\n\n\n\n<p><strong>\ud83d\udd391. \u6587\u7ae0\u91cc\u7684 Skill \u5b9a\u4e49\uff08\u5f00\u53d1\u8005\u89c6\u89d2\uff09<\/strong><\/p>\n\n\n\n<p>\u8fd9\u7bc7\u6587\u7ae0\u662f\u4ece<strong>\u4e1a\u52a1\u5f00\u53d1\u7c7b\u6bd4<\/strong>\u7684\u89d2\u5ea6\u6765\u5b9a\u4e49\u7684\uff1a<\/p>\n\n\n\n<ul>\n<li><strong>Agent \u2248 \u4e1a\u52a1\u7c7b<\/strong>\uff08\u6bd4\u5982 <code>OrderService<\/code>\uff09<\/li>\n\n\n\n<li><strong>Skill \u2248 \u7c7b\u91cc\u7684\u5355\u4e2a\u65b9\u6cd5<\/strong>\uff08\u6bd4\u5982 <code>sendEmail()<\/code>\u3001<code>getNews()<\/code>\uff09<\/li>\n\n\n\n<li>\u6838\u5fc3\u7ed3\u8bba\uff1aSkill \u662f Agent \u7684\u300c\u539f\u5b50\u65b9\u6cd5\u300d\uff0c\u662f\u6700\u5c0f\u529f\u80fd\u5355\u5143\uff0c\u6709\u660e\u786e\u5165\u53c2\u548c\u51fa\u53c2\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u8fd9\u4e2a\u89c6\u89d2\u4e0b\uff0cSkill \u5c31\u662f<strong>\u6700\u5c0f\u6267\u884c\u5355\u5143<\/strong>\uff0c\u548c\u6211\u4eec\u4e4b\u524d\u8bf4\u7684\u300cTool\u300d\u51e0\u4e4e\u7b49\u4ef7 \u2014\u2014 \u56e0\u4e3a\u5728\u65e5\u5e38\u5f00\u53d1\u91cc\uff0c\u4e00\u4e2a\u65b9\u6cd5\u5c31\u662f\u6700\u5c0f\u7684\u53ef\u6267\u884c\u5355\u5143\uff0c\u4e0d\u80fd\u518d\u62c6\u5206\u4e86\u3002<\/p>\n\n\n\n<p>\u3000\u3000<\/p>\n\n\n\n<p><strong>\ud83d\udd392. \u6211\u4eec\u4e4b\u524d\u7684 Skill \u5b9a\u4e49\uff08\u7cfb\u7edf\u67b6\u6784\u89c6\u89d2\uff09<\/strong><\/p>\n\n\n\n<p>\u6211\u4eec\u4e4b\u524d\u662f\u4ece<strong>\u7cfb\u7edf\u5206\u5c42<\/strong>\u7684\u89d2\u5ea6\u6765\u5b9a\u4e49\u7684\uff1a<\/p>\n\n\n\n<ul>\n<li><strong>Tool<\/strong>\uff1a\u6700\u5c0f\u6267\u884c\u5355\u5143\uff08\u539f\u5b50\u64cd\u4f5c\uff0c\u6bd4\u5982\u8c03\u7528 API\u3001\u8ba1\u7b97\u6570\u5b57\uff09<\/li>\n\n\n\n<li><strong>Skill<\/strong>\uff1a\u7531\u4e00\u4e2a\u6216\u591a\u4e2a Tool \u7ec4\u5408\u800c\u6210\u7684\u300c\u80fd\u529b\u5305\u300d\uff0c\u7528\u6765\u5b8c\u6210\u67d0\u4e00\u7c7b\u4e1a\u52a1\u4efb\u52a1\uff08\u6bd4\u5982\u300c\u4ef7\u683c\u8ba1\u7b97 Skill\u300d=\u300c\u67e5\u5355\u4ef7 Tool\u300d+\u300c\u7d2f\u52a0 Tool\u300d+\u300c\u6298\u6263 Tool\u300d\uff09<\/li>\n\n\n\n<li><strong>Agent<\/strong>\uff1a\u8c03\u7528 Skill \u7684\u51b3\u7b56\u8005<\/li>\n<\/ul>\n\n\n\n<p>\u8fd9\u4e2a\u89c6\u89d2\u4e0b\uff0cSkill \u662f<strong>Tool \u7684\u7ec4\u5408\u5c01\u88c5<\/strong>\uff0c\u662f\u4e1a\u52a1\u5c42\u7684\u80fd\u529b\uff0c\u800c\u4e0d\u662f\u6700\u5c0f\u5355\u5143\u3002<\/p>\n\n\n\n<p>\u3000\u3000<\/p>\n\n\n\n<p><strong>\ud83d\udd393. \u4e3a\u4ec0\u4e48\u4f1a\u6709\u8fd9\u79cd\u5dee\u5f02\uff1f<\/strong><\/p>\n\n\n\n<p>\u5176\u5b9e\u8fd9\u4e24\u79cd\u7406\u89e3<strong>\u5e76\u4e0d\u77db\u76fe<\/strong>\uff0c\u53ea\u662f\u770b\u95ee\u9898\u7684\u5c42\u7ea7\u4e0d\u540c\uff1a<\/p>\n\n\n\n<ul>\n<li><strong>\u6587\u7ae0\u89c6\u89d2<\/strong>\uff1a\u628a\u300cSkill\u300d\u76f4\u63a5\u7b49\u540c\u4e8e\u300c\u6700\u5c0f\u53ef\u6267\u884c\u5355\u5143\u300d\uff0c\u56e0\u4e3a\u5728 Agent \u5e73\u53f0\uff08\u5982\u6263\u5b50\u3001AutoGPT\uff09\u91cc\uff0cSkill \u5c31\u662f\u4f60\u6ce8\u518c\u7684\u4e00\u4e2a\u4e2a\u51fd\u6570 \/ API\uff0c\u662f Agent \u80fd\u76f4\u63a5\u8c03\u7528\u7684\u6700\u5c0f\u5355\u4f4d\u3002<\/li>\n\n\n\n<li><strong>\u6211\u4eec\u7684\u89c6\u89d2<\/strong>\uff1a\u628a\u300cSkill\u300d\u5b9a\u4e49\u4e3a\u300c\u4e1a\u52a1\u80fd\u529b\u300d\uff0c\u800c\u300cTool\u300d\u662f\u66f4\u5e95\u5c42\u7684\u6280\u672f\u5b9e\u73b0\u5355\u5143 \u2014\u2014 \u8fd9\u662f\u4e3a\u4e86\u5728\u590d\u6742\u7cfb\u7edf\u4e2d\u66f4\u597d\u5730\u89e3\u8026\u548c\u590d\u7528\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u7b80\u5355\u8bf4\uff1a<\/p>\n\n\n\n<ul>\n<li>\u5728<strong>\u5e73\u53f0\u5f00\u53d1<\/strong>\uff08\u5982\u6263\u5b50\u3001AutoGPT\uff09\u91cc\uff1aSkill = Tool\uff08\u6700\u5c0f\u6267\u884c\u5355\u5143\uff09<\/li>\n\n\n\n<li>\u5728<strong>\u590d\u6742\u7cfb\u7edf\u67b6\u6784<\/strong>\u91cc\uff1aSkill = \u591a\u4e2a Tool \u7684\u7ec4\u5408\uff08\u4e1a\u52a1\u80fd\u529b\uff09<\/li>\n<\/ul>\n\n\n\n<p>\u3000\u3000<\/p>\n\n\n\n<p><strong>\u516d \u4e3a\u4ec0\u4e48\u8981\u8fd9\u4e48\u5206\u5c42\uff1f\ud83d\udd16<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><strong>\ud83d\udd39\u4e3a\u4ec0\u4e48\u5728\u590d\u6742\u7cfb\u7edf\u91cc\uff0cSkill \u2260 Tool\uff1f<\/strong><\/p>\n\n\n\n<p>\u5728\u5927\u578b\u4f01\u4e1a\u6216\u590d\u6742 AI \u7cfb\u7edf\u4e2d\uff0c\u76f4\u63a5\u8ba9 Agent \u8c03\u7528\u4e00\u5806\u96f6\u6563\u7684 Tool\uff08API \/ \u51fd\u6570\uff09\u4f1a\u5e26\u6765\u51e0\u4e2a\u95ee\u9898\uff1a<\/p>\n\n\n\n<ol>\n<li><strong>\u51b3\u7b56\u8d1f\u62c5\u592a\u91cd<\/strong>\uff1aAgent \u9700\u8981\u7406\u89e3\u6bcf\u4e2a\u5e95\u5c42 Tool \u7684\u7ec6\u8282\uff08\u53c2\u6570\u3001\u4f9d\u8d56\u3001\u5f02\u5e38\uff09\uff0c\u5bb9\u6613\u51fa\u9519\u3002<\/li>\n\n\n\n<li><strong>\u590d\u7528\u6027\u5dee<\/strong>\uff1a\u540c\u6837\u7684\u4e1a\u52a1\u903b\u8f91\uff08\u6bd4\u5982 \u201c\u8ba1\u7b97\u8ba2\u5355\u603b\u4ef7\u201d\uff09\u8981\u5728\u591a\u4e2a Agent \u91cc\u91cd\u590d\u5b9e\u73b0\u3002<\/li>\n\n\n\n<li><strong>\u7ef4\u62a4\u6210\u672c\u9ad8<\/strong>\uff1a\u5e95\u5c42 Tool \u53d8\u4e86\uff0c\u6240\u6709\u76f4\u63a5\u8c03\u7528\u5b83\u7684 Agent \u90fd\u8981\u6539\u3002<\/li>\n<\/ol>\n\n\n\n<p>\u6240\u4ee5\uff0c\u67b6\u6784\u4e0a\u4f1a\u5f15\u5165\u4e00\u4e2a\u4e2d\u95f4\u5c42\uff1a<\/p>\n\n\n\n<ul>\n<li><strong>Tool<\/strong>\uff1a\u5e95\u5c42\u539f\u5b50\u64cd\u4f5c\uff08\u8c03\u7528\u652f\u4ed8\u63a5\u53e3\u3001\u67e5\u6570\u636e\u5e93\u3001\u53d1\u90ae\u4ef6\uff09<\/li>\n\n\n\n<li><strong>Skill<\/strong>\uff1a\u4e1a\u52a1\u80fd\u529b\u5c01\u88c5\uff08\u8ba2\u5355\u7ed3\u7b97 Skill\u3001\u7528\u6237\u753b\u50cf Skill\u3001\u98ce\u63a7\u6821\u9a8c Skill\uff09<\/li>\n\n\n\n<li><strong>Agent<\/strong>\uff1a\u53ea\u5173\u5fc3\u4e1a\u52a1\u76ee\u6807\uff0c\u8c03\u7528 Skill \u5b8c\u6210\u4efb\u52a1<\/li>\n<\/ul>\n\n\n\n<p>\u8fd9\u6837\u4e00\u6765\uff0cAgent \u4e0d\u7528\u7ba1 \u201c\u600e\u4e48\u67e5\u5e93\u5b58\u3001\u600e\u4e48\u7b97\u6298\u6263\u201d\uff0c\u53ea\u9700\u8981\u8c03\u7528 \u201c\u8ba2\u5355\u7ed3\u7b97 Skill\u201d\uff0cSkill \u5185\u90e8\u518d\u53bb\u7ec4\u5408\u591a\u4e2a Tool \u5b8c\u6210\u6574\u4e2a\u6d41\u7a0b\u3002<\/p>\n\n\n\n<p>\u3000\u3000<\/p>\n\n\n\n<p><strong>\ud83d\udd39\u5b9e\u9645\u5e94\u7528\u573a\u666f\u4e3e\u4f8b<\/strong><\/p>\n\n\n\n<p><strong>1. \u7535\u5546\u667a\u80fd\u5ba2\u670d\u7cfb\u7edf<\/strong><\/p>\n\n\n\n<ul>\n<li><strong>Tool<\/strong>\uff1a\n<ul>\n<li><code>get_product_stock_tool<\/code>\uff1a\u67e5\u5546\u54c1\u5e93\u5b58<\/li>\n\n\n\n<li><code>get_discount_rule_tool<\/code>\uff1a\u67e5\u4f18\u60e0\u89c4\u5219<\/li>\n\n\n\n<li><code>calculate_price_tool<\/code>\uff1a\u8ba1\u7b97\u6298\u540e\u4ef7<\/li>\n\n\n\n<li><code>create_refund_order_tool<\/code>\uff1a\u521b\u5efa\u9000\u6b3e\u5355<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Skill<\/strong>\uff08\u4e1a\u52a1\u80fd\u529b\uff09\uff1a\n<ul>\n<li><code>\u8ba2\u5355\u7ed3\u7b97Skill<\/code>\uff1a\u7ec4\u5408 <code>get_product_stock_tool<\/code> + <code>get_discount_rule_tool<\/code> + <code>calculate_price_tool<\/code><\/li>\n\n\n\n<li><code>\u9000\u6b3e\u5904\u7406Skill<\/code>\uff1a\u7ec4\u5408 <code>get_order_detail_tool<\/code> + <code>check_refund_condition_tool<\/code> + <code>create_refund_order_tool<\/code><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Agent<\/strong>\uff1a\n<ul>\n<li>\u5ba2\u670d Agent\uff1a\u6839\u636e\u7528\u6237\u95ee\u9898\uff0c\u8c03\u7528\u300c\u8ba2\u5355\u7ed3\u7b97 Skill\u300d\u6216\u300c\u9000\u6b3e\u5904\u7406 Skill\u300d\uff0c\u4e0d\u7528\u5173\u5fc3\u5e95\u5c42 Tool \u600e\u4e48\u5b9e\u73b0\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p><strong>2. \u4f01\u4e1a\u7ea7 RPA + AI \u6df7\u5408\u7cfb\u7edf<\/strong><\/p>\n\n\n\n<ul>\n<li><strong>Tool<\/strong>\uff1a\n<ul>\n<li><code>read_excel_tool<\/code>\uff1a\u8bfb\u53d6 Excel \u6570\u636e<\/li>\n\n\n\n<li><code>call_crm_api_tool<\/code>\uff1a\u8c03\u7528 CRM \u63a5\u53e3<\/li>\n\n\n\n<li><code>send_wechat_tool<\/code>\uff1a\u53d1\u9001\u4f01\u4e1a\u5fae\u4fe1\u6d88\u606f<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Skill<\/strong>\uff1a\n<ul>\n<li><code>\u6708\u5ea6\u62a5\u8868\u751f\u6210Skill<\/code>\uff1a\u7ec4\u5408 <code>read_excel_tool<\/code> + <code>call_crm_api_tool<\/code> + <code>generate_pdf_tool<\/code><\/li>\n\n\n\n<li><code>\u5ba2\u6237\u8ddf\u8fdbSkill<\/code>\uff1a\u7ec4\u5408 <code>get_customer_info_tool<\/code> + <code>send_wechat_tool<\/code> + <code>log_followup_tool<\/code><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Agent<\/strong>\uff1a\n<ul>\n<li>\u8fd0\u8425 Agent\uff1a\u6bcf\u6708\u81ea\u52a8\u89e6\u53d1\u300c\u6708\u5ea6\u62a5\u8868\u751f\u6210 Skill\u300d\uff0c\u5e76\u901a\u8fc7\u300c\u5ba2\u6237\u8ddf\u8fdb Skill\u300d\u63d0\u9192\u9500\u552e\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p><strong>3. \u591a Agent \u534f\u4f5c\u7cfb\u7edf<\/strong><\/p>\n\n\n\n<ul>\n<li><strong>Tool<\/strong>\uff1a\n<ul>\n<li><code>weather_api_tool<\/code>\uff1a\u67e5\u5929\u6c14<\/li>\n\n\n\n<li><code>hotel_search_tool<\/code>\uff1a\u67e5\u9152\u5e97<\/li>\n\n\n\n<li><code>flight_book_tool<\/code>\uff1a\u8ba2\u673a\u7968<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Skill<\/strong>\uff1a\n<ul>\n<li><code>\u884c\u7a0b\u89c4\u5212Skill<\/code>\uff1a\u7ec4\u5408 <code>weather_api_tool<\/code> + <code>hotel_search_tool<\/code> + <code>flight_book_tool<\/code><\/li>\n\n\n\n<li><code>\u9884\u7b97\u6838\u7b97Skill<\/code>\uff1a\u7ec4\u5408 <code>get_flight_price_tool<\/code> + <code>get_hotel_price_tool<\/code> + <code>calculate_total_tool<\/code><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Agent<\/strong>\uff1a\n<ul>\n<li>\u89c4\u5212 Agent\uff1a\u8c03\u7528\u300c\u884c\u7a0b\u89c4\u5212 Skill\u300d\u751f\u6210\u65b9\u6848<\/li>\n\n\n\n<li>\u8d22\u52a1 Agent\uff1a\u8c03\u7528\u300c\u9884\u7b97\u6838\u7b97 Skill\u300d\u6821\u9a8c\u6210\u672c<\/li>\n\n\n\n<li>\u603b\u63a7 Agent\uff1a\u534f\u8c03\u4e24\u4e2a Agent\uff0c\u5b8c\u6210\u6574\u4e2a\u65c5\u884c\u89c4\u5212\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p>\u3000\u3000<\/p>\n\n\n\n<p><strong>\ud83d\udd39\u4e00\u53e5\u8bdd\u603b\u7ed3<\/strong><\/p>\n\n\n\n<ul>\n<li>\u5728<strong>\u5e73\u53f0\u5f00\u53d1<\/strong>\u91cc\uff0cSkill \u5c31\u662f\u4f60\u7ed9 Agent \u7684\u4e00\u4e2a\u4e2a \u201c\u5c0f\u5de5\u5177\u201d\uff08Tool\uff09\uff0c\u76f4\u63a5\u7528\u5c31\u884c\u3002<\/li>\n\n\n\n<li>\u5728<strong>\u590d\u6742\u7cfb\u7edf\u67b6\u6784<\/strong>\u91cc\uff0cSkill \u662f \u201c\u4e1a\u52a1\u80fd\u529b\u5305\u201d\uff0c\u5b83\u628a\u5e95\u5c42\u7684 Tool \u5c01\u88c5\u8d77\u6765\uff0c\u8ba9 Agent \u53ea\u9700\u8981\u5173\u5fc3 \u201c\u505a\u4ec0\u4e48\u201d\uff0c\u800c\u4e0d\u662f \u201c\u600e\u4e48\u505a\u201d\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u3000\u3000<\/p>\n\n\n\n<p><strong>\u4e03 \u5b9e\u9645\u6709\u54ea\u4e9b\u5e94\u7528\u6848\u4f8b\ud83d\udd16<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u5f53\u7136\u6709\uff01\u8fd9\u79cd\u300cTool\uff08\u539f\u5b50\u64cd\u4f5c\uff09\u2192 Skill\uff08\u4e1a\u52a1\u80fd\u529b\u5c01\u88c5\uff09\u2192 Agent\uff08\u51b3\u7b56\u8c03\u7528\uff09\u300d\u7684\u5206\u5c42\u67b6\u6784\uff0c\u5df2\u7ecf\u5728<strong>\u4f01\u4e1a\u7ea7 AI \u7cfb\u7edf\u3001\u7535\u5546\u3001\u91d1\u878d\u3001\u653f\u52a1<\/strong>\u7b49\u9886\u57df\u5927\u89c4\u6a21\u843d\u5730\u3002<\/p>\n\n\n\n<p><strong>\ud83d\udd391. \u963f\u91cc\u4e91\u767e\u70bc\uff08\u4f01\u4e1a\u7ea7 Agent \u5e73\u53f0\uff09<\/strong><\/p>\n\n\n\n<p>\u963f\u91cc\u4e91\u767e\u70bc\u662f\u5178\u578b\u7684\u590d\u6742 Agent \u7cfb\u7edf\u67b6\u6784\uff0c\u5b8c\u5168\u533a\u5206\u4e86\u300c\u5de5\u5177\uff08Tool\uff09\u300d\u548c\u300c\u6280\u80fd\uff08Skill\uff09\u300d\uff1a<\/p>\n\n\n\n<ul>\n<li><strong>Tool \u5c42<\/strong>\uff1a\u5e73\u53f0\u63d0\u4f9b\u5e95\u5c42\u539f\u5b50\u5de5\u5177\uff08\u5982\u300c\u8c03\u7528\u9489\u9489 API\u300d\u300c\u67e5\u963f\u91cc\u4e91 RDS \u6570\u636e\u300d\u300c\u8c03\u7528 OSS \u5b58\u50a8\u300d\uff09\uff0c\u5f00\u53d1\u8005\u4e5f\u80fd\u81ea\u5b9a\u4e49\u539f\u5b50 Tool\uff08\u6bd4\u5982\u67e5\u8ba2\u5355\u6570\u636e\u5e93\u7684\u51fd\u6570\uff09\uff1b<\/li>\n\n\n\n<li><strong>Skill \u5c42<\/strong>\uff1a\u5f00\u53d1\u8005\u57fa\u4e8e\u591a\u4e2a Tool \u5c01\u88c5\u6210\u300c\u4e1a\u52a1 Skill\u300d\uff08\u6bd4\u5982\u300c\u8ba2\u5355\u5c65\u7ea6 Skill\u300d=\u300c\u67e5\u5e93\u5b58 Tool\u300d+\u300c\u6263\u5e93\u5b58 Tool\u300d+\u300c\u751f\u6210\u7269\u6d41\u5355 Tool\u300d\uff09\uff1b<\/li>\n\n\n\n<li><strong>Agent \u5c42<\/strong>\uff1a\u4f01\u4e1a\u521b\u5efa\u7684 Agent\uff08\u5982\u300c\u7535\u5546\u5ba2\u670d Agent\u300d\u300c\u8ba2\u5355\u5904\u7406 Agent\u300d\uff09\u53ea\u8c03\u7528\u5c01\u88c5\u597d\u7684 Skill\uff0c\u4e0d\u76f4\u63a5\u64cd\u4f5c\u5e95\u5c42 Tool\u3002\u2705 \u9a8c\u8bc1\u65b9\u5f0f\uff1a\u767b\u5f55\u963f\u91cc\u4e91\u767e\u70bc\u63a7\u5236\u53f0\uff08<a href=\"https:\/\/dashscope.aliyun.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/dashscope.aliyun.com\/<\/a>\uff09\uff0c\u5728\u300c\u5de5\u5177\u4e2d\u5fc3\u300d\u80fd\u770b\u5230\u539f\u5b50 Tool\uff0c\u5728\u300c\u6280\u80fd\u7f16\u6392\u300d\u91cc\u53ef\u7ec4\u5408 Tool \u751f\u6210 Skill\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u3000\u3000<\/p>\n\n\n\n<p><strong>\ud83d\udd392. \u4eac\u4e1c\u667a\u80fd\u5ba2\u670d\u7cfb\u7edf\uff08\u7535\u5546\u573a\u666f\uff09<\/strong><\/p>\n\n\n\n<p>\u4eac\u4e1c\u7684\u667a\u80fd\u5ba2\u670d\u80cc\u540e\u662f\u591a\u5c42 Agent \u67b6\u6784\uff1a<\/p>\n\n\n\n<ul>\n<li><strong>Tool \u5c42<\/strong>\uff1a\u539f\u5b50\u64cd\u4f5c\uff08\u67e5\u5546\u54c1\u5e93\u5b58 API\u3001\u67e5\u7528\u6237\u8ba2\u5355\u63a5\u53e3\u3001\u8ba1\u7b97\u4f18\u60e0\u5238 Tool\u3001\u7269\u6d41\u8f68\u8ff9\u67e5\u8be2\u51fd\u6570\uff09\uff1b<\/li>\n\n\n\n<li><strong>Skill \u5c42<\/strong>\uff1a\u4e1a\u52a1\u80fd\u529b\u5c01\u88c5\uff08\n<ul>\n<li>\u300c\u552e\u540e\u9000\u6b3e Skill\u300d=\u300c\u67e5\u8ba2\u5355\u72b6\u6001 Tool\u300d+\u300c\u6821\u9a8c\u9000\u6b3e\u6761\u4ef6 Tool\u300d+\u300c\u8c03\u7528\u9000\u6b3e\u63a5\u53e3 Tool\u300d+\u300c\u53d1\u9001\u77ed\u4fe1\u901a\u77e5 Tool\u300d\uff1b<\/li>\n\n\n\n<li>\u300c\u5546\u54c1\u54a8\u8be2 Skill\u300d=\u300c\u67e5\u5546\u54c1\u8be6\u60c5 Tool\u300d+\u300c\u67e5\u5e93\u5b58 Tool\u300d+\u300c\u67e5\u8bc4\u4ef7 Tool\u300d\uff09\uff1b<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Agent \u5c42<\/strong>\uff1a\u4e0d\u540c\u573a\u666f\u7684 Agent\uff08\u552e\u524d\u54a8\u8be2 Agent\u3001\u552e\u540e\u5904\u7406 Agent\uff09\u8c03\u7528\u5bf9\u5e94 Skill\uff0c\u5b8c\u6210\u7528\u6237\u9700\u6c42\u3002\u2705 \u9a8c\u8bc1\u65b9\u5f0f\uff1a\u5728\u4eac\u4e1c APP \u8054\u7cfb\u5ba2\u670d\u54a8\u8be2 \u201c\u8ba2\u5355\u9000\u6b3e\u201d\uff0c\u5ba2\u670d\u80fd\u4e00\u7ad9\u5f0f\u5904\u7406\u9000\u6b3e\u5ba1\u6838\u3001\u91d1\u989d\u8ba1\u7b97\u3001\u8fdb\u5ea6\u544a\u77e5 \u2014\u2014 \u8fd9\u5c31\u662f\u300c\u552e\u540e\u9000\u6b3e Skill\u300d\u7684\u80fd\u529b\uff0c\u800c\u975e\u5355\u4e2a Tool \u7684\u8c03\u7528\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u3000\u3000<\/p>\n\n\n\n<p><strong>\ud83d\udd393. \u62db\u5546\u94f6\u884c\u667a\u80fd\u6295\u987e\u7cfb\u7edf\uff08\u91d1\u878d\u573a\u666f\uff09<\/strong><\/p>\n\n\n\n<p>\u62db\u884c\u7684\u667a\u80fd\u6295\u987e\u662f\u590d\u6742 Agent \u67b6\u6784\u7684\u5178\u578b\uff1a<\/p>\n\n\n\n<ul>\n<li><strong>Tool \u5c42<\/strong>\uff1a\u539f\u5b50\u5de5\u5177\uff08\u67e5\u7528\u6237\u8d44\u4ea7 API\u3001\u67e5\u57fa\u91d1\u51c0\u503c\u63a5\u53e3\u3001\u98ce\u9669\u8bc4\u7ea7\u8ba1\u7b97 Tool\u3001\u6536\u76ca\u6d4b\u7b97\u51fd\u6570\uff09\uff1b<\/li>\n\n\n\n<li><strong>Skill \u5c42<\/strong>\uff1a\u4e1a\u52a1\u80fd\u529b\u5c01\u88c5\uff08\n<ul>\n<li>\u300c\u8d44\u4ea7\u914d\u7f6e Skill\u300d=\u300c\u7528\u6237\u98ce\u9669\u8bc4\u7ea7 Tool\u300d+\u300c\u57fa\u91d1\u7b5b\u9009 Tool\u300d+\u300c\u6536\u76ca\u6d4b\u7b97 Tool\u300d+\u300c\u751f\u6210\u914d\u7f6e\u65b9\u6848 Tool\u300d\uff1b<\/li>\n\n\n\n<li>\u300c\u6301\u4ed3\u8c03\u6574 Skill\u300d=\u300c\u67e5\u5f53\u524d\u6301\u4ed3 Tool\u300d+\u300c\u5e02\u573a\u884c\u60c5 Tool\u300d+\u300c\u8c03\u6574\u5efa\u8bae\u751f\u6210 Tool\u300d\uff09\uff1b<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Agent \u5c42<\/strong>\uff1a\u6295\u987e Agent \u6839\u636e\u7528\u6237\u7684 \u201c\u8d44\u4ea7\u914d\u7f6e\u9700\u6c42\u201d\uff0c\u8c03\u7528\u300c\u8d44\u4ea7\u914d\u7f6e Skill\u300d\u751f\u6210\u65b9\u6848\uff0c\u65e0\u9700\u5173\u5fc3\u5e95\u5c42\u6bcf\u4e2a Tool \u7684\u8c03\u7528\u7ec6\u8282\u3002\u2705 \u9a8c\u8bc1\u65b9\u5f0f\uff1a\u62db\u884c APP \u7684\u300c\u667a\u80fd\u6295\u987e\u300d\u529f\u80fd\uff0c\u8f93\u5165 \u201c10 \u4e07\u8d44\u91d1\u60f3\u7a33\u5065\u7406\u8d22\u201d\uff0c\u4f1a\u76f4\u63a5\u7ed9\u51fa\u7ec4\u5408\u65b9\u6848 \u2014\u2014 \u8fd9\u662f Skill \u6574\u5408\u591a\u4e2a Tool \u540e\u7684\u7ed3\u679c\uff0c\u800c\u975e\u5355\u4e2a Tool \u7684\u8f93\u51fa\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u3000\u3000<\/p>\n\n\n\n<p><strong>\ud83d\udd39\u6280\u672f\u5c42\u9762\u7684\u843d\u5730\u5b9e\u73b0\uff08\u53ef\u590d\u73b0\uff09<\/strong><\/p>\n\n\n\n<p>\u4e0b\u9762\u7528 LangChain \u5b9e\u73b0\u4e00\u4e2a\u6781\u7b80\u7684\u300c\u590d\u6742\u67b6\u6784\u7248 Agent\u300d\uff0c\u6f14\u793a Skill \u5982\u4f55\u7ec4\u5408\u591a\u4e2a Tool\uff0c\u8ba9\u4f60\u76f4\u89c2\u770b\u5230\u843d\u5730\u65b9\u5f0f\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># ====================== 1. Tool\u5c42\uff08\u539f\u5b50\u64cd\u4f5c\uff09 ======================\nfrom langchain_core.tools import Tool\n\n# \u539f\u5b50Tool1\uff1a\u67e5\u83dc\u54c1\u5e93\u5b58\ndef check_dish_stock(dish_name: str) -> str:\n    stock_db = {\"\u7ea2\u70e7\u8089\": 50, \"\u756a\u8304\u7092\u86cb\": 30, \"\u6c34\u716e\u9c7c\": 0}\n    return f\"{dish_name}\u5e93\u5b58\uff1a{stock_db.get(dish_name, 0)}\u4efd\"\n\n# \u539f\u5b50Tool2\uff1a\u67e5\u83dc\u54c1\u5355\u4ef7\ndef get_dish_price(dish_name: str) -> str:\n    price_db = {\"\u7ea2\u70e7\u8089\": 48, \"\u756a\u8304\u7092\u86cb\": 18, \"\u6c34\u716e\u9c7c\": 68}\n    return f\"{dish_name}\u5355\u4ef7\uff1a{price_db.get(dish_name, 0)}\u5143\"\n\n# \u539f\u5b50Tool3\uff1a\u8ba1\u7b97\u603b\u4ef7\ndef calculate_total(prices: list) -> str:\n    return f\"\u603b\u4ef7\uff1a{sum(prices)}\u5143\"\n\n# \u5c01\u88c5LangChain Tool\ntool_list = [\n    Tool(name=\"CheckStock\", func=check_dish_stock, description=\"\u67e5\u8be2\u83dc\u54c1\u5e93\u5b58\"),\n    Tool(name=\"GetPrice\", func=get_dish_price, description=\"\u67e5\u8be2\u83dc\u54c1\u5355\u4ef7\"),\n    Tool(name=\"CalculateTotal\", func=calculate_total, description=\"\u8ba1\u7b97\u603b\u4ef7\")\n]\n\n# ====================== 2. Skill\u5c42\uff08\u4e1a\u52a1\u80fd\u529b\u5c01\u88c5\uff09 ======================\nclass OrderSkill:\n    \"\"\"\u70b9\u9910\u4e1a\u52a1Skill\uff1a\u7ec4\u5408\u591a\u4e2aTool\u5b8c\u6210\u70b9\u9910\u6d41\u7a0b\"\"\"\n    def __init__(self, tools):\n        self.tools = {tool.name: tool for tool in tools}  # \u6620\u5c04Tool\u540d\u79f0\u548c\u5b9e\u4f8b\n\n    def execute(self, dish_list: list) -> dict:\n        \"\"\"\u6267\u884c\u70b9\u9910Skill\uff1a\u67e5\u5e93\u5b58\u2192\u67e5\u4ef7\u683c\u2192\u7b97\u603b\u4ef7\"\"\"\n        result = {\n            \"valid_dishes\": [],\n            \"invalid_dishes\": [],\n            \"total_price\": 0,\n            \"stock_info\": {}\n        }\n\n        # \u6b65\u9aa41\uff1a\u8c03\u7528CheckStock Tool\u67e5\u5e93\u5b58\n        for dish in dish_list:\n            stock_info = self.tools[\"CheckStock\"].func(dish)\n            stock_num = int(stock_info.split(\"\uff1a\")[1].replace(\"\u4efd\", \"\"))\n            result[\"stock_info\"][dish] = stock_info\n            if stock_num > 0:\n                result[\"valid_dishes\"].append(dish)\n            else:\n                result[\"invalid_dishes\"].append(dish)\n\n        # \u6b65\u9aa42\uff1a\u8c03\u7528GetPrice Tool\u67e5\u6709\u6548\u83dc\u54c1\u4ef7\u683c\n        prices = []\n        for dish in result[\"valid_dishes\"]:\n            price_info = self.tools[\"GetPrice\"].func(dish)\n            price = int(price_info.split(\"\uff1a\")[1].replace(\"\u5143\", \"\"))\n            prices.append(price)\n\n        # \u6b65\u9aa43\uff1a\u8c03\u7528CalculateTotal Tool\u7b97\u603b\u4ef7\n        if prices:\n            result[\"total_price\"] = int(self.tools[\"CalculateTotal\"].func(prices).split(\"\uff1a\")[1].replace(\"\u5143\", \"\"))\n\n        return result\n\n# ====================== 3. Agent\u5c42\uff08\u51b3\u7b56\u8c03\u7528Skill\uff09 ======================\nclass RestaurantAgent:\n    \"\"\"\u9910\u5385Agent\uff1a\u53ea\u8c03\u7528Skill\uff0c\u4e0d\u5173\u5fc3\u5e95\u5c42Tool\"\"\"\n    def __init__(self, order_skill):\n        self.order_skill = order_skill  # \u7ed1\u5b9aSkill\uff0c\u800c\u975e\u76f4\u63a5\u7ed1\u5b9aTool\n\n    def handle_order(self, user_dishes: list) -> str:\n        \"\"\"\u5904\u7406\u7528\u6237\u70b9\u9910\u8bf7\u6c42\uff1a\u8c03\u7528OrderSkill\uff0c\u6574\u5408\u7ed3\u679c\u8fd4\u56de\"\"\"\n        # \u6838\u5fc3\uff1a\u53ea\u8c03\u7528Skill\uff0c\u4e0d\u63a5\u89e6\u5e95\u5c42Tool\n        skill_result = self.order_skill.execute(user_dishes)\n\n        # \u6574\u5408\u7ed3\u679c\uff08\u7ed9\u7528\u6237\u7684\u53cb\u597d\u54cd\u5e94\uff09\n        if not skill_result[\"valid_dishes\"]:\n            return f\"\u70b9\u9910\u5931\u8d25\uff01{skill_result['invalid_dishes']}\u5747\u65e0\u5e93\u5b58\"\n        \n        return (\n            f\"\u70b9\u9910\u6210\u529f\uff01\\n\"\n            f\"\u6709\u6548\u83dc\u54c1\uff1a{skill_result['valid_dishes']}\\n\"\n            f\"\u65e0\u5e93\u5b58\u83dc\u54c1\uff1a{skill_result['invalid_dishes']}\\n\"\n            f\"\u603b\u4ef7\uff1a{skill_result['total_price']}\u5143\"\n        )\n\n# ====================== \u6d4b\u8bd5\u8fd0\u884c ======================\nif __name__ == \"__main__\":\n    # \u521d\u59cb\u5316Skill\uff08\u7ec4\u5408Tool\uff09\n    order_skill = OrderSkill(tool_list)\n    # \u521d\u59cb\u5316Agent\uff08\u7ed1\u5b9aSkill\uff09\n    agent = RestaurantAgent(order_skill)\n    \n    # \u6d4b\u8bd5\u70b9\u9910\n    print(agent.handle_order([\"\u7ea2\u70e7\u8089\", \"\u756a\u8304\u7092\u86cb\", \"\u6c34\u716e\u9c7c\"]))<\/pre>\n\n\n\n<p>\u3000\u3000<\/p>\n\n\n\n<p><strong>\ud83d\udd39\u590d\u6742\u67b6\u6784\u843d\u5730\u7684\u6838\u5fc3\u4ef7\u503c\uff08\u4e3a\u4ec0\u4e48\u4f01\u4e1a\u8981\u8fd9\u4e48\u505a\uff09<\/strong><\/p>\n\n\n\n<ol>\n<li><strong>\u89e3\u8026\u6613\u7ef4\u62a4<\/strong>\uff1a\u6bd4\u5982\u8981\u4fee\u6539\u300c\u4ef7\u683c\u8ba1\u7b97\u89c4\u5219\u300d\uff0c\u53ea\u9700\u6539 <code>CalculateTotal<\/code> Tool\uff0c\u6240\u6709\u4f9d\u8d56\u8be5 Tool \u7684 Skill\uff08\u5982 OrderSkill\uff09\u4f1a\u81ea\u52a8\u751f\u6548\uff0c\u65e0\u9700\u4fee\u6539 Agent \u4ee3\u7801\uff1b<\/li>\n\n\n\n<li><strong>\u590d\u7528\u6027\u9ad8<\/strong>\uff1a\u300cOrderSkill\u300d\u53ef\u88ab\u300c\u70b9\u9910 Agent\u300d\u300c\u6536\u94f6 Agent\u300d\u300c\u540e\u53a8\u5907\u9910 Agent\u300d\u5171\u7528\uff0c\u4e0d\u7528\u91cd\u590d\u5f00\u53d1\uff1b<\/li>\n\n\n\n<li><strong>\u5bb9\u9519\u6027\u5f3a<\/strong>\uff1aSkill \u5c42\u53ef\u7edf\u4e00\u5904\u7406\u5f02\u5e38\uff08\u6bd4\u5982 Tool \u8c03\u7528\u5931\u8d25\u65f6\u7684\u91cd\u8bd5\u3001\u964d\u7ea7\uff09\uff0cAgent \u65e0\u9700\u5173\u5fc3\uff1b<\/li>\n\n\n\n<li><strong>\u6743\u9650\u7ba1\u63a7<\/strong>\uff1a\u53ef\u5728 Skill \u5c42\u63a7\u5236 Tool \u7684\u8c03\u7528\u6743\u9650\uff08\u6bd4\u5982\u300c\u9000\u6b3e Skill\u300d\u4ec5\u5141\u8bb8\u552e\u540e Agent \u8c03\u7528\uff09\uff0c\u7b26\u5408\u4f01\u4e1a\u5b89\u5168\u8981\u6c42\u3002<\/li>\n<\/ol>\n\n\n\n<p>\u3000\u3000<\/p>\n\n\n\n<p><strong>\ud83d\udd39\u603b\u7ed3<\/strong><\/p>\n\n\n\n<ol>\n<li><strong>\u843d\u5730\u73b0\u72b6<\/strong>\uff1a\u8fd9\u79cd\u5206\u5c42\u67b6\u6784\u5df2\u5728\u963f\u91cc\u4e91\u767e\u70bc\u3001\u4eac\u4e1c\u667a\u80fd\u5ba2\u670d\u3001\u62db\u884c\u667a\u80fd\u6295\u987e\u7b49\u4f01\u4e1a\u7ea7\u7cfb\u7edf\u4e2d\u5927\u89c4\u6a21\u5e94\u7528\uff0c\u662f\u590d\u6742 Agent \u7cfb\u7edf\u7684\u6807\u51c6\u8bbe\u8ba1\uff1b<\/li>\n\n\n\n<li><strong>\u6838\u5fc3\u903b\u8f91<\/strong>\uff1aTool \u662f\u539f\u5b50\u64cd\u4f5c\uff0cSkill \u662f\u4e1a\u52a1\u80fd\u529b\u5c01\u88c5\uff0cAgent \u53ea\u8c03\u7528 Skill \u5b8c\u6210\u4efb\u52a1\uff1b<\/li>\n\n\n\n<li><strong>\u843d\u5730\u4ef7\u503c<\/strong>\uff1a\u89e3\u51b3\u4e86\u590d\u6742\u7cfb\u7edf\u7684\u590d\u7528\u3001\u7ef4\u62a4\u3001\u6743\u9650\u95ee\u9898\uff0c\u662f\u4ece\u300c\u8f7b\u91cf Agent \u539f\u578b\u300d\u5230\u300c\u4f01\u4e1a\u7ea7 Agent \u7cfb\u7edf\u300d\u7684\u5173\u952e\u3002<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u8a00\ud83d\udd16 \u6211\u4f1a\u7528\u901a\u4fd7\u7c7b\u6bd4 + \u6e05\u6670\u5bf9\u6bd4\u8868 + \u6838\u5fc3\u903b\u8f91\u56fe\uff0c\u5e2e\u4f60\u5f7b\u5e95\u7406\u6e05 Agent\u3001Skill\u3001Tool \u4e09\u8005\u7684 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[48],"tags":[],"_links":{"self":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/20389"}],"collection":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=20389"}],"version-history":[{"count":6,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/20389\/revisions"}],"predecessor-version":[{"id":20398,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/20389\/revisions\/20398"}],"wp:attachment":[{"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=20389"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=20389"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=20389"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}