{"id":16394,"date":"2026-06-10T07:42:32","date_gmt":"2026-06-09T23:42:32","guid":{"rendered":"https:\/\/ab123.xyz\/?p=16394"},"modified":"2026-06-10T07:42:32","modified_gmt":"2026-06-09T23:42:32","slug":"%e6%99%ba%e8%b0%b1-glm-4-%e5%b7%a5%e5%85%b7%e8%b0%83%e7%94%a8%ef%bc%9afunction-calling-%e5%ae%9e%e7%8e%b0%e5%a4%a9%e6%b0%94%e6%9f%a5%e8%af%a2%e4%b8%8e%e6%97%a5%e5%8e%86%e7%ae%a1%e7%90%86","status":"publish","type":"post","link":"https:\/\/ab123.xyz\/?p=16394","title":{"rendered":"\u667a\u8c31 GLM-4 \u5de5\u5177\u8c03\u7528\uff1aFunction Calling \u5b9e\u73b0\u5929\u6c14\u67e5\u8be2\u4e0e\u65e5\u5386\u7ba1\u7406"},"content":{"rendered":"<p>\u667a\u8c31 GLM-4 \u662f\u667a\u8c31AI\u63a8\u51fa\u7684\u65b0\u4e00\u4ee3\u5927\u8bed\u8a00\u6a21\u578b\uff0c\u5176\u5185\u7f6e\u7684 Function Calling \u80fd\u529b\u8ba9\u5f00\u53d1\u8005\u80fd\u591f\u8f7b\u677e\u5c06\u81ea\u7136\u8bed\u8a00\u5bf9\u8bdd\u8f6c\u5316\u4e3a\u5177\u4f53\u7684\u5de5\u5177\u64cd\u4f5c\u3002\u901a\u8fc7\u7b80\u5355\u7684 API \u8c03\u7528\uff0c\u5373\u53ef\u5b9e\u73b0\u5929\u6c14\u67e5\u8be2\u3001\u65e5\u5386\u7ba1\u7406\u3001\u90ae\u4ef6\u53d1\u9001\u7b49\u5b9e\u9645\u529f\u80fd\uff0c\u6781\u5927\u63d0\u5347\u4e86 AI \u5e94\u7528\u7684\u5b9e\u7528\u6027\u4e0e\u4ea4\u4e92\u6548\u7387\u3002\u8bbf\u95ee <a href=\"https:\/\/open.bigmodel.cn\/\" target=\"_blank\">\u5b98\u65b9\u7f51\u7ad9<\/a> \u53ef\u83b7\u53d6\u6700\u65b0\u6587\u6863\u4e0e SDK\u3002<\/p>\n<h2>Function Calling \u7684\u6838\u5fc3\u529f\u80fd<\/h2>\n<p>GLM-4 \u7684 Function Calling \u5141\u8bb8\u7528\u6237\u5728\u5bf9\u8bdd\u4e2d\u5b9a\u4e49\u81ea\u5b9a\u4e49\u51fd\u6570\uff0c\u6a21\u578b\u4f1a\u6839\u636e\u7528\u6237\u610f\u56fe\u81ea\u52a8\u9009\u62e9\u5e76\u8c03\u7528\u76f8\u5e94\u51fd\u6570\u3002\u4f8b\u5982\uff0c\u5f53\u7528\u6237\u8bf4\u201c\u660e\u5929\u5317\u4eac\u4f1a\u4e0b\u96e8\u5417\u201d\uff0c\u6a21\u578b\u4f1a\u89e6\u53d1\u5929\u6c14\u67e5\u8be2\u51fd\u6570\uff0c\u8fd4\u56de\u5b9e\u65f6\u6570\u636e\u3002\u4e3b\u8981\u529f\u80fd\u5305\u62ec\uff1a<\/p>\n<ul>\n<li><strong>\u5929\u6c14\u67e5\u8be2<\/strong>\uff1a\u901a\u8fc7\u63a5\u5165\u6c14\u8c61 API\uff0c\u652f\u6301\u57ce\u5e02\u540d\u79f0\u3001\u65e5\u671f\u3001\u5929\u6c14\u72b6\u51b5\u7b49\u53c2\u6570\u7684\u81ea\u52a8\u63d0\u53d6\u4e0e\u8fd4\u56de\u3002<\/li>\n<li><strong>\u65e5\u5386\u7ba1\u7406<\/strong>\uff1a\u521b\u5efa\u3001\u4fee\u6539\u3001\u5220\u9664\u65e5\u7a0b\uff0c\u652f\u6301\u65f6\u95f4\u3001\u5730\u70b9\u3001\u53c2\u4e0e\u4eba\u7b49\u4fe1\u606f\u7684\u81ea\u7136\u8bed\u8a00\u89e3\u6790\u3002<\/li>\n<li><strong>\u591a\u8f6e\u5bf9\u8bdd\u6574\u5408<\/strong>\uff1a\u5728\u4e00\u6b21\u5bf9\u8bdd\u4e2d\u8fde\u7eed\u8c03\u7528\u591a\u4e2a\u51fd\u6570\uff0c\u5b9e\u73b0\u590d\u5408\u4efb\u52a1\uff08\u5982\u201c\u67e5\u5317\u4eac\u5929\u6c14\u540e\uff0c\u628a\u7ed3\u679c\u8bb0\u5165\u6211\u7684\u65e5\u5386\u201d\uff09\u3002<\/li>\n<\/ul>\n<h2>\u5e94\u7528\u573a\u666f\u4e0e\u4f18\u52bf<\/h2>\n<h3>\u667a\u80fd\u52a9\u624b\u573a\u666f<\/h3>\n<p>\u5728\u4e2a\u4eba\u52a9\u7406\u3001\u5ba2\u670d\u7cfb\u7edf\u6216 IoT \u8bbe\u5907\u4e2d\uff0cGLM-4 \u7684 Function Calling \u80fd\u5feb\u901f\u5c06\u7528\u6237\u6307\u4ee4\u8f6c\u5316\u4e3a\u7cfb\u7edf\u52a8\u4f5c\u3002\u4f8b\u5982\uff1a\u201c\u5e2e\u6211\u67e5\u4e00\u4e0b\u8fd9\u5468\u672b\u4e0a\u6d77\u9002\u5408\u53bb\u8fea\u58eb\u5c3c\u5417\uff1f\u201d\u6a21\u578b\u81ea\u52a8\u8c03\u7528\u5929\u6c14\u4e0e\u65e5\u5386\u51fd\u6570\uff0c\u8fd4\u56de\u5929\u6c14\u72b6\u51b5\u5e76\u68c0\u67e5\u65e5\u5386\u7a7a\u95f2\u65f6\u95f4\u3002<\/p>\n<h3>\u4f01\u4e1a\u6548\u7387\u5de5\u5177<\/h3>\n<p>\u5f00\u53d1\u8005\u65e0\u9700\u7f16\u5199\u590d\u6742\u7684\u72b6\u6001\u673a\u6216\u610f\u56fe\u5206\u7c7b\u903b\u8f91\uff0c\u53ea\u9700\u5b9a\u4e49\u51fd\u6570\u7b7e\u540d\u4e0e\u63cf\u8ff0\uff0cGLM-4 \u5373\u53ef\u81ea\u52a8\u7406\u89e3\u5e76\u7f16\u6392\u8c03\u7528\u987a\u5e8f\u3002\u8fd9\u964d\u4f4e\u4e86\u5f00\u53d1\u95e8\u69db\uff0c\u8ba9\u975e\u4e13\u4e1a AI \u5de5\u7a0b\u5e08\u4e5f\u80fd\u5feb\u901f\u6784\u5efa\u667a\u80fd\u5de5\u4f5c\u6d41\u3002<\/p>\n<h2>\u5982\u4f55\u4f7f\u7528 Function Calling<\/h2>\n<p>\u4f7f\u7528\u6b65\u9aa4\u6781\u4e3a\u7b80\u6d01\uff1a<\/p>\n<ul>\n<li>\u5728 API \u8bf7\u6c42\u4e2d\u901a\u8fc7 <code>tools<\/code> \u53c2\u6570\u4f20\u5165\u51fd\u6570\u5b9a\u4e49\uff08\u5305\u542b\u540d\u79f0\u3001\u63cf\u8ff0\u3001\u53c2\u6570 JSON Schema\uff09\u3002<\/li>\n<li>\u6a21\u578b\u5728\u751f\u6210\u56de\u590d\u65f6\uff0c\u5982\u679c\u5224\u65ad\u9700\u8981\u8c03\u7528\u5de5\u5177\uff0c\u4f1a\u8fd4\u56de <code>tool_calls<\/code> \u5bf9\u8c61\u3002<\/li>\n<li>\u5f00\u53d1\u8005\u6267\u884c\u5b9e\u9645\u51fd\u6570\u540e\uff0c\u5c06\u7ed3\u679c\u4f5c\u4e3a\u65b0\u6d88\u606f\u4f20\u56de\u6a21\u578b\uff0c\u7ee7\u7eed\u5bf9\u8bdd\u3002<\/li>\n<\/ul>\n<p>\u5b98\u65b9\u63d0\u4f9b\u4e86 Python\u3001JavaScript \u7b49\u591a\u79cd\u8bed\u8a00\u793a\u4f8b\uff0c\u652f\u6301\u6d41\u5f0f\u4e0e\u975e\u6d41\u5f0f\u8c03\u7528\u3002\u5177\u4f53\u4ee3\u7801\u793a\u4f8b\u4e0e API \u7ec6\u8282\u8bf7\u67e5\u770b <a href=\"https:\/\/open.bigmodel.cn\/\" target=\"_blank\">\u5b98\u65b9\u7f51\u7ad9<\/a> \u7684\u5f00\u53d1\u8005\u6587\u6863\u3002<\/p>\n<p>\u667a\u8c31 GLM-4 \u7684 Function Calling \u8ba9\u5927\u6a21\u578b\u4ece\u201c\u804a\u5929\u673a\u5668\u4eba\u201d\u8fdb\u5316\u4e3a\u201c\u771f\u6b63\u7684\u667a\u80fd\u7ba1\u5bb6\u201d\uff0c\u65e0\u8bba\u662f\u5f00\u53d1\u8005\u8fd8\u662f\u666e\u901a\u7528\u6237\uff0c\u90fd\u80fd\u4ece\u4e2d\u83b7\u5f97\u9ad8\u6548\u3001\u81ea\u7136\u7684\u5de5\u5177\u4ea4\u4e92\u4f53\u9a8c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u667a\u8c31 GLM-4 \u662f\u667a\u8c31AI\u63a8\u51fa\u7684\u65b0\u4e00\u4ee3\u5927\u8bed\u8a00\u6a21\u578b\uff0c\u5176\u5185\u7f6e\u7684 Function Calling \u80fd\u529b\u8ba9\u5f00\u53d1\u8005\u80fd [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[19626,19369,19625,4012,19624],"class_list":["post-16394","post","type-post","status-publish","format-standard","hentry","category-4","tag-ai","tag-function-calling","tag-19625","tag-4012","tag-glm-4"],"_links":{"self":[{"href":"https:\/\/ab123.xyz\/index.php?rest_route=\/wp\/v2\/posts\/16394","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ab123.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ab123.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ab123.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ab123.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=16394"}],"version-history":[{"count":1,"href":"https:\/\/ab123.xyz\/index.php?rest_route=\/wp\/v2\/posts\/16394\/revisions"}],"predecessor-version":[{"id":16396,"href":"https:\/\/ab123.xyz\/index.php?rest_route=\/wp\/v2\/posts\/16394\/revisions\/16396"}],"wp:attachment":[{"href":"https:\/\/ab123.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=16394"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ab123.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=16394"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ab123.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=16394"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}