{"id":23201,"date":"2024-11-16T10:20:18","date_gmt":"2024-11-16T02:20:18","guid":{"rendered":"https:\/\/www.1ai.net\/?p=23201"},"modified":"2024-11-16T10:23:55","modified_gmt":"2024-11-16T02:23:55","slug":"ai%e5%b0%8f%e7%a8%8b%e5%ba%8f%e6%90%ad%e5%bb%ba%ef%bc%8c%e5%a6%82%e4%bd%95%e5%bf%ab%e9%80%9f%e5%bc%80%e5%8f%91%e4%b8%80%e6%ac%beai%e5%be%ae%e4%bf%a1%e5%b0%8f%e7%a8%8b%e5%ba%8f","status":"publish","type":"post","link":"https:\/\/www.1ai.net\/en\/23201.html","title":{"rendered":"ai small program build, how to quickly develop an AI weibo small program"},"content":{"rendered":"<p>\u5728\u8fd9\u4e2aAI\u65f6\u4ee3\uff0c\u7ed3\u5408AI\u505a\u65b0\u7684\u4ea7\u54c1\u6216\u57fa\u4e8e\u4f60\u5148\u6709\u7684\u4e1a\u52a1\u52a0\u5165AI\u80fd\u529b\uff0c\u8fd9\u4e2a\u662f\u8d8b\u52bf\u6240\u5728\uff0c\u90a3\u4e48\u5982\u4f55\u66f4\u5feb\u7684\u63a5\u5165AI\u80fd\u529b\uff1f\u63a5\u4e0b\u7ed9\u5927\u5bb6\u5206\u4eab\u4e0b\u4e91\u5f00\u53d1AI+\u7684\u96c6\u6210\u65b9\u5f0f\u3002<\/p>\n<p><strong>\u6b65\u9aa4<\/strong><\/p>\n<p>\u767b\u5f55\u5fae\u4fe1\u4e91\u5f00\u53d1\u540e\u53f0<br \/>\nhttps:\/\/tcb.cloud.tencent.com\/cloud-admin?_tcbProviderId=mp<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-23202\" title=\"de87306dj00sn0tz70023d000qm012cm\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/11\/de87306dj00sn0tz70023d000qm012cm.jpg\" alt=\"de87306dj00sn0tz70023d000qm012cm\" width=\"958\" height=\"1380\" \/><\/p>\n<p>\u7136\u540e\u627e\u5230AI+\u83dc\u5355<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-23203\" title=\"2be293aej00sn0tz7000dd000u00058m\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/11\/2be293aej00sn0tz7000dd000u00058m.jpg\" alt=\"2be293aej00sn0tz7000dd000u00058m\" width=\"1080\" height=\"188\" \/><\/p>\n<p>\u4e00\u5171\u5206\u4e3a\u4e24\u5757\uff1a<\/p>\n<p>1.AI\u5927\u6a21\u578b\uff1a\u9002\u7528\u4e8e\u5feb\u901f\u63a5\u5165\u5927\u6a21\u578b\u7684\u57fa\u7840AI\u5bf9\u8bdd\u80fd\u529b<\/p>\n<p>2.\u81ea\u5b9a\u4e49AI\u80fd\u529b\uff1a\u9002\u7528\u4e8e\u5177\u4f53\u4e1a\u52a1\u7684AI\u667a\u80fd\u4f53\u642d\u5efa\uff0c\u652f\u6301\u77e5\u8bc6\u5e93<\/p>\n<p><strong>\u63a5\u5165AI\u5927\u6a21\u578b<\/strong><\/p>\n<p>\u6211\u4eec\u5148\u4eceAI\u5927\u6a21\u578b\u5f00\u59cb\u4f53\u9a8c\uff0c\u8fdb\u5165AI\u5927\u6a21\u578b\u6a21\u5757<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-23204\" title=\"a77f1713j00sn0tz7000xd000u000gxm\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/11\/a77f1713j00sn0tz7000xd000u000gxm.jpg\" alt=\"a77f1713j00sn0tz7000xd000u000gxm\" width=\"1080\" height=\"609\" \/><\/p>\n<p>\u652f\u6301\u63a5\u5165\u56fd\u5185\u591a\u5bb6\u5927\u6a21\u578b\uff0c\u53ea\u9700\u8981\u586b\u5199Key\u5373\u53ef\uff0c\u6bcf\u5bb6\u5927\u6a21\u578b\u670d\u52a1\u540e\u53f0\u83b7\u53d6\u65b9\u5f0f\u53ef\u4ee5\u53bb\u770b\u5404\u5bb6\u7684\u6587\u6863\u3002<\/p>\n<p>\u8fd9\u8fb9\u6211\u4f7f\u7528\u7684\u5927\u6a21\u578b\u662f\u667a\u8c31\uff0c\u8f93\u5165key\u540e\u70b9\u51fb\u53f3\u4e0a\u89d2\u4fdd\u5b58\uff0c\u7136\u540e\u5de6\u8fb9\u76f8\u5173\u7684\u6a21\u578b\u4f1a\u6709\u4e2a\u300c\u5df2\u542f\u7528\u300d\u72b6\u6001\uff0c\u8fd9\u4e2a\u65f6\u5019\u5c31\u914d\u7f6e\u597d\u4e86\u3002<\/p>\n<p>\u6211\u8fd9\u8fb9\u4ee5<a href=\"https:\/\/www.1ai.net\/en\/tag\/%e5%b0%8f%e7%a8%8b%e5%ba%8f\" title=\"\u3010\u67e5\u770b\u542b\u6709[\u5c0f\u7a0b\u5e8f]\u6807\u7b7e\u7684\u6587\u7ae0\u3011\" target=\"_blank\" rel=\"noopener\">\u5c0f\u7a0b\u5e8f<\/a>SDK\u4e3a\u4f8b\uff1a<\/p>\n<p><strong>\u7b2c\u4e00\u6b65\uff1a\u5148\u5b89\u88c5 npm \u5305<\/strong><\/p>\n<p>\u5728\u5c0f\u7a0b\u5e8f package.json \u6240\u5728\u7684\u76ee\u5f55\uff08\u4e00\u822c\u662f miniprogram \u76ee\u5f55\uff09\u6267\u884c\u547d\u4ee4\u5b89\u88c5\u547d\u4ee4\uff1a<\/p>\n<p><code>npm i @cloudbase\/js-sdk@2.8.3-beta.0<\/code><\/p>\n<p><strong>\u7b2c\u4e8c\u6b65\uff1a\u521d\u59cb\u5316ai\u5bf9\u8c61<\/strong><\/p>\n<pre><code>const env = \"\u586b\u5199\u4f60\u7684\u73af\u5883ID\";\r\nregisterAuth(cloudbase);\r\nregisterAi(cloudbase);\r\nconst app = cloudbase.init({ env });\r\nconst auth = app.auth({ persistence: \"local\" });\r\nawait auth.signInWithOpenId(); \/\/ \u6216\u8005\u4f7f\u7528\u5176\u4ed6\u767b\u5f55\u65b9\u5f0f\r\nconst ai = await app.ai();\r\n\/\/ \u63a5\u4e0b\u6765\u5c31\u53ef\u4ee5\u8c03\u7528 ai \u6a21\u5757\u63d0\u4f9b\u7684\u521b\u5efa\u6a21\u578b\u7b49\u65b9\u6cd5\u4e86\r\n<\/code><\/pre>\n<p>\u7136\u540e\u4f60\u4f1a\u770b\u5230\u63a7\u5236\u53f0\u62a5\u9519<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-23205\" title=\"dd1f2812j00sn0tzt001ed000u0009qm\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/11\/dd1f2812j00sn0tzt001ed000u0009qm.jpg\" alt=\"dd1f2812j00sn0tzt001ed000u0009qm\" width=\"1080\" height=\"350\" \/><\/p>\n<p>\u56e0\u4e3aSDK\u4e2d\u6709\u8bf7\u6c42\u57df\u540d\u9700\u8981\u5728\u5c0f\u7a0b\u5e8f\u540e\u53f0\u914d\u7f6e\u5373\u53ef\u6216\u8005\u53ef\u4ee5\u5728\u672c\u5730\u8bbe\u7f6e\u4e2d\u52fe\u9009\u4e0d\u6821\u9a8c\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-23206\" title=\"421162cbj00sn0tzt002id000m00152m\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/11\/421162cbj00sn0tzt002id000m00152m.jpg\" alt=\"421162cbj00sn0tzt002id000m00152m\" width=\"792\" height=\"1478\" \/><\/p>\n<p>\u6ce8\u610f\uff1a\u52fe\u9009\u4e0d\u6821\u9a8c\u76ee\u7684\u662f\u4e3a\u4e86\u53ef\u4ee5\u4f53\u9a8c\u4f7f\u7528\uff0c\u5982\u679c\u8981\u53d1\u5e03\u4e0a\u7ebf\u8fd8\u662f\u8981\u5728\u540e\u53f0\u914d\u7f6e\u57df\u540d\u914d\u7f6e<\/p>\n<p><strong>\u7b2c\u4e09\u6b65\uff1a\u4f7f\u7528AI\u5927\u6a21\u578b\uff0c\u63a8\u8350\u6d41\u5f0f\u8c03\u7528<\/strong><\/p>\n<pre><code> const aiModel = ai.createModel(\"zhipu\"); \/\/ \u521b\u5efa\u6a21\u578b\r\n    const res = await aiModel.streamText({\r\n      model: \"glm-4-plus\",\r\n      messages: [{\r\n        role: \"user\",\r\n        content: \"\u4f60\u597d\uff0c\u8bf7\u4f60\u4ecb\u7ecd\u4e00\u4e0b\u674e\u767d\"\r\n      }, ],\r\n    });\r\n    for await (let str of res.textStream) {\r\n      console.log(str);\r\n    }\r\n<\/code><\/pre>\n<p>\u8c03\u7528\u6210\u529f<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-23207\" title=\"39a60027j00sn0tzt001fd000u000dkm\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/11\/39a60027j00sn0tzt001fd000u000dkm.jpg\" alt=\"39a60027j00sn0tzt001fd000u000dkm\" width=\"1080\" height=\"488\" \/><\/p>\n<p><strong>\u63a5\u5165AI Agent<\/strong><\/p>\n<p>\u9996\u5148\u8981\u5148\u521b\u5efa\u4e00\u4e2a Agent \u667a\u80fd\u4f53<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-23208\" title=\"5ee00e0fj00sn0tzt000fd000u000dgm\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/11\/5ee00e0fj00sn0tzt000fd000u000dgm.jpg\" alt=\"5ee00e0fj00sn0tzt000fd000u000dgm\" width=\"1080\" height=\"484\" \/><\/p>\n<p>\u9ed8\u8ba4\u5185\u7f6e\u4e00\u4e9b Agent \u6a21\u7248\uff0c\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\u6a21\u7248\u6216\u8005\u521b\u65b0\u65b0\u7684Agent\uff0c\u53f3\u8fb9\u8f93\u5165\u540d\u79f0\u548c\u4ecb\u7ecd\u5373\u53ef\u70b9\u51fb\u53f3\u4e0b\u89d2\u300c\u65b0\u5efa\u300d\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-23209\" title=\"f6384344j00sn0tzt002kd000u000n6m\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/11\/f6384344j00sn0tzt002kd000u000n6m.jpg\" alt=\"f6384344j00sn0tzt002kd000u000n6m\" width=\"1080\" height=\"834\" \/><\/p>\n<p>\u7136\u540e\u4f1a\u8fdb\u5165\u7f16\u8f91\u8be6\u60c5\u9875\u9762\uff0c\u4e00\u5171\u5206\u4e3a\u4e09\u4e2a\u533a\u57df\uff0c\u4ece\u5de6\u5230\u53f3<\/p>\n<ol>\n<li>Agent \u5217\u8868\u533a\u57df\uff0c\u663e\u793a\u6240\u6709\u7684Agent\u4ee5\u53ca\u53ef\u4ee5\u5207\u6362<\/li>\n<li>\u7f16\u6392 Agent \u533a\u57df\uff0c\u652f\u6301\u8bbe\u7f6e\u4eba\u8bbe\u548c\u56de\u590d\u903b\u8f91\u4ee5\u53ca\u6dfb\u52a0\u77e5\u8bc6\u5e93\u3001\u5f00\u573a\u767d\u3001\u95ee\u9898\u3001\u95ee\u9898\u5efa\u8bae<\/li>\n<li>Agent \u9884\u89c8\u8c03\u8bd5\u533a\u57df\uff0c\u5f53\u8bbe\u7f6e\u597d Agent \u540e\u53ef\u4ee5\u5728\u8fd9\u4e2a\u533a\u57df\u8fdb\u884c\u6548\u679c\u8c03\u8bd5<\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-23211\" title=\"a3a070fej00sn0tzt000td000u000frm\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/11\/a3a070fej00sn0tzt000td000u000frm.jpg\" alt=\"a3a070fej00sn0tzt000td000u000frm\" width=\"1080\" height=\"567\" \/><\/p>\n<p>\u6211\u4eec\u5148\u6765\u770b\u4e0b\u7f16\u6392 Agent \u533a\u57df\u300c\u4eba\u8bbe\u4e0e\u56de\u590d\u7ea6\u675f\u300d\u53ef\u4ee5\u70b9\u51fb\u53f3\u8fb9\u300c\u751f\u6210\u300d\u6309\u94ae\u81ea\u52a8\u751f\u6210\u63d0\u793a\u8bcd\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-23210\" title=\"598a1fefj00sn0tzt0029d000u000ukm\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/11\/598a1fefj00sn0tzt0029d000u000ukm.jpg\" alt=\"598a1fefj00sn0tzt0029d000u000ukm\" width=\"1080\" height=\"1100\" \/><\/p>\n<p>\u70b9\u51fb\u4f7f\u7528\u5373\u53ef\u5e94\u7528\uff0c\u8bbe\u7f6e\u5b8c\u6210\u540e\u53ef\u4ee5\u5728\u53f3\u8fb9\u533a\u57df\u5bf9\u8bdd\u6d4b\u8bd5\u6548\u679c<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-23212\" title=\"a1df7882j00sn0tzt001gd000u000ftm\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/11\/a1df7882j00sn0tzt001gd000u000ftm.jpg\" alt=\"a1df7882j00sn0tzt001gd000u000ftm\" width=\"1080\" height=\"569\" \/><\/p>\n<p>\u8fd8\u53ef\u4ee5\u4e3a\u8fd9\u4e2a\u667a\u80fd\u4f53\u6dfb\u52a0\u77e5\u8bc6\u5e93\uff0c\u70b9\u51fb\u3010\u7ba1\u7406\u77e5\u8bc6\u5e93\u3011<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-23213\" title=\"9cc145aaj00sn0tzt000gd000u000d5m\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/11\/9cc145aaj00sn0tzt000gd000u000d5m.jpg\" alt=\"9cc145aaj00sn0tzt000gd000u000d5m\" width=\"1080\" height=\"473\" \/><\/p>\n<p>\u53bb\u65b0\u5efa\u8f93\u5165\u6807\u9898\u548c\u63cf\u8ff0<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-23214\" title=\"68d001c6j00sn0tzt000od000u000i0m\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/11\/68d001c6j00sn0tzt000od000u000i0m.jpg\" alt=\"68d001c6j00sn0tzt000od000u000i0m\" width=\"1080\" height=\"648\" \/><\/p>\n<p>\u6210\u529f\u540e\u4f1a\u51fa\u73b0\u4e00\u4e2a\u6587\u4ef6\u5939<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-23216\" title=\"aaaf6b1dj00sn0tzt000qd000u000i1m\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/11\/aaaf6b1dj00sn0tzt000qd000u000i1m.jpg\" alt=\"aaaf6b1dj00sn0tzt000qd000u000i1m\" width=\"1080\" height=\"649\" \/><\/p>\n<p>\u7136\u540e\u6dfb\u52a0\u6587\u4ef6<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-23215\" title=\"012af30fj00sn0tzt000ed000u0007tm\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/11\/012af30fj00sn0tzt000ed000u0007tm.jpg\" alt=\"012af30fj00sn0tzt000ed000u0007tm\" width=\"1080\" height=\"281\" \/><\/p>\n<p>\u652f\u6301\u5355\u4e2a\/\u591a\u4e2a\u6dfb\u52a0\u6587\u4ef6<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-23217\" title=\"d5a8261dj00sn0tzt0008d000aa0086m\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/11\/d5a8261dj00sn0tzt0008d000aa0086m.jpg\" alt=\"d5a8261dj00sn0tzt0008d000aa0086m\" width=\"370\" height=\"294\" \/><\/p>\n<p>\u6bd4\u5982\u6211\u6dfb\u52a0\u4e00\u4e2a\u6c7d\u8f66\u6545\u969c\u5e38\u89c1\u95ee\u9898\u7684\u6587\u6863<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-23218\" title=\"8ca99fc3j00sn0tzt004ed000u0010rm\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/11\/8ca99fc3j00sn0tzt004ed000u0010rm.jpg\" alt=\"8ca99fc3j00sn0tzt004ed000u0010rm\" width=\"1080\" height=\"1323\" \/><\/p>\n<p>\u6dfb\u52a0\u5b8c\u6210\u540e\u4f1a\u8fdb\u5165\u540e\u72b6\u6001\u4f1a\u51fa\u73b0\u4e00\u4e2a\u300c\u6587\u4ef6\u89e3\u6790\u4e2d\u300d\u8f6c\u53d8\u6210\u300c\u6587\u4ef6\u89e3\u6790\u5199\u5165\u5b8c\u6210\u300d<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-23219\" title=\"239b1845j00sn0tzt000fd000u0006um\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/11\/239b1845j00sn0tzt000fd000u0006um.jpg\" alt=\"239b1845j00sn0tzt000fd000u0006um\" width=\"1080\" height=\"246\" \/><\/p>\n<p>\u7136\u540e\u56de\u5230\u7f16\u8f91\u9875\u9762\u8fdb\u884c\u6dfb\u52a0\u77e5\u8bc6\u5e93\u6587\u4ef6\u5939\u5373\u53ef\uff0c\u5269\u4e0b\u7684\u5c31\u662f\u4e00\u4e9b\u57fa\u7840\u914d\u7f6e\u5f00\u573a\u767d\u548c\u9884\u8bbe\u63d0\u95ee\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-23220\" title=\"e0281396j00sn0tzt000ud000u000gem\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/11\/e0281396j00sn0tzt000ud000u000gem.jpg\" alt=\"e0281396j00sn0tzt000ud000u000gem\" width=\"1080\" height=\"590\" \/><\/p>\n<p>\u63a5\u4e0b\u6765\u6211\u4eec\u6d4b\u8bd5\u4e0b\u77e5\u8bc6\u5e93\u8bbe\u7f6e\u5b8c\u6210\u540e\u7684\u6548\u679c\uff0c\u5f53\u6211\u53d1\u9001\u4e86\u521a\u624d\u5728\u6587\u6863\u4e2d\u63d0\u5230\u7684\u201c\u5f00\u95e8\u54af\u5431\u54af\u5431\u5f02\u54cd\u201d\u95ee\u9898\u540e\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-23221\" title=\"efee6e69j00sn0tzt001qd000ke00m8m\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/11\/efee6e69j00sn0tzt001qd000ke00m8m.jpg\" alt=\"efee6e69j00sn0tzt001qd000ke00m8m\" width=\"734\" height=\"800\" \/><\/p>\n<p>\u5b83\u4f1a\u5728\u56de\u7b54\u7684\u6700\u540e\u9762\u7ed9\u51fa\u5f15\u7528\u7684\u77e5\u8bc6\u5e93\u6765\u6e90\uff0c\u8fd9\u6837\u5c31\u53ef\u4ee5\u6781\u5927\u7a0b\u5ea6\u7684\u907f\u514d\u5927\u6a21\u578b\u5728\u5177\u4f53\u5185\u5bb9\u4e0a\u7684\u5e7b\u89c9\u95ee\u9898\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-23222\" title=\"ea6aabb5j00sn0tzt001id000kc00l4m\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/11\/ea6aabb5j00sn0tzt001id000kc00l4m.jpg\" alt=\"ea6aabb5j00sn0tzt001id000kc00l4m\" width=\"732\" height=\"760\" \/><\/p>\n<p>\u5f53\u6211\u4eec\u5168\u90e8\u914d\u7f6e\u5b8c\u6bd5\u540e\u90a3\u5c31\u53ef\u4ee5\u76f4\u63a5\u53bb\u4f7f\u7528\u4e86\uff0c\u70b9\u51fb\u53f3\u4e0a\u89d2\u7684\u63a5\u5165\u6307\u5f15\u5373\u53ef\u547c\u51fa\u53d1\u5e03\u6587\u6863\u3002<\/p>\n<p><strong>\u53d1\u5e03<\/strong><\/p>\n<p>\u4e00\u5171\u5206\u4e3a\u4e09\u79cd\u65b9\u5f0f\uff1a<br \/>\n1.\u5bf9\u63a5\u5fae\u4fe1\u5e73\u53f0<br \/>\n2.\u5c0f\u7a0b\u5e8f\u533a\u5757\u7ec4\u4ef6<br \/>\n3.SDK\u8c03\u7528<\/p>\n<p>\u63a8\u8350\u4f7f\u7528\u8fd9\u4e24\u79cd\u65b9\u5f0f\u5bf9\u63a5\u5fae\u4fe1\u5e73\u53f0\u548cSDK\u8c03\u7528\uff0c\u5bf9\u63a5\u5fae\u4fe1\u5e73\u53f0\u5b8c\u5168\u65e0\u4ee3\u7801\u66f4\u7b80\u5355\uff0cSDK\u8c03\u7528\u7eaf\u4ee3\u7801\u65b9\u5f0f\u8c03\u7528\u66f4\u7075\u6d3b\uff0c\u5982\u679c\u4f60\u7684\u5e94\u7528\u573a\u666f\u4e0d\u662f\u5bf9\u8bdd\u6a21\u5f0f\u90a3\u4e48\u53ef\u4ee5\u7528\u4ee3\u7801\u7684\u65b9\u5f0f\u690d\u5165\u4f60\u7684\u4e1a\u52a1\u6d41\u4e2d\u3002<\/p>\n<p><strong>\u5bf9\u63a5\u5fae\u4fe1\u5e73\u53f0<\/strong><br \/>\n\u652f\u6301\u5c0f\u7a0b\u5e8f\u5ba2\u670d\uff0c\u5fae\u4fe1\u5ba2\u670d\uff0c\u5fae\u4fe1\u670d\u52a1\u53f7\uff0c\u5fae\u4fe1\u8ba2\u9605\u53f7<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-23223\" title=\"9c4b0bc1j00sn0tzt0022d000po014mm\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/11\/9c4b0bc1j00sn0tzt0022d000po014mm.jpg\" alt=\"9c4b0bc1j00sn0tzt0022d000po014mm\" width=\"924\" height=\"1462\" \/><\/p>\n<p>\u914d\u7f6e\u8fc7\u7a0b\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u8981\u6839\u636e\u6b65\u9aa4\u8bbe\u7f6eAppID\u7136\u540e\u626b\u7801\u6388\u6743\u5373\u53ef\u5b8c\u6210\u3002<\/p>\n<p><strong>\u5c0f\u7a0b\u5e8f\u533a\u5757\u7ec4\u4ef6<\/strong><br \/>\n\u9700\u8981\u4ece\u4e3b\u83dc\u5355\u5207\u6362\u5230\u6211\u7684\u5e94\u7528\uff0c\u521b\u5efa\u4e00\u4e2a\u7a7a\u767d\u5e94\u7528<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-23224\" title=\"36f2653dj00sn0tzt000xd000k000kkm\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/11\/36f2653dj00sn0tzt000xd000k000kkm.jpg\" alt=\"36f2653dj00sn0tzt000xd000k000kkm\" width=\"720\" height=\"740\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-23225\" title=\"4ab97486j00sn0tzt000zd000u000ejm\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/11\/4ab97486j00sn0tzt000zd000u000ejm.jpg\" alt=\"4ab97486j00sn0tzt000zd000u000ejm\" width=\"1080\" height=\"523\" \/><\/p>\n<p>\u7136\u540e\u4f1a\u5c31\u8fdb\u5165\u5fae\u642d\u7f16\u8f91\u9875\u9762\uff0c\u9009\u62e9\u53f3\u8fb9\u533a\u5757\u641c\u7d22\u300cAgent\u300d<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-23226\" title=\"7861e790j00sn0tzt000rd000u000eqm\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/11\/7861e790j00sn0tzt000rd000u000eqm.jpg\" alt=\"7861e790j00sn0tzt000rd000u000eqm\" width=\"1080\" height=\"530\" \/><\/p>\n<p>\u9009\u62e9\u73a9AgentUI\u4e4b\u540e\u914d\u7f6eID<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-23227\" title=\"28e36dbaj00sn0tzt0013d000u000fam\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/11\/28e36dbaj00sn0tzt0013d000u000fam.jpg\" alt=\"28e36dbaj00sn0tzt0013d000u000fam\" width=\"1080\" height=\"550\" \/><\/p>\n<p>ID\u5728Agent\u8be6\u60c5\u540d\u79f0\u6709\u4e2a\u590d\u5236ID\u529f\u80fd<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-23228\" title=\"1dfc37c8j00sn0tzt000rd000u000a3m\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/11\/1dfc37c8j00sn0tzt000rd000u000a3m.jpg\" alt=\"1dfc37c8j00sn0tzt000rd000u000a3m\" width=\"1080\" height=\"363\" \/><\/p>\n<p>\u914d\u7f6eID\u540e\u6570\u636e\u5c31\u4f1a\u540c\u6b65\u5230\u8fd9\u4e2aUI\u7ec4\u4ef6\u4e0a\uff0c\u4f60\u53ef\u4ee5\u4fee\u6539\u5b83\u7684\u5c5e\u6027\u3001\u4e8b\u4ef6\u3001\u6837\u5f0f\u7b49<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-23229\" title=\"97b94f50j00sn0tzt0013d000u000eim\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/11\/97b94f50j00sn0tzt0013d000u000eim.jpg\" alt=\"97b94f50j00sn0tzt0013d000u000eim\" width=\"1080\" height=\"522\" \/><\/p>\n<p>\u5168\u90e8\u4fee\u6539\u5b8c\u6210\u4e4b\u540e\u6211\u4eec\u53ef\u4ee5\u9009\u62e9Agent-UI\u7ec4\u4ef6\uff0c\u7136\u540e\u5207\u6362\u5230\u914d\u7f6e\u8fd9\u91cc\u53ef\u4ee5\u76f4\u63a5\u4e0b\u8f7d\u4ee3\u7801\u5305<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-23230\" title=\"fea2001dj00sn0tzt000wd000u000b8m\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/11\/fea2001dj00sn0tzt000wd000u000b8m.jpg\" alt=\"fea2001dj00sn0tzt000wd000u000b8m\" width=\"1080\" height=\"404\" \/><\/p>\n<p>\u7136\u540e\u6839\u636e\u8ddf\u8fdb\u6587\u6863\u5c31\u53ef\u4ee5\u96c6\u6210\u5230\u4f60\u7684\u5c0f\u7a0b\u5e8f\u4e2d<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-23231\" title=\"5e24ac9dj00sn0tzt002md000u000zbm\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/11\/5e24ac9dj00sn0tzt002md000u000zbm.jpg\" alt=\"5e24ac9dj00sn0tzt002md000u000zbm\" width=\"1080\" height=\"1271\" \/><\/p>\n<p>SDK\u8c03\u7528\uff1a<\/p>\n<ol class=\"list-paddingleft-1\">\n<li>\u5148\u5efa\u7acb\u8fde\u63a5<\/li>\n<\/ol>\n<pre><code>\/\/ \u5728\u5f00\u59cb\u4e4b\u524d\uff0c\u8bf7\u786e\u4fdd\u5b8c\u6210\u914d\u7f6e\u4e86\u5c0f\u7a0b\u5e8f request \u5408\u6cd5\u57df\u540d\uff0c\u8be6\u60c5\u8bf7\u53c2\u8003 https:\/\/docs.cloudbase.net\/quick-start\/baas\/wx-mini\r\n\/\/ \u5728\u5c0f\u7a0b\u5e8f package.json \u6240\u5728\u7684\u76ee\u5f55\uff08\u4e00\u822c\u662f miniprogram \u76ee\u5f55\uff09\u6267\u884c\u547d\u4ee4\u5b89\u88c5 npm \u5305\uff1a\r\n\/\/ npm i @cloudbase\/js-sdk@2.8.3-beta.0\r\n\/\/ \u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u70b9\u51fb\u5fae\u4fe1\u5f00\u53d1\u8005\u5de5\u5177\u7684\u83dc\u5355\u680f\u4e2d\u300c\u5de5\u5177 -&gt; \u6784\u5efa npm\u300d\r\n\r\n\/\/ \u5f15\u5165 SDK\uff0c\u8fd9\u91cc\u6211\u4eec\u4ee5\u5206\u6a21\u5757\u7684\u5f62\u5f0f\u6309\u9700\u5f15\u5165\u4e86 cloudbase-js-sdk\uff0c\u4e5f\u652f\u6301\u5b8c\u6574\u5f15\u5165\r\nimport cloudbase from \"@cloudbase\/js-sdk\/app\";\r\nimport { registerAuth } from \"@cloudbase\/js-sdk\/auth\";\r\nimport { registerAi } from \"@cloudbase\/js-sdk\/ai\";\r\n\r\nregisterAuth(cloudbase);\r\nregisterAi(cloudbase);\r\nconst app = cloudbase.init({\r\n  env: \"your-env\", \/\/ \u9700\u66ff\u6362\u4e3a\u5b9e\u9645\u4f7f\u7528\u73af\u5883 id\r\n});\r\nconst auth = app.auth({ persistence: \"local\" });\r\nawait auth.signInWithOpenId(); \/\/ \u6216\u8005\u4f7f\u7528\u5176\u4ed6\u767b\u5f55\u65b9\u5f0f\r\nconst ai = await app.ai();\r\n\/\/ \u63a5\u4e0b\u6765\u5c31\u53ef\u4ee5\u8c03\u7528 ai \u6a21\u5757\u63d0\u4f9b\u7684\u65b9\u6cd5\u4e86<\/code><\/pre>\n<ol class=\"list-paddingleft-1\" start=\"2\">\n<li>\u6307\u5b9a\u5177\u4f53Agent\u5bf9\u8bdd<\/li>\n<\/ol>\n<pre><code>const res = await ai.bot.sendMessage({\r\n  botId: \"botId-xxx\",\r\n  msg: \"\u7ed9\u6211\u4e00\u4e2a\u6210\u8bed\u3002\",\r\n});\r\n\r\nfor await (let str of res.textStream) {\r\n  console.log(str);\r\n}\r\n\/\/ \u5f53\u7136\r\n\/\/ \u53ef\u4ee5\r\n\/\/ \uff01\r\n\/\/ \u8fd9\u91cc\r\n\/\/ \u6709\u4e00\u4e2a\r\n\/\/ \u6210\u8bed\r\n<\/code><\/pre>\n<ol class=\"list-paddingleft-1\" start=\"3\">\n<li>\u67e5\u770b\u804a\u5929\u8bb0\u5f55<\/li>\n<\/ol>\n<pre><code>const res = await ai.bot.getChatRecords({\r\n  botId: \"botId-xxx\",\r\n  pageNumber: 1,\r\n  pageSize: 10,\r\n  sort: \"asc\",\r\n});\r\n\/\/ {\r\n\/\/   \"recordList\": [\r\n\/\/     {\r\n\/\/       \"botId\": \"bot-809d4ad1\",\r\n\/\/       \"recordId\": \"record-96617446\",\r\n\/\/       \"role\": \"user\",\r\n\/\/       \"content\": \"\u4f60\u597d\",\r\n\/\/       \"conversation\": \"r3Hjz3qgms3UG7z9lwSYbA\",\r\n\/\/       \"type\": \"text\",\r\n\/\/       \"triggerSrc\": \"TCB\"\r\n\/\/     },\r\n\/\/     {\r\n\/\/       \"botId\": \"bot-809d4ad1\",\r\n\/\/       \"recordId\": \"record-632906dd\",\r\n\/\/       \"role\": \"assistant\",\r\n\/\/       \"content\": \"\u60a8\u597d\uff01\u770b\u8d77\u6765\u60a8\u53ef\u80fd\u9047\u5230\u4e86\u4e00\u4e9b\u6280\u672f\u95ee\u9898\uff0c\u6216\u8005\u53ea\u662f\u60f3\u6253\u4e2a\u62db\u547c\u3002\u65e0\u8bba\u54ea\u79cd\u60c5\u51b5\uff0c\u6211\u90fd\u5728\u8fd9\u91cc\u4e3a\u60a8\u63d0\u4f9b\u5e2e\u52a9\u3002\u5982\u679c\u60a8\u6709\u4efb\u4f55\u5177\u4f53\u7684\u95ee\u9898\u6216\u9700\u8981\u534f\u52a9\uff0c\u8bf7\u968f\u65f6\u544a\u8bc9\u6211\uff01\",\r\n\/\/       \"conversation\": \"r3Hjz3qgms3UG7z9lwSYbA\",\r\n\/\/       \"type\": \"text\",\r\n\/\/       \"triggerSrc\": \"TCB\"\r\n\/\/     }\r\n\/\/   ],\r\n\/\/   \"total\": 2\r\n\/\/ }\r\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>\u5230\u8fd9\u91cc\u6574\u4e2a\u63a5\u5165AI\u7684\u6d41\u7a0b\u5c31\u5168\u90e8\u7ed3\u675f\u4e86\u3002<\/p>\n<p><strong>\u6700\u540e<\/strong><\/p>\n<p>\u5e0c\u671b\u5927\u5bb6\u80fd\u8ddf\u4e0aAI\u65f6\u4ee3\u7684\u6b65\u4f10\uff0c\u505a\u51fa\u81ea\u5df1\u7684AI\u5c0f\u7a0b\u5e8f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this AI era, combined with AI to make new products or based on your first business to join the AI capabilities, this is where the trend is, so how to access the AI capabilities faster? Next to share with you the integration method of cloud development AI+. Steps Login to the WeChat cloud development background https:\/\/tcb.cloud.tencent.com\/cloud-admin?_tcbProviderId=mp and then find the AI+ menu A total of two pieces: 1. AI big model: applies to rapid access to the basic AI dialog capabilities of the big model 2. custom AI capabilities: applies to specific business Custom AI capabilities: for business-specific AI intelligent body building, support for knowledge base Access to the AI big model Let's start with the AI big model experience, enter the AI big model module support<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[149,144],"tags":[4949,1690,3905],"collection":[],"class_list":["post-23201","post","type-post","status-publish","format-standard","hentry","category-jiaocheng","category-baike","tag-ai","tag-1690","tag-3905"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/posts\/23201","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/comments?post=23201"}],"version-history":[{"count":0,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/posts\/23201\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/media?parent=23201"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/categories?post=23201"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/tags?post=23201"},{"taxonomy":"collection","embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/collection?post=23201"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}