{"id":107570,"date":"2026-09-19T21:08:58","date_gmt":"2026-09-19T13:08:58","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/107570.html"},"modified":"2026-09-19T21:08:58","modified_gmt":"2026-09-19T13:08:58","slug":"%e7%a0%81%e9%81%93-%c2%b7-%e5%af%bb%e8%89%ba-%e4%bb%8e%e9%9b%b6%e6%9e%84%e5%bb%ba%e9%9d%9e%e9%81%97%e4%ba%a4%e4%ba%92%e5%bc%8f%e5%af%b9%e8%af%9d%e5%b9%b3%e5%8f%b0","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/107570.html","title":{"rendered":"\u7801\u9053 \u00b7 \u5bfb\u827a\u2014\u2014\u4ece\u96f6\u6784\u5efa\u201c\u975e\u9057\u4ea4\u4e92\u5f0f\u5bf9\u8bdd\u5e73\u53f0\u201c\u7684\u5b8c\u6574\u5b9e\u8df5"},"content":{"rendered":"<h2>\u7801\u9053 \u00b7 \u5bfb\u827a\u2014\u2014\u4ece\u96f6\u6784\u5efa&#034;\u975e\u9057\u4ea4\u4e92\u5f0f\u5bf9\u8bdd\u5e73\u53f0&#034;\u7684\u5b8c\u6574\u5b9e\u8df5<\/h2>\n<p>\u7528\u4e00\u884c\u884c\u4ee3\u7801&#xff0c;\u5728\u6570\u5b57\u4e16\u754c\u91cc\u4e3a\u5343\u5e74\u6280\u827a\u7559\u4e00\u76cf\u706f\u3002<br \/>\n\u2014\u2014 \u8bb0&#034;\u5bfb\u827a \u00b7 \u975e\u9057\u4ea4\u4e92\u5f0f\u5bf9\u8bdd\u5e73\u53f0&#034;\u7684\u8bde\u751f<\/p>\n<hr \/>\n<p>\u4ed3\u5e93\u5730\u5740&#xff1a;https:\/\/gitcode.com\/Zch070214\/FEIYI<br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260919130854-6aae8966cf123.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>\u7801\u9053\u4ee3\u7801\u751f\u6210<br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260919130856-6aae8968ed233.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h3>\u4e00\u3001\u5199\u5728\u524d\u9762&#xff1a;\u6211\u4eec\u4e3a\u4ec0\u4e48\u8981\u505a\u8fd9\u4ef6\u4e8b<\/h3>\n<p>\u4e2d\u56fd\u975e\u7269\u8d28\u6587\u5316\u9057\u4ea7\u6d69\u5982\u70df\u6d77\u3002\u636e\u6587\u5316\u548c\u65c5\u6e38\u90e8\u516c\u5e03\u7684\u6570\u636e&#xff0c;\u6211\u56fd\u5df2\u6709\u56fd\u5bb6\u7ea7\u975e\u7269\u8d28\u6587\u5316\u9057\u4ea7\u4ee3\u8868\u6027\u9879\u76ee\u4e00\u5343\u4e94\u767e\u4f59\u9879&#xff0c;\u6db5\u76d6\u6c11\u95f4\u6587\u5b66\u3001\u4f20\u7edf\u97f3\u4e50\u3001\u4f20\u7edf\u821e\u8e48\u3001\u4f20\u7edf\u620f\u5267\u3001\u66f2\u827a\u3001\u4f20\u7edf\u7f8e\u672f\u3001\u4f20\u7edf\u6280\u827a\u3001\u4f20\u7edf\u533b\u836f\u3001\u6c11\u4fd7\u7b49\u5341\u5927\u7c7b\u522b\u3002\u7136\u800c\u5728\u5feb\u8282\u594f\u7684\u73b0\u4ee3\u751f\u6d3b\u4e2d&#xff0c;\u8fd9\u4e9b\u627f\u8f7d\u7740\u6c11\u65cf\u8bb0\u5fc6\u7684\u6280\u827a&#xff0c;\u6b63\u9762\u4e34\u7740\u4f20\u627f\u4eba\u8001\u9f84\u5316\u3001\u5e74\u8f7b\u4eba\u8ba4\u77e5\u65ad\u5c42\u3001\u4f20\u64ad\u6e20\u9053\u5355\u4e00\u7684\u56f0\u5883\u3002<\/p>\n<p>&#034;\u975e\u9057&#034;\u8fd9\u4e2a\u8bcd&#xff0c;\u5f88\u591a\u4eba\u542c\u8fc7&#xff0c;\u4f46\u8bf4\u4e0d\u51fa\u4e09\u6837\u5177\u4f53\u7684\u9879\u76ee&#xff1b;&#034;\u82cf\u7ee3&#034;\u5f88\u7f8e&#xff0c;\u4f46\u591a\u6570\u4eba\u4e0d\u77e5\u9053\u4e00\u6839\u4e1d\u7ebf\u53ef\u4ee5\u5288\u6210\u516b\u5341\u516b\u5206\u4e4b\u4e00&#xff1b;\u201c\u6881\u795d\u4f20\u8bf4&#034;\u4eba\u4eba\u8033\u719f\u80fd\u8be6&#xff0c;\u5374\u5c11\u6709\u4eba\u4e86\u89e3\u5b83\u5728\u6c11\u95f4\u6587\u5b66\u8c31\u7cfb\u4e2d\u7684\u4f4d\u7f6e\u3002\u4fe1\u606f\u65f6\u4ee3\u7684\u6096\u8bba\u5728\u4e8e&#xff1a;\u77e5\u8bc6\u524d\u6240\u672a\u6709\u7684\u4e30\u88d5&#xff0c;\u6ce8\u610f\u529b\u5374\u524d\u6240\u672a\u6709\u5730\u7a00\u7f3a\u3002\u975e\u9057\u8981&#034;\u6d3b&#034;\u4e0b\u53bb&#xff0c;\u9996\u5148\u8981&#034;\u88ab\u770b\u89c1\u201d\u3002<\/p>\n<p>\u800c AI \u5bf9\u8bdd\u6070\u6070\u63d0\u4f9b\u4e86\u8fd9\u6837\u4e00\u4e2a\u5165\u53e3&#xff1a;\u5b83\u5929\u7136\u662f\u4e00\u4e2a\u6241\u5e73\u7684\u3001\u65e0\u95e8\u69db\u7684\u3001\u4e00\u5bf9\u4e00\u7684\u4ea4\u4e92\u754c\u9762\u3002\u628a AI \u5851\u9020\u6210\u4e00\u4f4d&#034;\u975e\u9057\u5b88\u62a4\u4eba&#034;&#xff0c;\u8ba9\u7528\u6237\u50cf\u548c\u670b\u53cb\u804a\u5929\u4e00\u6837&#xff0c;\u95ee\u4e00\u4e2a\u6545\u4e8b\u3001\u542c\u4e00\u6bb5\u5386\u53f2\u3001\u5b66\u4e00\u95e8\u6280\u827a\u2014\u2014\u8fd9\u6b63\u662f\u672c\u9879\u76ee \u201c\u5bfb\u827a\u201d \u7684\u521d\u5fc3&#xff1a;\u5728\u7801\u9053\u4e4b\u4e0a&#xff0c;\u5bfb\u5343\u5e74\u4e4b\u827a\u3002<\/p>\n<h3>\u4e8c\u3001\u9879\u76ee\u5b9a\u4f4d\u4e0e\u6280\u672f\u9009\u578b<\/h3>\n<h4>2.1 \u5b9a\u4f4d&#xff1a;\u4e00\u4e2a\u7eaf\u7cb9\u7684\u3001\u8f7b\u91cf\u7684\u5355\u9875\u5e94\u7528<\/h4>\n<p>\u5728\u8bbe\u8ba1\u4e4b\u521d&#xff0c;\u6211\u4eec\u660e\u786e\u4e86\u51e0\u4e2a\u539f\u5219&#xff1a;<\/p>\n<ul>\n<li>\u96f6\u95e8\u69db\u4f7f\u7528&#xff1a;\u65e0\u9700\u5b89\u88c5\u3001\u65e0\u9700\u6ce8\u518c\u3001\u6253\u5f00\u5373\u7528&#xff1b;<\/li>\n<li>\u96f6\u6784\u5efa\u6210\u672c&#xff1a;\u4e0d\u4f7f\u7528 React\/Vue \u7b49\u6846\u67b6&#xff0c;\u4e0d\u5f15\u5165\u6253\u5305\u5de5\u5177&#xff0c;\u4fdd\u6301\u9879\u76ee\u6781\u7b80&#xff0c;\u8ba9\u4eba\u4eba\u90fd\u80fd\u8bfb\u61c2\u548c\u7ef4\u62a4&#xff1b;<\/li>\n<li>\u5f00\u7bb1\u5373\u7528\u7684\u667a\u80fd&#xff1a;\u63a5\u5165\u4e91\u7aef\u5927\u6a21\u578b API&#xff0c;\u8ba9&#034;\u975e\u9057\u5b88\u62a4\u4eba&#034;\u5177\u5907\u771f\u6b63\u7684\u77e5\u8bc6\u5e7f\u5ea6\u548c\u5bf9\u8bdd\u6e29\u5ea6&#xff1b;<\/li>\n<li>\u7ed3\u6784\u5316\u5448\u73b0&#xff1a;\u4e0d\u6ee1\u8db3\u4e8e&#034;\u6253\u5b57\u673a\u5f0f&#034;\u7684\u7eaf\u6587\u672c\u56de\u590d&#xff0c;\u800c\u662f\u8ba9 AI \u8fd4\u56de\u7ed3\u6784\u5316\u6570\u636e&#xff0c;\u524d\u7aef\u6e32\u67d3\u51fa\u5361\u7247\u3001\u6309\u94ae\u7b49\u4e30\u5bcc\u7684\u4ea4\u4e92\u5f62\u6001\u3002<\/li>\n<\/ul>\n<p>\u6700\u7ec8\u6280\u672f\u6808\u5b9a\u683c\u4e3a&#xff1a;HTML5 &#043; CSS3 &#043; \u539f\u751f JavaScript&#xff08;ES6&#043;&#xff09;&#043; \u4e91\u7aef AI API\u3002\u8fd9\u4efd\u7b80\u5355\u80cc\u540e&#xff0c;\u662f\u5bf9&#034;\u5c11\u5373\u662f\u591a&#034;\u7684\u575a\u6301\u2014\u2014\u4e00\u4e2a\u5b8c\u6574\u7684\u5bf9\u8bdd\u4ea7\u54c1&#xff0c;\u7528\u4e09\u4efd JS\u3001\u4e00\u4efd CSS \u548c\u4e00\u4efd HTML \u5c31\u80fd\u627f\u8f7d\u3002<\/p>\n<h4>2.2 \u4e3a\u4ec0\u4e48\u662f&#034;\u6d41\u5f0f&#034;\u5bf9\u8bdd<\/h4>\n<p>\u4f20\u7edf\u7684\u4e00\u6b21\u6027\u8bf7\u6c42&#xff08;\u8bf7\u6c42\u53d1\u51fa\u3001\u7b49\u51e0\u79d2\u3001\u6574\u6bb5\u8fd4\u56de&#xff09;\u5b58\u5728\u4e24\u4e2a\u4f53\u9a8c\u95ee\u9898&#xff1a;\u4e00\u662f\u7b49\u5f85\u65f6\u95f4\u611f\u77e5\u8fc7\u957f&#xff0c;\u4e8c\u662f\u65e0\u6cd5\u770b\u5230&#034;\u601d\u8003\u7684\u8fc7\u7a0b&#034;&#xff0c;\u4f1a\u8ba9\u7528\u6237\u6000\u7591\u7cfb\u7edf\u662f\u5426\u5361\u6b7b\u3002\u6d41\u5f0f&#xff08;Streaming&#xff09;\u54cd\u5e94\u5219\u50cf\u4eba\u5728\u8bf4\u8bdd&#xff1a;\u4e00\u4e2a\u5b57\u4e00\u4e2a\u5b57\u5730&#034;\u6253\u5b57&#034;\u51fa\u6765&#xff0c;\u5148\u7ed9\u7528\u6237\u5373\u65f6\u7684\u53cd\u9988&#xff0c;\u518d\u9010\u6b65\u5145\u5b9e\u5185\u5bb9\u3002<\/p>\n<p>\u8fd9\u5728\u5fc3\u7406\u5b66\u4e0a\u53eb&#034;\u611f\u77e5\u6027\u80fd\u4f18\u5316&#034;\u2014\u2014\u7528\u6237\u4f53\u9a8c\u5230\u7684\u54cd\u5e94\u65f6\u95f4&#xff0c;\u53d6\u51b3\u4e8e\u7b2c\u4e00\u5e27\u5185\u5bb9\u7684\u5230\u8fbe\u901f\u5ea6&#xff0c;\u800c\u975e\u5168\u90e8\u5185\u5bb9\u7684\u5b8c\u6210\u65f6\u95f4\u3002\u56e0\u6b64\u672c\u9879\u76ee\u6838\u5fc3\u91c7\u7528\u7684\u6b63\u662f SSE&#xff08;Server-Sent Events&#xff09;\u534f\u8bae\u7684\u6d41\u5f0f\u5bf9\u8bdd&#xff0c;\u8fd9\u4e00\u70b9\u4e5f\u51b3\u5b9a\u4e86\u540e\u7eed JavaScript \u6539\u9020\u65b9\u6848\u7684\u5f62\u6001\u3002<\/p>\n<h3>\u4e09\u3001\u6838\u5fc3\u5b9e\u73b0&#xff1a;\u4ece Python \u53c2\u8003\u4ee3\u7801\u5230 JavaScript<\/h3>\n<h4>3.1 \u53c2\u8003\u5b9e\u73b0&#xff1a;\u4e00\u6b21&#034;\u7ffb\u8bd1&#034;\u4e4b\u65c5<\/h4>\n<p>\u9879\u76ee\u6700\u521d\u63d0\u4f9b\u4e86\u4e00\u4efd Python \u53c2\u8003\u4ee3\u7801&#xff0c;\u7528\u4e8e\u6f14\u793a API \u7684\u6807\u51c6\u8c03\u7528\u65b9\u5f0f\u3002\u5176\u6838\u5fc3\u662f\u4e00\u4e2a\u751f\u6210\u5668&#xff1a;<\/p>\n<p><span class=\"token keyword\">def<\/span> <span class=\"token function\">query<\/span><span class=\"token punctuation\">(<\/span>payload<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    response <span class=\"token operator\">&#061;<\/span> requests<span class=\"token punctuation\">.<\/span>post<span class=\"token punctuation\">(<\/span>API_URL<span class=\"token punctuation\">,<\/span> headers<span class=\"token operator\">&#061;<\/span>headers<span class=\"token punctuation\">,<\/span> json<span class=\"token operator\">&#061;<\/span>payload<span class=\"token punctuation\">,<\/span> stream<span class=\"token operator\">&#061;<\/span><span class=\"token boolean\">True<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token keyword\">for<\/span> line <span class=\"token keyword\">in<\/span> response<span class=\"token punctuation\">.<\/span>iter_lines<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n        <span class=\"token keyword\">if<\/span> <span class=\"token keyword\">not<\/span> line<span class=\"token punctuation\">.<\/span>startswith<span class=\"token punctuation\">(<\/span><span class=\"token string\">b&#034;data:&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n            <span class=\"token keyword\">continue<\/span><br \/>\n        <span class=\"token keyword\">if<\/span> line<span class=\"token punctuation\">.<\/span>strip<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&#061;&#061;<\/span> <span class=\"token string\">b&#034;data:[DONE]&#034;<\/span><span class=\"token punctuation\">:<\/span><br \/>\n            <span class=\"token keyword\">return<\/span><br \/>\n        <span class=\"token keyword\">yield<\/span> json<span class=\"token punctuation\">.<\/span>loads<span class=\"token punctuation\">(<\/span>line<span class=\"token punctuation\">.<\/span>decode<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;utf-8&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span>lstrip<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;data:&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>\u8fd9\u6bb5\u4ee3\u7801\u77ed\u5c0f\u7cbe\u608d&#xff0c;\u5374\u6d53\u7f29\u4e86\u6d41\u5f0f\u5bf9\u8bdd\u7684\u5b8c\u6574\u9aa8\u67b6&#xff1a;\u53d1\u8d77\u6d41\u5f0f POST \u8bf7\u6c42 \u2192 \u9010\u884c\u8bfb\u53d6 \u2192 \u8fc7\u6ee4 data: \u524d\u7f00 \u2192 \u9047\u5230 [DONE] \u7ec8\u6b62 \u2192 \u9010\u6761\u4ea7\u51fa JSON\u3002\u800c\u6211\u4eec\u8981\u505a\u7684&#xff0c;\u662f\u628a\u8fd9\u5957\u903b\u8f91\u5b8c\u6574\u5730\u79fb\u690d\u5230\u6d4f\u89c8\u5668\u73af\u5883\u3002\u6d4f\u89c8\u5668\u6ca1\u6709 requests&#xff0c;\u5374\u6709\u540c\u6837\u5f3a\u5927\u7684 fetch \u4e0e ReadableStream\u3002<\/p>\n<h4>3.2 JavaScript \u6539\u5199&#xff1a;fetch &#043; ReadableStream &#043; TextDecoder<\/h4>\n<p>\u5728\u6d4f\u89c8\u5668\u7aef&#xff0c;fetch \u7684 response.body \u8fd4\u56de\u4e00\u4e2a ReadableStream&#xff0c;\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7 reader.read() \u5faa\u73af\u8bfb\u53d6\u4e8c\u8fdb\u5236\u5757\u3002\u8fd9\u91cc\u6709\u4e00\u4e2a\u5173\u952e\u7ec6\u8282&#xff1a;\u7f51\u7edc\u6570\u636e\u662f\u6309\u5757\u5230\u8fbe\u7684&#xff0c;\u4e00\u4e2a JSON \u5bf9\u8c61\u53ef\u80fd\u88ab\u62c6\u6563\u5728\u591a\u4e2a\u6570\u636e\u5757\u91cc&#xff0c;\u751a\u81f3\u4e00\u4e2a\u6570\u636e\u5757\u91cc\u53ef\u80fd\u5305\u542b\u591a\u884c SSE \u6570\u636e\u3002\u56e0\u6b64\u5fc5\u987b\u5f15\u5165\u4e00\u4e2a&#034;\u7f13\u51b2\u533a&#034;&#xff08;buffer&#xff09;\u7b56\u7565&#xff1a;<\/p>\n<p><span class=\"token keyword\">const<\/span> reader <span class=\"token operator\">&#061;<\/span> response<span class=\"token punctuation\">.<\/span>body<span class=\"token punctuation\">.<\/span><span class=\"token function\">getReader<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">const<\/span> decoder <span class=\"token operator\">&#061;<\/span> <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">TextDecoder<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;utf-8&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">let<\/span> buffer <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#034;&#034;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">while<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token boolean\">true<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token keyword\">const<\/span> <span class=\"token punctuation\">{<\/span> done<span class=\"token punctuation\">,<\/span> value <span class=\"token punctuation\">}<\/span> <span class=\"token operator\">&#061;<\/span> <span class=\"token keyword\">await<\/span> reader<span class=\"token punctuation\">.<\/span><span class=\"token function\">read<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>done<span class=\"token punctuation\">)<\/span> <span class=\"token keyword\">break<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  buffer <span class=\"token operator\">&#043;&#061;<\/span> decoder<span class=\"token punctuation\">.<\/span><span class=\"token function\">decode<\/span><span class=\"token punctuation\">(<\/span>value<span class=\"token punctuation\">,<\/span> <span class=\"token punctuation\">{<\/span> <span class=\"token literal-property property\">stream<\/span><span class=\"token operator\">:<\/span> <span class=\"token boolean\">true<\/span> <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  <span class=\"token keyword\">const<\/span> lines <span class=\"token operator\">&#061;<\/span> buffer<span class=\"token punctuation\">.<\/span><span class=\"token function\">split<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\\\\n&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  buffer <span class=\"token operator\">&#061;<\/span> lines<span class=\"token punctuation\">.<\/span><span class=\"token function\">pop<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>               <span class=\"token comment\">\/\/ \u672b\u6bb5\u53ef\u80fd\u662f\u4e0d\u5b8c\u6574\u884c&#xff0c;\u7559\u5230\u4e0b\u4e00\u8f6e\u62fc\u63a5<\/span><br \/>\n  <span class=\"token keyword\">for<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token keyword\">const<\/span> line <span class=\"token keyword\">of<\/span> lines<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">!<\/span>line<span class=\"token punctuation\">.<\/span><span class=\"token function\">trim<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">startsWith<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;data:&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token keyword\">continue<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">const<\/span> data <span class=\"token operator\">&#061;<\/span> line<span class=\"token punctuation\">.<\/span><span class=\"token function\">trim<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">slice<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">5<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">trim<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>data <span class=\"token operator\">&#061;&#061;&#061;<\/span> <span class=\"token string\">&#034;[DONE]&#034;<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span> <span class=\"token comment\">\/* \u7ed3\u675f *\/<\/span> <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token keyword\">const<\/span> chunk <span class=\"token operator\">&#061;<\/span> <span class=\"token constant\">JSON<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">parse<\/span><span class=\"token punctuation\">(<\/span>data<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">const<\/span> delta <span class=\"token operator\">&#061;<\/span> chunk<span class=\"token punctuation\">.<\/span>choices<span class=\"token operator\">?.<\/span><span class=\"token punctuation\">[<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">]<\/span><span class=\"token operator\">?.<\/span>delta<span class=\"token operator\">?.<\/span>content <span class=\"token operator\">??<\/span> <span class=\"token string\">&#034;&#034;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>delta<span class=\"token punctuation\">)<\/span> <span class=\"token function\">onDelta<\/span><span class=\"token punctuation\">(<\/span>delta<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u8fd9\u91cc\u6709\u4e09\u5904\u5bb9\u6613\u88ab\u5ffd\u89c6\u7684\u7ec6\u8282&#xff1a;<\/p>\n<li>decoder.decode(value, { stream: true })&#xff1a;\u8fd9\u4e2a stream: true \u53c2\u6570\u81f3\u5173\u91cd\u8981\u3002\u5b83\u544a\u8bc9\u89e3\u7801\u5668&#034;\u6570\u636e\u8fd8\u6ca1\u7ed3\u675f&#xff0c;\u8bf7\u5904\u7406\u53ef\u80fd\u88ab\u622a\u65ad\u7684\u591a\u5b57\u8282\u5b57\u7b26&#xff08;\u5982\u4e2d\u6587\u7684 UTF-8 \u7f16\u7801&#xff09;&#034;&#xff0c;\u907f\u514d\u51fa\u73b0\u4e71\u7801\u3002<\/li>\n<li>\u672b\u884c\u56de\u586b&#xff1a;buffer &#061; lines.pop() \u628a\u6700\u540e\u4e00\u6bb5&#034;\u4e0d\u5b8c\u6574\u7684\u884c&#034;\u4fdd\u7559\u4e0b\u6765&#xff0c;\u4e0e\u4e0b\u4e00\u6279\u6570\u636e\u62fc\u63a5\u3002\u8fd9\u662f\u6d41\u5f0f\u89e3\u6790\u534a\u5305\u6570\u636e\u7684\u6807\u51c6\u505a\u6cd5\u3002<\/li>\n<li>\u589e\u91cf\u53d6\u6570&#xff1a;\u6bcf\u4e2a chunk \u7684 choices[0].delta.content \u662f\u589e\u91cf\u6587\u672c&#xff08;\u800c\u975e\u5168\u91cf&#xff09;&#xff0c;\u5fc5\u987b\u7d2f\u79ef\u62fc\u63a5\u624d\u80fd\u5f97\u5230\u5b8c\u6574\u56de\u590d\u3002<\/li>\n<p>\u8fd9\u4e00\u6b65&#034;\u7ffb\u8bd1&#034;&#xff0c;\u5b8c\u6210\u4e86\u4ece requests \u751f\u6001\u5230 Web \u5e73\u53f0\u7684\u5e73\u6ed1\u8fc1\u79fb\u3002<\/p>\n<h4>3.3 \u601d\u8003\u9884\u7b97&#xff1a;thinking_budget \u4e0e\u63a8\u7406\u5185\u5bb9<\/h4>\n<p>\u53c2\u8003\u4ee3\u7801\u7684 payload \u91cc\u8fd8\u5305\u542b\u4e00\u4e2a\u7279\u522b\u7684\u53c2\u6570&#xff1a;thinking_budget: 2048\u3002\u8fd9\u7c7b\u53c2\u6570\u6307\u793a\u6a21\u578b\u5728\u56de\u7b54\u524d\u5148\u8fdb\u884c\u4e00\u6bb5&#034;\u5185\u90e8\u601d\u8003&#034;&#xff08;reasoning&#xff09;\u3002\u5728\u8fd4\u56de\u7684\u6d41\u4e2d&#xff0c;\u601d\u8003\u8fc7\u7a0b\u4f1a\u51fa\u73b0\u5728 delta.reasoning_content \u5b57\u6bb5&#xff0c;\u800c\u6b63\u5f0f\u56de\u7b54\u51fa\u73b0\u5728 delta.content\u3002<\/p>\n<p>\u6211\u4eec\u5728\u524d\u7aef\u5bf9\u4e8c\u8005\u505a\u4e86\u5dee\u5f02\u5316\u5904\u7406&#xff1a;\u601d\u8003\u5230\u8fbe\u65f6&#xff0c;\u6c14\u6ce1\u663e\u793a&#034;\u5bfb\u827a\u6b63\u5728\u67e5\u9605\u53e4\u7c4d&#xff0c;\u68b3\u7406\u8109\u7edc\u2026\u2026\u201c\u7684\u5360\u4f4d\u72b6\u6001&#xff0c;\u8425\u9020&#034;\u5b88\u62a4\u4eba\u6b63\u5728\u6c89\u541f&#034;\u7684\u4eea\u5f0f\u611f&#xff1b;\u4e00\u65e6\u6b63\u5f0f\u5185\u5bb9\u5f00\u59cb\u8f93\u51fa&#xff0c;\u7acb\u5373\u5207\u6362\u5230\u6d41\u5f0f\u6253\u5b57\u6548\u679c\u3002\u8fd9\u6837\u65e2\u4fdd\u7559\u4e86\u6a21\u578b\u7684\u601d\u8003\u8d28\u91cf&#xff0c;\u53c8\u4e0d\u4f1a\u8ba9\u7528\u6237\u9762\u5bf9\u4e00\u5927\u6bb5\u65e0\u7528\u7684&#034;\u5185\u5fc3\u72ec\u767d\u201d\u3002<\/p>\n<h3>\u56db\u3001\u7cfb\u7edf\u63d0\u793a\u8bcd&#xff1a;\u8ba9 AI \u8f93\u51fa\u7a0b\u5e8f\u8ba4\u8bc6\u7684 JSON<\/h3>\n<h4>4.1 \u4e3a\u4ec0\u4e48\u8981\u6c42\u7ed3\u6784\u5316\u8f93\u51fa<\/h4>\n<p>\u5982\u679c\u653e\u4efb\u5927\u6a21\u578b\u81ea\u7531\u53d1\u6325&#xff0c;\u56de\u590d\u53ef\u80fd\u662f\u4efb\u610f\u5f62\u6001\u7684\u6587\u672c&#xff1a;\u53ef\u80fd\u662f\u6563\u6587\u3001\u53ef\u80fd\u662f\u5217\u8868\u3001\u53ef\u80fd\u5e26 Markdown&#xff0c;\u4e5f\u53ef\u80fd\u4ec0\u4e48\u683c\u5f0f\u90fd\u6ca1\u6709\u3002\u524d\u7aef\u60f3\u5728\u6b64\u57fa\u7840\u4e0a\u6e32\u67d3&#034;\u8ffd\u95ee\u6309\u94ae&#034;\u6216&#034;\u975e\u9057\u5361\u7247&#034;&#xff0c;\u5c31\u53ea\u80fd\u9760\u6b63\u5219\u53bb\u731c&#xff0c;\u6781\u6613\u51fa\u9519\u3002<\/p>\n<p>\u66f4\u597d\u7684\u505a\u6cd5\u662f\u7528\u7cfb\u7edf\u63d0\u793a\u8bcd\u7ea6\u5b9a\u8f93\u51fa\u534f\u8bae&#xff1a;\u544a\u8bc9 AI&#034;\u4f60\u5fc5\u987b\u53ea\u8f93\u51fa\u4e00\u4e2a\u5408\u6cd5 JSON \u5bf9\u8c61&#034;&#xff0c;\u5e76\u7ed9\u51fa\u660e\u786e\u7684\u5b57\u6bb5\u5b9a\u4e49\u3002\u8fd9\u6837 AI \u7684&#034;\u8bf4\u8bdd&#034;\u5c31\u548c\u7a0b\u5e8f\u7684&#034;\u7406\u89e3&#034;\u5bf9\u9f50\u4e86\u2014\u2014\u8fd9\u6b63\u662f\u5f53\u524d\u5927\u6a21\u578b\u5e94\u7528\u5de5\u7a0b\u4e2d\u7684\u6838\u5fc3\u65b9\u6cd5\u8bba&#xff1a;\u7528\u81ea\u7136\u8bed\u8a00\u5b9a\u4e49\u63a5\u53e3\u5951\u7ea6&#xff08;LLM-native API design&#xff09;\u3002<\/p>\n<h4>4.2 \u6211\u4eec\u7684 JSON \u5951\u7ea6<\/h4>\n<p>\u6211\u4eec\u6700\u7ec8\u5b9a\u4e49\u7684\u54cd\u5e94\u534f\u8bae\u5305\u542b\u4e09\u4e2a\u5b57\u6bb5&#xff1a;<\/p>\n<p><span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token string-property property\">&#034;reply&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;\u56de\u590d\u6b63\u6587&#xff0c;\u53ef\u542b Markdown&#xff0c;\u7ea6 90~260 \u5b57&#xff0c;\u4fe1\u606f\u5bc6\u5ea6\u9ad8&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  <span class=\"token string-property property\">&#034;suggestions&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;\u8ffd\u95ee\u793a\u4f8b1&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;\u8ffd\u95ee\u793a\u4f8b2&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;\u8ffd\u95ee\u793a\u4f8b3&#034;<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  <span class=\"token string-property property\">&#034;related&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">{<\/span><span class=\"token string-property property\">&#034;name&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;\u82cf\u7ee3&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string-property property\">&#034;type&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;\u4f20\u7edf\u7f8e\u672f&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string-property property\">&#034;region&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;\u6c5f\u82cf\u82cf\u5dde&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string-property property\">&#034;desc&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;\u4e00\u53e5\u8bdd\u7b80\u4ecb&#034;<\/span><span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">]<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<ul>\n<li>reply&#xff1a;\u771f\u6b63\u7684\u5bf9\u8bdd\u6b63\u6587&#xff0c;\u5141\u8bb8\u9002\u5ea6\u4f7f\u7528 Markdown&#xff08;\u52a0\u7c97\u3001\u5217\u8868\u3001\u5f15\u7528&#xff09;&#xff0c;\u524d\u7aef\u6e32\u67d3\u4e3a\u5bcc\u6587\u672c&#xff1b;<\/li>\n<li>suggestions&#xff1a;\u6070\u597d\u4e09\u6761\u63a8\u8350\u8ffd\u95ee\u3002\u5b83\u627f\u62c5&#034;\u5bf9\u8bdd\u5f15\u5bfc&#034;\u7684\u804c\u8d23\u2014\u2014AI \u4e0d\u4ec5\u8981\u56de\u7b54\u95ee\u9898&#xff0c;\u8fd8\u8981\u628a\u5bf9\u8bdd\u5f15\u5411\u6df1\u5165\u3002\u70b9\u51fb\u8ffd\u95ee\u5373\u53ef\u7ee7\u7eed\u5bf9\u8bdd&#xff0c;\u5f62\u6210\u5bf9\u8bdd\u95ed\u73af&#xff1b;<\/li>\n<li>related&#xff1a;\u6d89\u53ca\u5177\u4f53\u975e\u9057\u9879\u76ee\u65f6\u8f93\u51fa\u7684&#034;\u77e5\u8bc6\u5361\u7247&#034;\u3002\u5305\u542b\u9879\u76ee\u540d\u79f0\u3001\u6240\u5c5e\u95e8\u7c7b\u3001\u5730\u533a\u4e0e\u7b80\u4ecb&#xff0c;\u524d\u7aef\u6e32\u67d3\u4e3a\u5361\u7247\u5899&#xff0c;\u628a\u96f6\u6563\u7684\u56de\u590d\u6c89\u6dc0\u4e3a\u53ef\u6d4f\u89c8\u7684\u77e5\u8bc6\u5355\u5143\u3002<\/li>\n<\/ul>\n<h4>4.3 \u89d2\u8272\u8bbe\u5b9a\u7684\u5199\u4f5c\u6280\u5de7<\/h4>\n<p>\u7cfb\u7edf\u63d0\u793a\u8bcd\u7684\u89d2\u8272\u5851\u9020&#xff0c;\u6211\u4eec\u523b\u610f\u878d\u5165\u4e86&#034;\u4eba\u5473&#034;&#xff1a;\u4e0d\u8981\u5b98\u65b9\u8f9e\u4ee4\u5f0f\u7684&#034;\u672c\u52a9\u624b\u4e3a\u60a8\u89e3\u7b54&#034;&#xff0c;\u800c\u662f&#034;\u4f60\u77e5\u8bc6\u6e0a\u535a\u800c\u6e29\u548c&#xff0c;\u8bf4\u8bdd\u5982\u4e00\u4f4d\u8bb2\u4e66\u4eba&#xff0c;\u4eb2\u5207\u3001\u6709\u753b\u9762\u611f\u3001\u6709\u6e29\u5ea6&#034;&#xff1b;\u8981\u6c42&#034;\u5584\u4e8e\u7528\u8272\u5f69\u3001\u58f0\u97f3\u3001\u89e6\u611f\u6784\u5efa\u753b\u9762&#034;&#xff1b;\u751a\u81f3\u89c4\u5b9a\u4e86&#034;\u6bcf\u6b21\u56de\u590d\u5c3d\u91cf\u4f20\u8fbe\u4e00\u70b9\u65b0\u77e5\u8bc6\u6216\u65b0\u89c6\u89d2&#034;\u3002\u540c\u65f6\u6211\u4eec\u4e5f\u5212\u4e86\u7ea2\u7ebf&#xff1a;\u201c\u4e0d\u7f16\u9020\u975e\u9057\u9879\u76ee\u548c\u4f20\u627f\u4eba\u4fe1\u606f&#xff1b;\u4e0d\u786e\u5b9a\u65f6\u5766\u8bda\u8bf4\u660e&#xff0c;\u5e76\u7ed9\u51fa\u67e5\u9605\u65b9\u5411\u201d\u3002<\/p>\n<p>\u5b9e\u6d4b\u6548\u679c\u4ee4\u4eba\u60ca\u559c&#xff1a;\u6a21\u578b\u56de\u7b54&#034;\u82cf\u7ee3\u7684\u8d77\u6e90&#034;\u65f6&#xff0c;\u4f1a\u8bb2\u8ff0\u6d63\u7eb1\u5973\u897f\u65bd&#034;\u4ee5\u8840\u67d3\u7ebf\u7ee3\u8299\u84c9&#034;\u7684\u4f20\u8bf4&#xff1b;\u56de\u7b54&#034;\u6881\u795d&#034;\u65f6&#xff0c;\u4f1a\u805a\u7126&#034;\u5341\u516b\u76f8\u9001&#034;\u8fd9\u4e2a\u88ab\u5e38\u88ab\u7565\u8fc7\u7684\u52a8\u4eba\u7247\u6bb5\u3002\u597d\u7684\u89d2\u8272\u8bbe\u5b9a&#xff0c;\u662f\u628a\u6a21\u578b\u7684&#034;\u77e5\u8bc6\u91cf&#034;\u8f6c\u5316\u4e3a&#034;\u611f\u67d3\u529b&#034;\u7684\u5173\u952e\u3002<\/p>\n<h3>\u4e94\u3001\u524d\u7aef\u589e\u91cf\u89e3\u6790&#xff1a;\u65e0\u635f\u5730\u4ece\u6d41\u4e2d&#034;\u635e\u51fa&#034; JSON<\/h3>\n<h4>5.1 \u96be\u70b9&#xff1a;\u6d41\u5f0f\u4e0e JSON \u7684\u5929\u7136\u51b2\u7a81<\/h4>\n<p>\u6d41\u5f0f\u54cd\u5e94\u662f&#034;\u8fb9\u751f\u6210\u8fb9\u4f20\u8f93&#034;\u7684&#xff0c;\u56e0\u6b64\u4efb\u610f\u65f6\u523b\u6211\u4eec\u624b\u91cc\u7684\u6587\u672c\u90fd\u662f\u4e0d\u5b8c\u6574\u7684 JSON \u7247\u6bb5\u3002\u5982\u679c\u7b49\u5168\u90e8\u4f20\u8f93\u5b8c\u6bd5\u518d\u89e3\u6790&#xff0c;\u5c31\u4e27\u5931\u4e86\u6d41\u5f0f\u5373\u65f6\u6e32\u67d3\u7684\u610f\u4e49&#xff1b;\u5982\u679c\u6025\u4e8e\u89e3\u6790&#xff0c;\u53c8\u4f1a\u88ab&#034;\u534a\u4e2a\u5bf9\u8c61&#034;\u5361\u4f4f\u3002\u6211\u4eec\u7684\u76ee\u6807\u662f&#xff1a;\u4e00\u65e6 JSON \u5728\u5927\u62ec\u53f7\u5c42\u9762\u95ed\u5408\u3001\u53ef\u4ee5\u88ab\u5b8c\u6574\u89e3\u6790&#xff0c;\u5c31\u7acb\u5373\u6e32\u67d3&#xff0c;\u4e00\u79d2\u4e5f\u4e0d\u7528\u7b49\u3002<\/p>\n<h4>5.2 \u65b9\u6848&#xff1a;\u5b57\u7b26\u4e32\u611f\u77e5\u7684\u5927\u62ec\u53f7\u914d\u5bf9\u626b\u63cf<\/h4>\n<p>\u6700\u521d\u7684\u5199\u6cd5\u662f text.lastIndexOf(&#034;{&#034;) \u62ff\u6700\u540e\u4e00\u4e2a\u5de6\u82b1\u62ec\u53f7\u4f5c\u4e3a\u8d77\u70b9\u53bb\u89e3\u6790\u2014\u2014\u4f46\u8fd9\u5728\u5e26\u7f29\u8fdb\u683c\u5f0f\u7684\u591a\u5c42 JSON \u524d\u4f1a\u5931\u6548&#xff1a;related \u6570\u7ec4\u91cc\u5d4c\u5957\u5bf9\u8c61\u81ea\u8eab\u7684 { \u624d\u662f\u6700\u540e\u4e00\u4e2a\u82b1\u62ec\u53f7&#xff0c;\u4ece\u5b83\u5f00\u59cb\u7684\u5b50\u4e32\u6839\u672c\u4e0d\u662f\u5408\u6cd5 JSON&#xff08;\u89c1\u4e0b\u56fe\u793a\u610f&#xff09;\u3002<\/p>\n<p>{<br \/>\n  &#034;reply&#034;: &#034;&#8230;&#034;,<br \/>\n  &#034;suggestions&#034;: [&#8230;],<br \/>\n  &#034;related&#034;: [ { &#034;name&#034;: &#8230;, &#8230; } ]   \u2190 \u6700\u540e\u4e00\u4e2a { \u5728\u8fd9\u91cc&#xff0c;\u4ece\u5b83\u5207\u7247\u5fc5\u5931\u8d25<br \/>\n}<\/p>\n<p>\u6b63\u786e\u7684\u89e3\u6cd5\u662f\u4ece\u5934\u626b\u63cf\u3001\u72b6\u6001\u673a\u5f0f\u5730\u7edf\u8ba1\u82b1\u62ec\u53f7\u914d\u5bf9&#xff0c;\u540c\u65f6\u8df3\u8fc7\u5b57\u7b26\u4e32\u5b57\u9762\u91cf\u5185\u7684\u82b1\u62ec\u53f7&#xff1a;<\/p>\n<p><span class=\"token keyword\">function<\/span> <span class=\"token function\">extractJsonObj<\/span><span class=\"token punctuation\">(<\/span><span class=\"token parameter\">text<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token keyword\">const<\/span> start <span class=\"token operator\">&#061;<\/span> text<span class=\"token punctuation\">.<\/span><span class=\"token function\">indexOf<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;{&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>start <span class=\"token operator\">&lt;<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token keyword\">return<\/span> <span class=\"token keyword\">null<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  <span class=\"token keyword\">let<\/span> depth <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">,<\/span> inStr <span class=\"token operator\">&#061;<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">,<\/span> escaped <span class=\"token operator\">&#061;<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  <span class=\"token keyword\">for<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token keyword\">let<\/span> i <span class=\"token operator\">&#061;<\/span> start<span class=\"token punctuation\">;<\/span> i <span class=\"token operator\">&lt;<\/span> text<span class=\"token punctuation\">.<\/span>length<span class=\"token punctuation\">;<\/span> i<span class=\"token operator\">&#043;&#043;<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">const<\/span> ch <span class=\"token operator\">&#061;<\/span> text<span class=\"token punctuation\">[<\/span>i<span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>inStr<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n      <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>escaped<span class=\"token punctuation\">)<\/span> escaped <span class=\"token operator\">&#061;<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span><br \/>\n      <span class=\"token keyword\">else<\/span> <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>ch <span class=\"token operator\">&#061;&#061;&#061;<\/span> <span class=\"token string\">&#034;\\\\\\\\&#034;<\/span><span class=\"token punctuation\">)<\/span> escaped <span class=\"token operator\">&#061;<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span><br \/>\n      <span class=\"token keyword\">else<\/span> <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>ch <span class=\"token operator\">&#061;&#061;&#061;<\/span> <span class=\"token string\">&#039;&#034;&#039;<\/span><span class=\"token punctuation\">)<\/span> inStr <span class=\"token operator\">&#061;<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span><br \/>\n      <span class=\"token keyword\">continue<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>ch <span class=\"token operator\">&#061;&#061;&#061;<\/span> <span class=\"token string\">&#039;&#034;&#039;<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span> inStr <span class=\"token operator\">&#061;<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token keyword\">continue<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>ch <span class=\"token operator\">&#061;&#061;&#061;<\/span> <span class=\"token string\">&#034;{&#034;<\/span><span class=\"token punctuation\">)<\/span> depth<span class=\"token operator\">&#043;&#043;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">else<\/span> <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>ch <span class=\"token operator\">&#061;&#061;&#061;<\/span> <span class=\"token string\">&#034;}&#034;<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n      depth<span class=\"token operator\">&#8212;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n      <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>depth <span class=\"token operator\">&#061;&#061;&#061;<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token keyword\">return<\/span> <span class=\"token constant\">JSON<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">parse<\/span><span class=\"token punctuation\">(<\/span>text<span class=\"token punctuation\">.<\/span><span class=\"token function\">slice<\/span><span class=\"token punctuation\">(<\/span>start<span class=\"token punctuation\">,<\/span> i <span class=\"token operator\">&#043;<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span><br \/>\n  <span class=\"token keyword\">return<\/span> <span class=\"token keyword\">null<\/span><span class=\"token punctuation\">;<\/span>  <span class=\"token comment\">\/\/ \u5c1a\u672a\u95ed\u5408<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u8fd9\u4e2a\u51fd\u6570\u6709\u4e09\u5c42\u4fdd\u9669&#xff1a;\u5b57\u7b26\u4e32\u5185\u7684\u5927\u62ec\u53f7\u4e0d\u8ba1\u5165\u914d\u5bf9&#xff08;\u9632\u6b62\u56de\u590d\u6b63\u6587\u91cc\u7684 {} \u5e72\u6270&#xff09;&#xff1b;\u95ed\u5408\u5230\u9876\u5c42\u5373\u5c1d\u8bd5\u89e3\u6790&#xff08;\u4fdd\u8bc1\u6548\u7387&#xff09;&#xff1b;\u89e3\u6790\u5931\u8d25\u8fd4\u56de null \u800c\u975e\u629b\u9519&#xff08;\u4fdd\u8bc1\u6d41\u5f0f\u8fc7\u7a0b\u96f6\u4e2d\u65ad&#xff09;\u3002\u5b83\u540c\u65f6\u88ab\u7528\u4e8e\u6d41\u5f0f\u8fc7\u7a0b\u4e2d\u7684&#034;\u589e\u91cf\u5c1d\u8bd5&#034;\u548c\u6d41\u7ed3\u675f\u540e\u7684&#034;\u6700\u7ec8\u515c\u5e95&#034;&#xff0c;\u4e00\u5904\u5b9e\u73b0\u3001\u4e24\u5904\u590d\u7528\u3002<\/p>\n<h4>5.3 \u6e32\u67d3\u4f18\u5148\u7ea7\u7684\u8bbe\u8ba1<\/h4>\n<p>\u5728\u6d41\u5f0f\u8fc7\u7a0b\u4e2d\u6211\u4eec\u9075\u5faa\u8fd9\u6837\u7684\u6e32\u67d3\u7b56\u7565&#xff1a;<\/p>\n<li>\u6536\u5230\u9996\u6bb5\u589e\u91cf \u2192 \u6e05\u9664&#034;\u601d\u8003\u5360\u4f4d&#034;&#xff0c;\u5f00\u59cb\u5c55\u793a\u6b63\u5728\u751f\u6210\u7684\u6587\u672c&#xff08;\u622a\u65ad\u9884\u89c8&#xff09;&#xff1b;<\/li>\n<li>\u6bcf\u6b21\u589e\u91cf\u5230\u8fbe \u2192 \u7528\u914d\u5bf9\u626b\u63cf\u5c1d\u8bd5\u89e3\u6790&#xff1b;\u4e00\u65e6\u547d\u4e2d\u5b8c\u6574 JSON \u2192 \u7acb\u5373\u6e32\u67d3\u6700\u7ec8\u5f62\u6001&#xff1a;\u5bcc\u6587\u672c &#043; \u8ffd\u95ee\u6309\u94ae &#043; \u975e\u9057\u5361\u7247&#xff1b;<\/li>\n<li>\u6e32\u67d3\u5b8c\u6210\u540e\u6807\u8bb0 rendered&#xff0c;\u540e\u7eed\u589e\u91cf\u4e0d\u518d\u91cd\u590d\u6e32\u67d3&#xff08;\u56e0\u4e3a\u5b8c\u6574\u5bf9\u8c61\u95ed\u5408\u540e&#xff0c;\u5269\u4f59\u5185\u5bb9\u57fa\u672c\u4e0d\u4f1a\u518d\u6709&#xff09;\u2014\u2014\u907f\u514d\u6296\u52a8\u548c\u4e00\u5e27\u591a\u753b\u3002<\/li>\n<p>\u8fd9\u5957\u7b56\u7565\u5728\u4fdd\u6301&#034;\u5373\u65f6\u611f&#034;\u7684\u540c\u65f6&#xff0c;\u628a\u6700\u7ec8\u5448\u73b0\u5207\u6362\u5f97\u5e72\u51c0\u5229\u843d\u3002\u5b9e\u6d4b\u4e2d&#xff0c;\u6a21\u578b\u7ea6\u5728\u6570\u79d2\u5185\u5b8c\u6210\u6574\u6bb5\u8f93\u51fa&#xff0c;\u7528\u6237\u51e0\u4e4e\u65e0\u611f\u77e5\u5730\u770b\u5230&#034;\u6253\u5b57 \u2192 \u5361\u7247\u6d6e\u73b0&#034;\u7684\u6d41\u7545\u8fc7\u6e21\u3002<\/p>\n<h3>\u516d\u3001\u5bcc\u6587\u672c\u6e32\u67d3\u4e0e XSS \u9632\u62a4<\/h3>\n<h4>6.1 \u81ea\u7814\u8f7b\u91cf Markdown \u6e32\u67d3\u5668<\/h4>\n<p>\u4e3a\u4fdd\u6301\u96f6\u4f9d\u8d56&#xff0c;\u6211\u4eec\u6ca1\u6709\u5f15\u5165 marked \/ markdown-it \u7b49\u5e93&#xff0c;\u800c\u662f\u624b\u5199\u4e86\u4e00\u4e2a\u7ea6\u56db\u5341\u884c\u7684\u8f7b\u91cf\u6e32\u67d3\u5668&#xff0c;\u8986\u76d6\u5bf9\u8bdd\u573a\u666f\u6700\u5e38\u7528\u7684\u8bed\u6cd5&#xff1a;\u884c\u5185\u4ee3\u7801\u3001\u52a0\u7c97\u3001&gt; \u5f15\u7528\u3001####\/### \u6807\u9898\u3001- \u65e0\u5e8f\u5217\u8868\u3001\u6bb5\u843d\u5206\u9694\u3002\u6e32\u67d3\u987a\u5e8f\u7ecf\u8fc7\u7cbe\u5fc3\u8bbe\u8ba1&#xff1a;\u5148\u505a HTML \u8f6c\u4e49&#xff0c;\u518d\u505a\u6a21\u5f0f\u66ff\u6362&#xff0c;\u5e76\u4e14\u6ce8\u610f&#034;\u5217\u8868\u9879\u5148\u5206\u7ec4\u4e3a ul\u3001\u518d\u7ec4\u6bb5\u843d&#034;\u7684\u987a\u5e8f&#xff0c;\u907f\u514d\u5d4c\u5957\u9519\u4e71\u3002<\/p>\n<h4>6.2 \u5b89\u5168\u662f\u786c\u5e95\u7ebf<\/h4>\n<p>AI \u751f\u6210\u7684\u5185\u5bb9\u662f\u4e0d\u53ef\u4fe1\u7684\u7b2c\u4e09\u65b9\u8f93\u5165\u3002\u5982\u679c\u76f4\u63a5\u628a\u6a21\u578b\u7684\u8f93\u51fa\u62fc\u8fdb innerHTML&#xff0c;\u4e00\u65e6\u6a21\u578b\u88ab\u8bf1\u5bfc\u8f93\u51fa &lt;script&gt; \u6216 &lt;img onerror&gt; \u4e4b\u7c7b\u7684\u8f7d\u8377&#xff0c;\u5c31\u4f1a\u9020\u6210\u5b58\u50a8\u578b XSS\u3002\u56e0\u6b64\u6211\u4eec\u575a\u6301&#xff1a;<\/p>\n<li>\u6240\u6709\u6e32\u67d3\u8def\u5f84\u5148\u7ecf\u8fc7 escapeHtml()&#xff0c;\u628a &lt; &gt; &amp; &#034; \u8f6c\u4e49\u4e3a\u5b9e\u4f53&#xff1b;<\/li>\n<li>\u518d\u5728\u8f6c\u4e49\u540e\u7684\u6587\u672c\u4e0a\u5e94\u7528 Markdown \u66ff\u6362\u89c4\u5219&#xff08;\u6b64\u65f6\u66ff\u6362\u4ea7\u7269\u662f\u53d7\u63a7\u7684\u6807\u7b7e&#xff0c;\u6ce8\u5165\u7684\u539f\u59cb\u6807\u7b7e\u65e9\u5df2\u5931\u6548&#xff09;&#xff1b;<\/li>\n<li>\u8ffd\u95ee\u6309\u94ae\u3001\u5361\u7247\u6587\u672c\u4e00\u5f8b\u901a\u8fc7 textContent \u5199\u5165&#xff0c;\u7edd\u4e0d\u76f4\u63a5\u63d2\u5165 HTML\u3002<\/li>\n<p>\u201c\u5148\u8f6c\u4e49\u3001\u540e\u5bcc\u5316\u201d \u662f\u5b89\u5168\u5bcc\u6587\u672c\u6e32\u67d3\u7684\u9ec4\u91d1\u6b21\u5e8f&#xff0c;\u4efb\u4f55\u76f4\u63a5\u5bf9\u6a21\u578b\u8f93\u51fa\u505a .replace \u6ce8\u5165\u6807\u7b7e\u518d\u8d4b\u7ed9 innerHTML \u7684\u505a\u6cd5\u90fd\u5e94\u89c6\u4e3a\u9ad8\u5371\u3002<\/p>\n<h3>\u4e03\u3001\u4f53\u9a8c\u7ec6\u8282&#xff1a;\u90a3\u4e9b\u8ba9\u4ea7\u54c1&#034;\u6709\u6e29\u5ea6&#034;\u7684\u5c0f\u4e8b<\/h3>\n<p>\u4e00\u4e2a\u4ea7\u54c1\u7684\u8d28\u611f&#xff0c;\u5f80\u5f80\u85cf\u5728\u4e0d\u88ab\u6ce8\u610f\u7684\u7ec6\u8282\u91cc\u3002\u6211\u4eec\u5728\u8fd9\u4e00\u7248\u91cc\u6253\u78e8\u4e86\u8fd9\u4e9b\u70b9&#xff1a;<\/p>\n<ul>\n<li>Enter \u53d1\u9001\u3001Shift&#043;Enter \u6362\u884c&#xff1a;\u9075\u5faa\u5373\u65f6\u901a\u8baf\u8f6f\u4ef6\u7684\u5fc3\u667a\u6a21\u578b&#xff0c;\u957f\u6587\u672c\u9700\u6c42\u4ea4\u7ed9\u6362\u884c\u952e&#xff1b;<\/li>\n<li>Textarea \u81ea\u9002\u5e94\u9ad8\u5ea6&#xff1a;\u8f93\u5165\u6846\u968f\u5185\u5bb9\u589e\u957f&#xff0c;\u6700\u9ad8 140px&#xff0c;\u8d85\u8fc7\u540e\u5185\u90e8\u6eda\u52a8&#xff0c;\u907f\u514d\u906e\u6321\u5bf9\u8bdd\u533a&#xff1b;<\/li>\n<li>\u5feb\u6377\u8ffd\u95ee\u6761&#xff1a;\u6700\u8fd1\u4e00\u6b21\u7684\u7ed3\u6784\u5316\u56de\u590d\u4e2d\u7684\u8ffd\u95ee&#xff0c;\u4f1a\u5e38\u9a7b\u8f93\u5165\u6846\u4e0a\u65b9&#xff0c;\u5f62\u6210&#034;\u7535\u68af\u6309\u94ae&#034;\u5f0f\u7684\u5f15\u5bfc&#xff0c;\u7528\u6237\u53ef\u4ee5\u8fde\u7eed\u8ffd\u95ee\u800c\u65e0\u9700\u6253\u5b57&#xff1b;<\/li>\n<li>\u4e24\u4e2a\u53d1\u9645\u7ebf&#xff1a;AI \u4fa7\u7528\u9edb\u84dd\u5370\u7ae0&#034;\u5bfb&#034;&#xff0c;\u7528\u6237\u4fa7\u7528\u6731\u7802\u5370\u7ae0&#034;\u827a&#034;&#xff0c;\u4e00\u51b7\u4e00\u6696&#xff0c;\u547c\u5e94&#034;\u5b88\u62a4\u4eba&#034;\u4e0e&#034;\u63a2\u827a\u4eba&#034;\u7684\u8eab\u4efd\u5bf9\u5e94&#xff1b;<\/li>\n<li>\u672c\u5730\u4f1a\u8bdd\u8bb0\u5fc6&#xff1a;\u5bf9\u8bdd\u5386\u53f2\u6301\u4e45\u5316\u5230 localStorage&#xff0c;\u5237\u65b0\u9875\u9762\u540e\u539f\u6837\u6062\u590d&#xff1b;&#034;\u65b0\u5bf9\u8bdd&#034;\u6309\u94ae\u4e00\u952e\u6e05\u7a7a\u91cd\u5efa&#xff1b;<\/li>\n<li>\u6253\u5b57\u673a\u4e0e\u601d\u8003\u5360\u4f4d&#xff1a;\u6309\u94ae\u7981\u7528\u3001\u5360\u4f4d\u6587\u6848\u5207\u6362\u3001&#034;\u9605\u8bfb\u53e4\u7c4d&#034;\u7684\u8010\u5fc3\u63d0\u793a&#xff0c;\u907f\u514d\u7528\u6237\u5728\u7b49\u5f85\u4e2d\u7684\u7126\u8651&#xff1b;<\/li>\n<li>\u6d41\u5f0f\u9519\u8bef\u515c\u5e95&#xff1a;\u9047\u7f51\u7edc\u9519\u8bef\u5f39\u51fa toast \u5e76\u4fdd\u7559\u73b0\u573a&#xff1b;\u6781\u7aef\u60c5\u51b5\u4e0b\u6a21\u578b\u672a\u6309\u7ea6\u8fd4\u56de JSON \u65f6&#xff0c;\u81ea\u52a8\u9000\u5316\u4e3a\u7eaf\u6587\u672c\u6e32\u67d3&#xff0c;\u4ea7\u54c1\u7edd\u4e0d&#034;\u767d\u5c4f&#034;\u3002<\/li>\n<\/ul>\n<p>\u6240\u8c13\u5320\u5fc3&#xff0c;\u4e0d\u8fc7\u662f\u628a\u8fd9\u4e9b\u51e0\u50cf\u7d20\u7ea7\u7684\u5de5\u4f5c\u4e00\u4e00\u505a\u5b8c\u3002<\/p>\n<h3>\u516b\u3001\u56fd\u98ce\u89c6\u89c9&#xff1a;\u8ba9\u754c\u9762\u672c\u8eab\u6210\u4e3a&#034;\u975e\u9057\u4f5c\u54c1&#034;<\/h3>\n<h4>8.1 \u8272\u5f69\u53d6\u81ea\u53e4\u7c4d<\/h4>\n<p>\u6574\u5957\u89c6\u89c9\u4f53\u7cfb\u5efa\u7acb\u5728\u5ba3\u7eb8\u4e0e\u58a8\u8272\u7684\u610f\u8c61\u4e0a&#xff1a;\u7c73\u767d\u5ba3\u7eb8\u5e95\u8272 #f7f1e5&#xff0c;\u914d\u4ee5\u58a8\u8272\u6b63\u6587 #2b2520 \u4e0e\u6b21\u7ea7\u68d5\u7070\u6587\u5b57&#xff1b;\u70b9\u7f00\u8272\u9009\u7528\u4e86\u4f20\u7edf\u8272\u4e2d\u7684\u6731\u7802\u7ea2&#xff08;#a63a2b&#xff09;\u4e0e\u9edb\u84dd&#xff08;#33465f&#xff09;&#xff0c;\u938f\u91d1&#xff08;#b98a2f&#xff09;\u4ec5\u7528\u4e8e\u5fbd\u6807\u3001\u5f15\u7528\u7b49\u5c11\u91cf\u70b9\u7f00\u3002\u4e09\u79cd\u8272\u76f8\u7684\u9971\u548c\u5ea6\u90fd\u7ecf\u8fc7\u538b\u5236&#xff0c;\u4fdd\u6301&#034;\u7d20\u96c5&#034;\u7684\u6587\u4eba\u6c14\u8d28&#xff0c;\u4e5f\u4fdd\u8bc1\u957f\u65f6\u95f4\u7684\u9605\u8bfb\u8212\u9002\u3002<\/p>\n<h4>8.2 \u5b57\u4f53\u5e08\u627f\u5b8b\u660e<\/h4>\n<p>\u6b63\u6587\u91c7\u7528\u65e0\u886c\u7ebf\u7684\u73b0\u4ee3\u4e2d\u6587&#xff08;\u82f9\u65b9\u3001\u96c5\u9ed1&#xff09;&#xff0c;\u800c\u6807\u9898\u4e0e\u5370\u7ae0\u5219\u56de\u843d\u5230 Songti \/ SimSun \/ Noto Serif SC \u7b49\u5b8b\u4f53\u5b57\u65cf\u2014\u2014\u5b8b\u4f53\u627f\u8f7d\u7740\u523b\u4e66\u4e0e\u7248\u753b\u7684\u5343\u5e74\u8bb0\u5fc6&#xff0c;\u6070\u4e0e\u9879\u76ee\u6c14\u8d28\u76f8\u5408\u3002\u9875\u5934\u7684&#034;\u5bfb&#034;\u5b57\u5370\u7ae0&#xff0c;\u7528\u6731\u7802\u6e10\u53d8\u6253\u5e95\u3001\u6d6e\u96d5\u63cf\u8fb9&#xff0c;\u662f\u6574\u5957\u89c6\u89c9\u7684\u951a\u70b9\u3002<\/p>\n<h4>8.3 \u7ec6\u8282\u91cc\u7684\u4e1c\u65b9\u610f\u8c61<\/h4>\n<ul>\n<li>\u6b22\u8fce\u9875\u6807\u9898\u4e0b\u7684\u938f\u91d1\u4e0b\u5212\u7ebf&#xff0c;\u7528 SVG data-URI \u7ed8\u5236\u4e86\u4e00\u9053&#034;\u98de\u767d&#034;\u7b14\u610f&#xff1b;<\/li>\n<li>\u6d88\u606f\u6c14\u6ce1\u9ed8\u8ba4\u5c16\u89d2\u671d\u4e0a&#xff0c;AI \u6d88\u606f\u76f4\u89d2\u5fae\u5706\u3001\u7528\u6237\u6d88\u606f\u6731\u7802\u6e10\u53d8&#xff0c;\u7b26\u5408&#034;\u5ba3\u7eb8\u5bf9\u8bdd&#034;\u7684\u9690\u55bb&#xff1b;<\/li>\n<li>\u5361\u7247\u3001\u5fbd\u7ae0\u3001\u72b6\u6001\u706f\u5747\u91c7\u7528\u514b\u5236\u800c\u7edf\u4e00\u7684\u5706\u89d2\u7cfb\u7edf&#xff0c;\u6574\u5957\u754c\u9762\u65e0\u4e00\u5f20\u5916\u90e8\u56fe\u7247\u2014\u2014\u5168\u90e8\u88c5\u9970\u7531 CSS \u4e0e\u5185\u8054 SVG \u5b8c\u6210&#xff0c;\u8f7b\u91cf\u4e14\u5feb\u3002<\/li>\n<\/ul>\n<p>\u6211\u4eec\u5e0c\u671b\u7528\u6237\u5728\u6253\u5f00\u9875\u9762\u7684\u7b2c\u4e00\u79d2&#xff0c;\u5c31\u80fd\u4ece\u89c6\u89c9\u4e0a\u76f8\u4fe1&#xff1a;\u8fd9\u662f\u4e00\u4f4d&#034;\u8bb2\u4e66\u4eba&#034;&#xff0c;\u800c\u4e0d\u662f\u4e00\u53f0\u51b0\u51b7\u7684\u95ee\u7b54\u673a\u5668\u3002<\/p>\n<h3>\u4e5d\u3001\u8d28\u91cf\u9a8c\u8bc1&#xff1a;\u4e0d\u6b62\u4e8e&#034;\u80fd\u8dd1&#034;<\/h3>\n<p>\u5728\u4ea4\u4ed8\u4e4b\u524d&#xff0c;\u6211\u4eec\u505a\u4e86\u4e24\u5c42\u81ea\u52a8\u5316\u9a8c\u8bc1\u3002<\/p>\n<h4>9.1 \u771f\u5b9e API \u81ea\u6d4b\u811a\u672c<\/h4>\n<p>scripts\/test_api.js \u4ee5 Node \u73af\u5883\u5b8c\u6574\u8d70\u901a&#xff1a;\u53d1\u8d77\u6d41\u5f0f\u8bf7\u6c42 \u2192 \u7d2f\u79ef\u589e\u91cf \u2192 \u9a8c\u8bc1 JSON \u53ef\u89e3\u6790 \u2192 \u6821\u9a8c reply \/ suggestions \/ related \u5b57\u6bb5\u7684\u5b8c\u6574\u6027\u3002\u5728\u672c\u5730\u5b9e\u6d4b\u4e2d&#xff0c;\u6a21\u578b\u987a\u5229\u8fd4\u56de\u4e86\u7b26\u5408\u5951\u7ea6\u7684\u7ed3\u6784&#xff1a;<\/p>\n<p><span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token string-property property\">&#034;reply&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;\u8bb2\u5230\u975e\u9057&#xff0c;\u6211\u60f3\u8d77**\u6881\u795d\u4f20\u8bf4**&#xff08;\u6c11\u95f4\u6587\u5b66\u00b7\u6d59\u6c5f\u7ecd\u5174\u4e0a\u865e&#xff09;\u2026\u2026&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  <span class=\"token string-property property\">&#034;suggestions&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;\u6881\u795d\u5728\u54ea\u4e9b\u5730\u65b9\u6d41\u4f20\u6700\u5e7f&#xff1f;&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;\u8d8a\u5267\u300a\u6881\u795d\u300b\u548c\u539f\u4f20\u8bf4\u6709\u4ec0\u4e48\u4e0d\u540c&#xff1f;&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;\u8fd8\u6709\u54ea\u4e9b\u975e\u9057\u91cc\u85cf\u7740\u7231\u60c5\u4f20\u8bf4&#xff1f;&#034;<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  <span class=\"token string-property property\">&#034;related&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">{<\/span> <span class=\"token string-property property\">&#034;name&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;\u6881\u795d\u4f20\u8bf4&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string-property property\">&#034;type&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;\u6c11\u95f4\u6587\u5b66&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string-property property\">&#034;region&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;\u6d59\u6c5f\u676d\u5dde\u3001\u5b81\u6ce2\u911e\u5dde\u3001\u7ecd\u5174\u4e0a\u865e\u7b49&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string-property property\">&#034;desc&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;\u4e2d\u56fd\u53e4\u4ee3\u56db\u5927\u6c11\u95f4\u4f20\u8bf4\u4e4b\u4e00\u2026\u2026&#034;<\/span> <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">]<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<h4>9.2 \u6d4f\u89c8\u5668\u7ea7\u7aef\u5230\u7aef\u9a8c\u8bc1<\/h4>\n<p>scripts\/verify_page.js \u57fa\u4e8e Puppeteer \u5728\u65e0\u5934 Chromium \u4e2d\u5b8c\u6210\u7aef\u5230\u7aef\u56de\u5f52&#xff1a;\u52a0\u8f7d\u9875\u9762 \u2192 \u65ad\u8a00\u6b22\u8fce\u9875\u4e0e\u56db\u5f20\u63a8\u8350\u5361 \u2192 \u70b9\u51fb\u63a8\u8350\u5361\u89e6\u53d1\u771f\u5b9e\u5bf9\u8bdd \u2192 \u7b49\u5f85\u6d41\u5f0f\u8fd4\u56de \u2192 \u65ad\u8a00\u7528\u6237\u6d88\u606f\u4e0e AI \u6c14\u6ce1\u51fa\u73b0 \u2192 \u65ad\u8a00\u8ffd\u95ee\u6309\u94ae&#xff08;\u22653&#xff09;\u4e0e\u975e\u9057\u5361\u7247&#xff08;\u22651&#xff09;\u6e32\u67d3\u6210\u529f \u2192 \u65ad\u8a00\u53d1\u9001\u6309\u94ae\u6062\u590d\u53ef\u7528\u3002\u8fd9\u6761\u94fe\u8def\u628a&#034;\u754c\u9762 \u2192 \u8c03\u7528 \u2192 \u89e3\u6790 \u2192 \u6e32\u67d3&#034;\u5168\u90e8\u4e32\u8d77\u6765&#xff0c;\u9632\u6b62\u4efb\u4f55\u4e00\u73af\u6084\u6084\u9000\u5316\u3002<\/p>\n<p>\u4e24\u4efd\u811a\u672c\u8fde\u540c\u7528\u6cd5\u4e00\u5e76\u5199\u5165\u4e86 README&#xff0c;\u8ba9\u9879\u76ee&#034;\u53ef\u88ab\u6d4b&#034;&#xff0c;\u800c\u4e0d\u53ea\u662f&#034;\u80fd\u8fd0\u884c&#034;\u3002<\/p>\n<h3>\u5341\u3001\u8fc7\u7a0b\u4e2d\u7684\u8e29\u5751\u590d\u76d8<\/h3>\n<p>\u5f00\u53d1\u5e76\u975e\u4e00\u5e06\u98ce\u987a&#xff0c;\u8fd9\u4e9b\u5751\u503c\u5f97\u8bb0\u5f55&#xff1a;<\/p>\n<li>lastIndexOf \u89e3\u6790\u7f29\u8fdb JSON \u5931\u8d25&#xff1a;\u5df2\u5728\u7b2c\u4e94\u7ae0\u8be6\u8ff0&#xff0c;\u6700\u7ec8\u4ee5\u72b6\u6001\u673a\u914d\u5bf9\u626b\u63cf\u89e3\u51b3\u2014\u2014\u907f\u514d&#034;\u7528\u6b63\u5219\u89e3\u6790\u7ed3\u6784&#034;\u7684\u5178\u578b\u9677\u9631\u3002<\/li>\n<li>js \u6d4b\u8bd5\u6c99\u7bb1\u4e2d\u9876\u5c42 const \u4e0d\u53ef\u89c1\u4e8e\u5168\u5c40\u5bf9\u8c61&#xff1a;\u5728 Node \u7684 vm \u6c99\u7bb1\u9a8c\u8bc1\u65f6&#xff0c;\u53d1\u73b0\u7528 vm.runInContext \u6267\u884c\u811a\u672c\u540e&#xff0c;\u9876\u5c42 const AI_SYSTEM_PROMPT \u4e0d\u4f1a\u6302\u8f7d\u5230\u6c99\u7bb1\u5168\u5c40\u5bf9\u8c61&#xff0c;\u5bfc\u81f4\u53d1\u7ed9 API \u7684 system \u6d88\u606f content \u4e3a undefined&#xff0c;\u8bf7\u6c42 400\u3002\u8fd9\u4e0d\u662f\u6d4f\u89c8\u5668\u7684\u95ee\u9898&#xff08;\u6d4f\u89c8\u5668\u591a\u4e2a &lt;script&gt; \u5171\u4eab\u8bcd\u6cd5\u73af\u5883&#xff09;&#xff0c;\u4f46\u63d0\u9192\u6211\u4eec&#xff1a;\u8de8\u73af\u5883\u590d\u7528\u65f6&#xff0c;\u663e\u5f0f\u5bfc\u51fa&#xff08;globalThis.__EXPORT&#xff09;\u6c38\u8fdc\u662f\u66f4\u7a33\u7684\u505a\u6cd5\u3002<\/li>\n<li>\u591a\u5b57\u8282\u5b57\u7b26\u534a\u5305&#xff1a;\u4e2d\u6587\u5728 UTF-8 \u4e0b\u5360 3 \u5b57\u8282&#xff0c;\u7f51\u7edc\u5206\u5305\u53ef\u80fd\u628a\u5b57\u7b26&#034;\u5288&#034;\u6210\u4e24\u534a&#xff0c;\u82e5\u76f4\u63a5\u6309\u5757\u89e3\u7801\u4f1a\u4e71\u7801\u3002\u5fc5\u987b\u914d\u5408 decoder.decode(value, { stream: true })\u3002<\/li>\n<li>\u6a21\u578b\u5076\u5c14\u4e0d\u5b88\u5951\u7ea6&#xff1a;\u5373\u4fbf\u63d0\u793a\u8bcd\u5199\u660e&#034;\u53ea\u8f93\u51fa JSON&#034;&#xff0c;\u6781\u7aef\u60c5\u51b5\u4ecd\u6709\u975e JSON \u8f93\u51fa\u3002\u56e0\u6b64\u515c\u5e95\u903b\u8f91\u5fc5\u987b\u5b58\u5728&#xff1a;JSON \u89e3\u6790\u5931\u8d25\u65f6\u9000\u5316\u4e3a\u666e\u901a\u6587\u672c\u6e32\u67d3&#xff0c;\u4fdd\u8bc1\u7528\u6237\u6c38\u8fdc\u6709\u6240\u89c1\u3002<\/li>\n<li>favicon 404&#xff1a;\u9875\u9762\u9a8c\u8bc1\u65f6\u6355\u83b7\u5230\u6d4f\u89c8\u5668\u81ea\u52a8\u8bf7\u6c42 \/favicon.ico \u8fd4\u56de 404 \u7684\u62a5\u9519&#xff0c;\u6700\u7ec8\u4ee5\u5185\u8054 SVG data-URI \u56fe\u6807\u6839\u9664\u2014\u2014\u987a\u624b\u6d88\u706d\u6bcf\u4e00\u4e2a\u63a7\u5236\u53f0\u7ea2\u5b57&#xff0c;\u662f\u5bf9\u54c1\u8d28\u7684\u6d01\u7656\u3002<\/li>\n<h3>\u5341\u4e00\u3001\u6210\u679c\u4e0e\u5c55\u671b<\/h3>\n<p>\u76ee\u524d&#034;\u5bfb\u827a&#034;\u5df2\u5b8c\u6210\u7b2c\u4e00\u4e2a\u53ef\u4ea4\u4ed8\u7248\u672c&#xff0c;\u5e76\u901a\u8fc7\u771f\u5b9e\u73af\u5883\u9a8c\u8bc1\u3002\u7528\u6237\u53ef\u4ee5\u5728\u6b22\u8fce\u9875\u4e00\u952e\u5f00\u542f\u56db\u7c7b\u65c5\u7a0b&#xff1a;\u542c\u4f20\u627f\u6545\u4e8b\u3001\u6309\u63a8\u8350\u5bfb\u827a\u3001\u5b66\u6280\u827a\u5165\u95e8\u3001\u53c2\u4e0e\u5b88\u62a4\u884c\u52a8\u3002<\/p>\n<p>\u56de\u671b\u8fd9\u6bb5\u5f00\u53d1&#xff0c;\u6211\u4eec\u66f4\u613f\u610f\u628a\u5b83\u770b\u4f5c\u4e00\u4e2a&#034;\u65b9\u6cd5\u8bba\u6837\u672c&#034;&#xff1a;\u5982\u4f55\u7528\u6781\u7b80\u7684\u6280\u672f\u6808&#xff0c;\u642d\u4e00\u4e2a\u6709\u6e29\u5ea6\u7684 AI \u4ea7\u54c1\u3002 \u9879\u76ee\u672a\u6765\u7684\u60f3\u8c61\u7a7a\u95f4\u8fd8\u6709\u5f88\u591a&#xff1a;<\/p>\n<ul>\n<li>\u5bf9\u8bdd\u56fe\u8c31\u5316&#xff1a;\u628a\u7528\u6237\u63a2\u7d22\u8fc7\u7684\u975e\u9057\u9879\u76ee\u6c89\u6dc0\u4e3a\u4e00\u5f20\u53ef\u89c6\u5316\u77e5\u8bc6\u56fe\u8c31&#xff1b;<\/li>\n<li>\u591a\u6a21\u6001\u5bfb\u827a&#xff1a;\u5f15\u5165\u56fe\u7247\u751f\u6210&#xff0c;\u8ba9&#034;\u82cf\u7ee3\u9488\u6cd5&#034;&#034;\u76ae\u5f71\u96d5\u523b&#034;\u4ee5\u56fe\u8bf4\u8bdd&#xff1b;<\/li>\n<li>\u4f20\u627f\u4eba\u8fde\u9ea6&#xff1a;\u63a5\u5165\u8bed\u97f3&#xff0c;\u8ba9\u7528\u6237&#034;\u542c&#034;\u5230\u4f20\u627f\u4eba\u7684\u53e3\u8ff0\u53f2&#xff1b;<\/li>\n<li>\u5f00\u653e API \u5316&#xff1a;\u5c06&#034;\u975e\u9057\u5b88\u62a4\u4eba&#034;\u7684\u80fd\u529b\u5c01\u88c5\u4e3a\u53ef\u5d4c\u5165\u7684\u5bf9\u8bdd\u63d2\u4ef6&#xff0c;\u52a9\u529b\u6587\u65c5\u573a\u666f\u3002<\/li>\n<\/ul>\n<h3>\u5341\u4e8c\u3001\u7ed3\u8bed<\/h3>\n<p>\u975e\u9057\u4f20\u627f\u7684\u672c\u8d28&#xff0c;\u662f\u4e00\u573a\u8de8\u8d8a\u65f6\u7a7a\u7684\u5bf9\u8bdd&#xff1a;\u53e4\u4eba\u628a\u6280\u827a\u4ea4\u7ed9\u4eca\u4eba&#xff0c;\u4eca\u4eba\u518d\u628a\u5b83\u8bb2\u7ed9\u673a\u5668&#xff0c;\u673a\u5668\u53c8\u5c06\u8fd9\u4efd\u8bb0\u5fc6\u8bb2\u7ed9\u4e0b\u4e00\u4ee3\u3002\u5728\u8fd9\u573a\u5bf9\u8bdd\u91cc&#xff0c;AI \u4e0d\u8be5\u662f\u66ff\u4ee3\u8005&#xff0c;\u800c\u5e94\u8be5\u662f\u6446\u6e21\u4eba\u3002<\/p>\n<p>&#034;\u5bfb\u827a&#034;\u662f\u4e00\u4e2a\u5f88\u5c0f\u7684\u9879\u76ee&#xff0c;\u5c0f\u5230\u53ea\u6709\u51e0\u4efd\u6587\u4ef6&#xff1b;\u5b83\u4e5f\u5f88\u91cd&#xff0c;\u91cd\u5230\u627f\u8f7d\u7740\u8ba9\u5e74\u8f7b\u4eba&#034;\u88ab\u975e\u9057\u6253\u52a8\u4e00\u6b21&#034;\u7684\u613f\u671b\u3002\u6211\u4eec\u8d70\u5728\u7801\u9053\u4e0a&#xff0c;\u5199\u4e0b\u4ee3\u7801&#xff1b;\u4e5f\u8d70\u5728\u6587\u5316\u7684\u957f\u8def\u4e0a&#xff0c;\u6361\u8d77\u6280\u827a\u3002\u613f\u6bcf\u4e00\u4f4d\u6253\u5f00\u8fd9\u4e2a\u9875\u9762\u7684\u670b\u53cb&#xff0c;\u90fd\u80fd\u9047\u5230\u90a3\u4f4d\u6301\u6731\u7802\u5370\u7684\u5b88\u62a4\u4eba&#xff0c;\u95ee\u4e00\u53e5&#xff1a;\u201c\u6c5f\u6e56\u8fd9\u4e48\u8fdc&#xff0c;\u4f60\u4ece\u54ea\u91cc\u6765&#xff1f;\u201d<\/p>\n<p>\u9879\u76ee\u5730\u5740&#xff1a;https:\/\/gitcode.com\/Zch070214\/FEIYI<\/p>\n<p>\u6700\u540e&#xff0c;\u501f\u4e00\u53e5\u5728\u6c11\u95f4\u5e7f\u4e3a\u6d41\u4f20\u7684\u8001\u8bdd\u4f5c\u7ed3\u2014\u2014\u201c\u624b\u827a\u4eba&#xff0c;\u5b88\u827a\u4eba\u4e5f\u3002\u201d \u5728\u7801\u9053\u4e0a&#xff0c;\u613f\u6211\u4eec\u90fd\u80fd\u6210\u4e3a\u65b0\u4e00\u4ee3\u7684\u5b88\u827a\u4eba\u3002<\/p>\n<h3>\u9644\u5f55\u4e00&#xff1a;\u4e09\u5206\u949f\u8dd1\u8d77\u6765<\/h3>\n<p>\u62ff\u5230\u4ee3\u7801\u4e4b\u540e&#xff0c;\u6700\u5feb\u7684\u65b9\u5f0f\u6709\u4e24\u79cd\u3002<\/p>\n<p>\u65b9\u5f0f\u4e00&#xff1a;\u76f4\u63a5\u6253\u5f00\u3002 \u4f7f\u7528\u6700\u65b0\u7248\u7684 Chrome\u3001Edge \u6216 Firefox \u6d4f\u89c8\u5668&#xff0c;\u53cc\u51fb index.html \u5373\u53ef\u3002\u9875\u9762\u4f1a\u81ea\u52a8\u643a\u5e26\u5bc6\u94a5\u5411\u4e91\u7aef API \u53d1\u8d77\u8bf7\u6c42&#xff0c;\u9002\u5408\u5feb\u901f\u4f53\u9a8c\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f&#xff0c;\u90e8\u5206\u6d4f\u89c8\u5668\u5bf9 file:\/\/ \u534f\u8bae\u4e0b\u7684\u7f51\u7edc\u8bf7\u6c42\u6709\u66f4\u4e25\u683c\u7684\u9650\u5236&#xff0c;\u82e5\u9047\u5230\u8de8\u57df\u6216\u8bf7\u6c42\u5931\u8d25&#xff0c;\u5efa\u8bae\u6539\u7528\u672c\u5730\u670d\u52a1\u5668\u65b9\u5f0f\u3002<\/p>\n<p>\u65b9\u5f0f\u4e8c&#xff1a;\u672c\u5730\u670d\u52a1\u5668\u3002 \u9879\u76ee\u9644\u5e26\u4e86\u4e00\u4e2a\u56db\u5341\u884c\u5de6\u53f3\u7684\u96f6\u4f9d\u8d56\u9759\u6001\u670d\u52a1\u5668\u811a\u672c&#xff1a;<\/p>\n<p><span class=\"token function\">node<\/span> scripts\/serve.js<\/p>\n<p>\u7136\u540e\u8bbf\u95ee http:\/\/127.0.0.1:8642\u3002\u672c\u5730\u670d\u52a1\u5668\u65b9\u5f0f\u6700\u63a5\u8fd1\u751f\u4ea7\u73af\u5883&#xff0c;\u4e5f\u4fbf\u4e8e\u8c03\u8bd5\u3002\u5c06\u8be5\u76ee\u5f55\u6574\u4f53\u4e0a\u4f20\u5230\u4efb\u610f\u9759\u6001\u6258\u7ba1\u5e73\u53f0&#xff08;\u5982 GitCode Pages\u3001Nginx\u3001\u5bf9\u8c61\u5b58\u50a8&#xff09;\u540c\u6837\u53ef\u4ee5\u76f4\u63a5\u8fd0\u884c&#xff0c;\u56e0\u4e3a\u672c\u9879\u76ee\u6ca1\u6709\u540e\u7aef\u3001\u6ca1\u6709\u6784\u5efa\u6b65\u9aa4&#xff0c;\u5168\u4ed3\u5e93\u90fd\u662f\u7eaf\u9759\u6001\u4ea7\u7269\u3002<\/p>\n<h3>\u9644\u5f55\u4e8c&#xff1a;\u914d\u7f6e\u4e0e\u66ff\u6362<\/h3>\n<p>\u6240\u6709\u914d\u7f6e\u90fd\u6536\u62e2\u5728 js\/config.js \u4e00\u4e2a\u6587\u4ef6\u91cc&#xff0c;\u6309\u9700\u4fee\u6539\u5373\u53ef&#xff1a;<\/p>\n<ul>\n<li>API_URL&#xff1a;\u9ed8\u8ba4\u6307\u5411 GitCode AI \u7684\u804a\u5929\u8865\u5168\u63a5\u53e3&#xff0c;\u82e5\u5207\u6362\u5230\u5176\u4ed6\u517c\u5bb9 OpenAI \u98ce\u683c\u7684\u7f51\u5173&#xff0c;\u53ea\u9700\u66ff\u6362\u6b64\u5730\u5740&#xff1b;<\/li>\n<li>API_KEY&#xff1a;\u66ff\u6362\u4e3a\u4f60\u81ea\u5df1\u7684\u4ee4\u724c&#xff1b;<\/li>\n<li>MODEL&#xff1a;\u9ed8\u8ba4 deepseek-ai\/DeepSeek-V4-Flash&#xff1b;<\/li>\n<li>MAX_TOKENS\u3001TEMPERATURE\u3001TOP_P\u3001FREQUENCY_PENALTY \u4e0e THINKING_BUDGET&#xff1a;\u751f\u6210\u53c2\u6570&#xff0c;\u4e0e\u53c2\u8003\u4ee3\u7801\u4e00\u4e00\u5bf9\u5e94\u3002<\/li>\n<\/ul>\n<p>\u66ff\u6362\u5b8c\u6210\u540e&#xff0c;Ctrl &#043; F5 \u5f3a\u5236\u5237\u65b0\u5373\u53ef\u751f\u6548\u3002\u82e5\u5e0c\u671b\u66f4\u6362\u89d2\u8272\u8bbe\u5b9a&#xff0c;\u76f4\u63a5\u4fee\u6539 AI_SYSTEM_PROMPT \u5b57\u7b26\u4e32\u2014\u2014\u628a&#034;\u975e\u9057\u5b88\u62a4\u4eba&#034;\u6362\u6210&#034;\u8336\u6587\u5316\u5bfc\u5e08&#034;\u201c\u53e4\u5efa\u8bb2\u89e3\u5458\u201d&#xff0c;\u524d\u7aef\u65e0\u9700\u4efb\u4f55\u6539\u52a8&#xff0c;\u56e0\u4e3a\u6e32\u67d3\u5951\u7ea6\u662f\u901a\u7528\u7684\u3002<\/p>\n<h3>\u9644\u5f55\u4e09&#xff1a;\u5e38\u89c1\u95ee\u9898<\/h3>\n<p>\u95ee&#xff1a;\u4e3a\u4ec0\u4e48\u56de\u590d\u6709\u65f6\u662f\u7eaf\u6587\u672c&#xff0c;\u6ca1\u6709\u5361\u7247&#xff1f; \u7b54&#xff1a;\u7cfb\u7edf\u63d0\u793a\u8bcd\u89c4\u5b9a&#xff0c;\u4ec5\u5f53\u56de\u590d\u786e\u5b9e\u6d89\u53ca\u5177\u4f53\u975e\u9057\u9879\u76ee\u65f6\u624d\u8f93\u51fa related \u5361\u7247&#xff1b;\u5bd2\u6684\u7c7b\u3001\u79d1\u666e\u7c7b\u56de\u590d\u4f1a\u8fd4\u56de\u7a7a\u6570\u7ec4\u3002\u8fd9\u662f\u523b\u610f\u7684\u8bbe\u8ba1&#xff0c;\u907f\u514d&#034;\u786c\u585e\u5361\u7247&#034;\u7834\u574f\u5bf9\u8bdd\u81ea\u7136\u611f\u3002\u82e5\u4f60\u5e0c\u671b\u4efb\u4f55\u56de\u590d\u90fd\u5e26\u5361\u7247\u8c03\u6574\u5b57\u6bb5\u5373\u53ef\u3002<\/p>\n<p>\u95ee&#xff1a;\u5bc6\u94a5\u5199\u5728\u6d4f\u89c8\u5668\u91cc\u5b89\u5168\u5417&#xff1f; \u7b54&#xff1a;\u7eaf\u524d\u7aef\u65b9\u6848\u4e0b\u5bc6\u94a5\u5bf9\u7528\u6237\u53ef\u89c1&#xff0c;\u8fd9\u662f\u53d6\u820d\u800c\u975e\u758f\u6f0f\u3002\u9762\u5411\u516c\u4f17\u7684\u5927\u89c4\u6a21\u90e8\u7f72&#xff0c;\u5efa\u8bae\u628a\u8bf7\u6c42\u653e\u5230\u540e\u7aef\u4ee3\u7406&#xff0c;\u7531\u670d\u52a1\u7aef\u6301\u6709\u5bc6\u94a5\u5e76\u505a\u9891\u63a7\u3001\u9274\u6743&#xff1b;\u4e2a\u4eba\u81ea\u7528\u6216\u6f14\u793a\u573a\u666f&#xff0c;\u76f4\u63a5\u66b4\u9732\u662f\u53ef\u63a5\u53d7\u7684\u3002<\/p>\n<p>\u95ee&#xff1a;\u4e3a\u4ec0\u4e48\u4e0d\u7528 Vue \u6216 React&#xff1f; \u7b54&#xff1a;\u672c\u9879\u76ee\u523b\u610f\u4fdd\u6301\u539f\u751f\u5b9e\u73b0&#xff0c;\u4e3a\u7684\u662f&#034;\u6bcf\u4e00\u884c\u90fd\u53ef\u8bfb\u3001\u6bcf\u4e00\u5904\u90fd\u53ef\u6539&#034;&#xff0c;\u540c\u65f6\u628a\u8fd0\u884c\u65f6\u4f53\u79ef\u538b\u7f29\u5230\u6781\u81f4\u3002\u5bf9\u4e8e\u5355\u9875\u5bf9\u8bdd\u5e94\u7528&#xff0c;\u539f\u751f DOM \u64cd\u4f5c\u5b8c\u5168\u591f\u7528&#xff1b;\u82e5\u672a\u6765\u4ea4\u4e92\u590d\u6742\u5ea6\u4e0a\u5347&#xff0c;\u8fc1\u79fb\u5230\u6846\u67b6\u65f6&#xff0c;api.js \u4e0e config.js \u7684\u804c\u8d23\u8fb9\u754c\u4e5f\u80fd\u65e0\u7f1d\u590d\u7528\u3002<\/p>\n<p>\u95ee&#xff1a;\u591a\u8f6e\u5bf9\u8bdd\u7684\u4e0a\u4e0b\u6587\u662f\u600e\u4e48\u7ef4\u62a4\u7684&#xff1f; \u7b54&#xff1a;\u524d\u7aef\u7ef4\u62a4\u4e00\u4e2a messages \u6570\u7ec4&#xff0c;system \u63d0\u793a\u8bcd\u6052\u5728\u9996\u4f4d&#xff0c;\u5176\u540e\u6309\u5e8f\u8ffd\u52a0\u7528\u6237\u4e0e\u52a9\u624b\u7684\u6d88\u606f&#xff0c;\u8d85\u51fa\u4e8c\u5341\u6761\u65f6\u81ea\u52a8\u4e22\u5f03\u6700\u65e7\u7684\u8f6e\u6b21&#xff0c;\u907f\u514d\u4e0a\u4e0b\u6587\u8d85\u957f\u3002\u6bcf\u6b21\u53d1\u9001\u65f6\u628a\u6574\u4e2a\u6570\u7ec4\u968f\u8bf7\u6c42\u5e26\u8fc7\u53bb&#xff0c;\u6a21\u578b\u636e\u6b64\u7406\u89e3\u5bf9\u8bdd\u8109\u7edc\u3002<\/p>\n<p>\u95ee&#xff1a;\u6a21\u578b\u5076\u5c14\u4e0d\u6309 JSON \u8fd4\u56de\u600e\u4e48\u529e&#xff1f; \u7b54&#xff1a;\u8fd9\u662f\u6240\u6709&#034;LLM \u5373\u540e\u7aef&#034;\u5e94\u7528\u7684\u5e38\u6001\u98ce\u9669\u3002\u6211\u4eec\u7684\u7b56\u7565\u662f&#034;\u63d0\u793a\u8bcd\u7ea6\u675f &#043; \u589e\u91cf\u89e3\u6790 &#043; \u53cc\u91cd\u91cd\u8bd5 &#043; \u7eaf\u6587\u672c\u515c\u5e95&#034;\u56db\u9053\u9632\u7ebf&#xff1a;\u5148\u5c3d\u91cf\u8ba9\u6a21\u578b\u6309\u5951\u7ea6\u8f93\u51fa&#xff1b;\u6d41\u5f0f\u9014\u4e2d\u5b9e\u65f6\u5c1d\u8bd5\u89e3\u6790&#xff1b;\u7ed3\u675f\u540e\u82e5\u4ecd\u5931\u8d25&#xff0c;\u5219\u7528\u5bbd\u677e\u6a21\u5f0f\u6293\u53d6\u4efb\u610f\u5b8c\u6574\u5bf9\u8c61&#xff1b;\u8fde\u5bf9\u8c61\u90fd\u6293\u4e0d\u5230\u65f6&#xff0c;\u628a\u539f\u59cb\u6587\u672c\u5f53\u4f5c\u666e\u901a\u56de\u590d\u6e32\u67d3\u3002\u7528\u6237\u5728\u4efb\u4f55\u60c5\u51b5\u4e0b\u90fd\u4e0d\u4f1a\u9762\u5bf9\u7a7a\u767d\u9875\u9762\u3002<\/p>\n<hr \/>\n<p>\u672c\u6587\u7531&#034;\u5bfb\u827a \u00b7 \u975e\u9057\u4ea4\u4e92\u5f0f\u5bf9\u8bdd\u5e73\u53f0&#034;\u9879\u76ee\u5f00\u53d1\u8fc7\u7a0b\u6574\u7406\u800c\u6210\u3002# \u7801\u9053 \u00b7 \u5bfb\u827a\u2014\u2014\u4ece\u96f6\u6784\u5efa&#034;\u975e\u9057\u4ea4\u4e92\u5f0f\u5bf9\u8bdd\u5e73\u53f0&#034;\u7684\u5b8c\u6574\u5b9e\u8df5<\/p>\n<p>\u7528\u4e00\u884c\u884c\u4ee3\u7801&#xff0c;\u5728\u6570\u5b57\u4e16\u754c\u91cc\u4e3a\u5343\u5e74\u6280\u827a\u7559\u4e00\u76cf\u706f\u3002<br \/>\n\u2014\u2014 \u8bb0&#034;\u5bfb\u827a \u00b7 \u975e\u9057\u4ea4\u4e92\u5f0f\u5bf9\u8bdd\u5e73\u53f0&#034;\u7684\u8bde\u751f<\/p>\n<hr \/>\n<h3>\u4e00\u3001\u5199\u5728\u524d\u9762&#xff1a;\u6211\u4eec\u4e3a\u4ec0\u4e48\u8981\u505a\u8fd9\u4ef6\u4e8b<\/h3>\n<p>\u4e2d\u56fd\u975e\u7269\u8d28\u6587\u5316\u9057\u4ea7\u6d69\u5982\u70df\u6d77\u3002\u636e\u6587\u5316\u548c\u65c5\u6e38\u90e8\u516c\u5e03\u7684\u6570\u636e&#xff0c;\u6211\u56fd\u5df2\u6709\u56fd\u5bb6\u7ea7\u975e\u7269\u8d28\u6587\u5316\u9057\u4ea7\u4ee3\u8868\u6027\u9879\u76ee\u4e00\u5343\u4e94\u767e\u4f59\u9879&#xff0c;\u6db5\u76d6\u6c11\u95f4\u6587\u5b66\u3001\u4f20\u7edf\u97f3\u4e50\u3001\u4f20\u7edf\u821e\u8e48\u3001\u4f20\u7edf\u620f\u5267\u3001\u66f2\u827a\u3001\u4f20\u7edf\u7f8e\u672f\u3001\u4f20\u7edf\u6280\u827a\u3001\u4f20\u7edf\u533b\u836f\u3001\u6c11\u4fd7\u7b49\u5341\u5927\u7c7b\u522b\u3002\u7136\u800c\u5728\u5feb\u8282\u594f\u7684\u73b0\u4ee3\u751f\u6d3b\u4e2d&#xff0c;\u8fd9\u4e9b\u627f\u8f7d\u7740\u6c11\u65cf\u8bb0\u5fc6\u7684\u6280\u827a&#xff0c;\u6b63\u9762\u4e34\u7740\u4f20\u627f\u4eba\u8001\u9f84\u5316\u3001\u5e74\u8f7b\u4eba\u8ba4\u77e5\u65ad\u5c42\u3001\u4f20\u64ad\u6e20\u9053\u5355\u4e00\u7684\u56f0\u5883\u3002<\/p>\n<p>&#034;\u975e\u9057&#034;\u8fd9\u4e2a\u8bcd&#xff0c;\u5f88\u591a\u4eba\u542c\u8fc7&#xff0c;\u4f46\u8bf4\u4e0d\u51fa\u4e09\u6837\u5177\u4f53\u7684\u9879\u76ee&#xff1b;&#034;\u82cf\u7ee3&#034;\u5f88\u7f8e&#xff0c;\u4f46\u591a\u6570\u4eba\u4e0d\u77e5\u9053\u4e00\u6839\u4e1d\u7ebf\u53ef\u4ee5\u5288\u6210\u516b\u5341\u516b\u5206\u4e4b\u4e00&#xff1b;\u201c\u6881\u795d\u4f20\u8bf4&#034;\u4eba\u4eba\u8033\u719f\u80fd\u8be6&#xff0c;\u5374\u5c11\u6709\u4eba\u4e86\u89e3\u5b83\u5728\u6c11\u95f4\u6587\u5b66\u8c31\u7cfb\u4e2d\u7684\u4f4d\u7f6e\u3002\u4fe1\u606f\u65f6\u4ee3\u7684\u6096\u8bba\u5728\u4e8e&#xff1a;\u77e5\u8bc6\u524d\u6240\u672a\u6709\u7684\u4e30\u88d5&#xff0c;\u6ce8\u610f\u529b\u5374\u524d\u6240\u672a\u6709\u5730\u7a00\u7f3a\u3002\u975e\u9057\u8981&#034;\u6d3b&#034;\u4e0b\u53bb&#xff0c;\u9996\u5148\u8981&#034;\u88ab\u770b\u89c1\u201d\u3002<\/p>\n<p>\u800c AI \u5bf9\u8bdd\u6070\u6070\u63d0\u4f9b\u4e86\u8fd9\u6837\u4e00\u4e2a\u5165\u53e3&#xff1a;\u5b83\u5929\u7136\u662f\u4e00\u4e2a\u6241\u5e73\u7684\u3001\u65e0\u95e8\u69db\u7684\u3001\u4e00\u5bf9\u4e00\u7684\u4ea4\u4e92\u754c\u9762\u3002\u628a AI \u5851\u9020\u6210\u4e00\u4f4d&#034;\u975e\u9057\u5b88\u62a4\u4eba&#034;&#xff0c;\u8ba9\u7528\u6237\u50cf\u548c\u670b\u53cb\u804a\u5929\u4e00\u6837&#xff0c;\u95ee\u4e00\u4e2a\u6545\u4e8b\u3001\u542c\u4e00\u6bb5\u5386\u53f2\u3001\u5b66\u4e00\u95e8\u6280\u827a\u2014\u2014\u8fd9\u6b63\u662f\u672c\u9879\u76ee \u201c\u5bfb\u827a\u201d \u7684\u521d\u5fc3&#xff1a;\u5728\u7801\u9053\u4e4b\u4e0a&#xff0c;\u5bfb\u5343\u5e74\u4e4b\u827a\u3002<\/p>\n<h3>\u4e8c\u3001\u9879\u76ee\u5b9a\u4f4d\u4e0e\u6280\u672f\u9009\u578b<\/h3>\n<h4>2.1 \u5b9a\u4f4d&#xff1a;\u4e00\u4e2a\u7eaf\u7cb9\u7684\u3001\u8f7b\u91cf\u7684\u5355\u9875\u5e94\u7528<\/h4>\n<p>\u5728\u8bbe\u8ba1\u4e4b\u521d&#xff0c;\u6211\u4eec\u660e\u786e\u4e86\u51e0\u4e2a\u539f\u5219&#xff1a;<\/p>\n<ul>\n<li>\u96f6\u95e8\u69db\u4f7f\u7528&#xff1a;\u65e0\u9700\u5b89\u88c5\u3001\u65e0\u9700\u6ce8\u518c\u3001\u6253\u5f00\u5373\u7528&#xff1b;<\/li>\n<li>\u96f6\u6784\u5efa\u6210\u672c&#xff1a;\u4e0d\u4f7f\u7528 React\/Vue \u7b49\u6846\u67b6&#xff0c;\u4e0d\u5f15\u5165\u6253\u5305\u5de5\u5177&#xff0c;\u4fdd\u6301\u9879\u76ee\u6781\u7b80&#xff0c;\u8ba9\u4eba\u4eba\u90fd\u80fd\u8bfb\u61c2\u548c\u7ef4\u62a4&#xff1b;<\/li>\n<li>\u5f00\u7bb1\u5373\u7528\u7684\u667a\u80fd&#xff1a;\u63a5\u5165\u4e91\u7aef\u5927\u6a21\u578b API&#xff0c;\u8ba9&#034;\u975e\u9057\u5b88\u62a4\u4eba&#034;\u5177\u5907\u771f\u6b63\u7684\u77e5\u8bc6\u5e7f\u5ea6\u548c\u5bf9\u8bdd\u6e29\u5ea6&#xff1b;<\/li>\n<li>\u7ed3\u6784\u5316\u5448\u73b0&#xff1a;\u4e0d\u6ee1\u8db3\u4e8e&#034;\u6253\u5b57\u673a\u5f0f&#034;\u7684\u7eaf\u6587\u672c\u56de\u590d&#xff0c;\u800c\u662f\u8ba9 AI \u8fd4\u56de\u7ed3\u6784\u5316\u6570\u636e&#xff0c;\u524d\u7aef\u6e32\u67d3\u51fa\u5361\u7247\u3001\u6309\u94ae\u7b49\u4e30\u5bcc\u7684\u4ea4\u4e92\u5f62\u6001\u3002<\/li>\n<\/ul>\n<p>\u6700\u7ec8\u6280\u672f\u6808\u5b9a\u683c\u4e3a&#xff1a;HTML5 &#043; CSS3 &#043; \u539f\u751f JavaScript&#xff08;ES6&#043;&#xff09;&#043; \u4e91\u7aef AI API\u3002\u8fd9\u4efd\u7b80\u5355\u80cc\u540e&#xff0c;\u662f\u5bf9&#034;\u5c11\u5373\u662f\u591a&#034;\u7684\u575a\u6301\u2014\u2014\u4e00\u4e2a\u5b8c\u6574\u7684\u5bf9\u8bdd\u4ea7\u54c1&#xff0c;\u7528\u4e09\u4efd JS\u3001\u4e00\u4efd CSS \u548c\u4e00\u4efd HTML \u5c31\u80fd\u627f\u8f7d\u3002<\/p>\n<h4>2.2 \u4e3a\u4ec0\u4e48\u662f&#034;\u6d41\u5f0f&#034;\u5bf9\u8bdd<\/h4>\n<p>\u4f20\u7edf\u7684\u4e00\u6b21\u6027\u8bf7\u6c42&#xff08;\u8bf7\u6c42\u53d1\u51fa\u3001\u7b49\u51e0\u79d2\u3001\u6574\u6bb5\u8fd4\u56de&#xff09;\u5b58\u5728\u4e24\u4e2a\u4f53\u9a8c\u95ee\u9898&#xff1a;\u4e00\u662f\u7b49\u5f85\u65f6\u95f4\u611f\u77e5\u8fc7\u957f&#xff0c;\u4e8c\u662f\u65e0\u6cd5\u770b\u5230&#034;\u601d\u8003\u7684\u8fc7\u7a0b&#034;&#xff0c;\u4f1a\u8ba9\u7528\u6237\u6000\u7591\u7cfb\u7edf\u662f\u5426\u5361\u6b7b\u3002\u6d41\u5f0f&#xff08;Streaming&#xff09;\u54cd\u5e94\u5219\u50cf\u4eba\u5728\u8bf4\u8bdd&#xff1a;\u4e00\u4e2a\u5b57\u4e00\u4e2a\u5b57\u5730&#034;\u6253\u5b57&#034;\u51fa\u6765&#xff0c;\u5148\u7ed9\u7528\u6237\u5373\u65f6\u7684\u53cd\u9988&#xff0c;\u518d\u9010\u6b65\u5145\u5b9e\u5185\u5bb9\u3002<\/p>\n<p>\u8fd9\u5728\u5fc3\u7406\u5b66\u4e0a\u53eb&#034;\u611f\u77e5\u6027\u80fd\u4f18\u5316&#034;\u2014\u2014\u7528\u6237\u4f53\u9a8c\u5230\u7684\u54cd\u5e94\u65f6\u95f4&#xff0c;\u53d6\u51b3\u4e8e\u7b2c\u4e00\u5e27\u5185\u5bb9\u7684\u5230\u8fbe\u901f\u5ea6&#xff0c;\u800c\u975e\u5168\u90e8\u5185\u5bb9\u7684\u5b8c\u6210\u65f6\u95f4\u3002\u56e0\u6b64\u672c\u9879\u76ee\u6838\u5fc3\u91c7\u7528\u7684\u6b63\u662f SSE&#xff08;Server-Sent Events&#xff09;\u534f\u8bae\u7684\u6d41\u5f0f\u5bf9\u8bdd&#xff0c;\u8fd9\u4e00\u70b9\u4e5f\u51b3\u5b9a\u4e86\u540e\u7eed JavaScript \u6539\u9020\u65b9\u6848\u7684\u5f62\u6001\u3002<\/p>\n<h3>\u4e09\u3001\u6838\u5fc3\u5b9e\u73b0&#xff1a;\u4ece Python \u53c2\u8003\u4ee3\u7801\u5230 JavaScript<\/h3>\n<h4>3.1 \u53c2\u8003\u5b9e\u73b0&#xff1a;\u4e00\u6b21&#034;\u7ffb\u8bd1&#034;\u4e4b\u65c5<\/h4>\n<p>\u9879\u76ee\u6700\u521d\u63d0\u4f9b\u4e86\u4e00\u4efd Python \u53c2\u8003\u4ee3\u7801&#xff0c;\u7528\u4e8e\u6f14\u793a API \u7684\u6807\u51c6\u8c03\u7528\u65b9\u5f0f\u3002\u5176\u6838\u5fc3\u662f\u4e00\u4e2a\u751f\u6210\u5668&#xff1a;<\/p>\n<p><span class=\"token keyword\">def<\/span> <span class=\"token function\">query<\/span><span class=\"token punctuation\">(<\/span>payload<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    response <span class=\"token operator\">&#061;<\/span> requests<span class=\"token punctuation\">.<\/span>post<span class=\"token punctuation\">(<\/span>API_URL<span class=\"token punctuation\">,<\/span> headers<span class=\"token operator\">&#061;<\/span>headers<span class=\"token punctuation\">,<\/span> json<span class=\"token operator\">&#061;<\/span>payload<span class=\"token punctuation\">,<\/span> stream<span class=\"token operator\">&#061;<\/span><span class=\"token boolean\">True<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token keyword\">for<\/span> line <span class=\"token keyword\">in<\/span> response<span class=\"token punctuation\">.<\/span>iter_lines<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n        <span class=\"token keyword\">if<\/span> <span class=\"token keyword\">not<\/span> line<span class=\"token punctuation\">.<\/span>startswith<span class=\"token punctuation\">(<\/span><span class=\"token string\">b&#034;data:&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n            <span class=\"token keyword\">continue<\/span><br \/>\n        <span class=\"token keyword\">if<\/span> line<span class=\"token punctuation\">.<\/span>strip<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&#061;&#061;<\/span> <span class=\"token string\">b&#034;data:[DONE]&#034;<\/span><span class=\"token punctuation\">:<\/span><br \/>\n            <span class=\"token keyword\">return<\/span><br \/>\n        <span class=\"token keyword\">yield<\/span> json<span class=\"token punctuation\">.<\/span>loads<span class=\"token punctuation\">(<\/span>line<span class=\"token punctuation\">.<\/span>decode<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;utf-8&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span>lstrip<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;data:&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>\u8fd9\u6bb5\u4ee3\u7801\u77ed\u5c0f\u7cbe\u608d&#xff0c;\u5374\u6d53\u7f29\u4e86\u6d41\u5f0f\u5bf9\u8bdd\u7684\u5b8c\u6574\u9aa8\u67b6&#xff1a;\u53d1\u8d77\u6d41\u5f0f POST \u8bf7\u6c42 \u2192 \u9010\u884c\u8bfb\u53d6 \u2192 \u8fc7\u6ee4 data: \u524d\u7f00 \u2192 \u9047\u5230 [DONE] \u7ec8\u6b62 \u2192 \u9010\u6761\u4ea7\u51fa JSON\u3002\u800c\u6211\u4eec\u8981\u505a\u7684&#xff0c;\u662f\u628a\u8fd9\u5957\u903b\u8f91\u5b8c\u6574\u5730\u79fb\u690d\u5230\u6d4f\u89c8\u5668\u73af\u5883\u3002\u6d4f\u89c8\u5668\u6ca1\u6709 requests&#xff0c;\u5374\u6709\u540c\u6837\u5f3a\u5927\u7684 fetch \u4e0e ReadableStream\u3002<\/p>\n<h4>3.2 JavaScript \u6539\u5199&#xff1a;fetch &#043; ReadableStream &#043; TextDecoder<\/h4>\n<p>\u5728\u6d4f\u89c8\u5668\u7aef&#xff0c;fetch \u7684 response.body \u8fd4\u56de\u4e00\u4e2a ReadableStream&#xff0c;\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7 reader.read() \u5faa\u73af\u8bfb\u53d6\u4e8c\u8fdb\u5236\u5757\u3002\u8fd9\u91cc\u6709\u4e00\u4e2a\u5173\u952e\u7ec6\u8282&#xff1a;\u7f51\u7edc\u6570\u636e\u662f\u6309\u5757\u5230\u8fbe\u7684&#xff0c;\u4e00\u4e2a JSON \u5bf9\u8c61\u53ef\u80fd\u88ab\u62c6\u6563\u5728\u591a\u4e2a\u6570\u636e\u5757\u91cc&#xff0c;\u751a\u81f3\u4e00\u4e2a\u6570\u636e\u5757\u91cc\u53ef\u80fd\u5305\u542b\u591a\u884c SSE \u6570\u636e\u3002\u56e0\u6b64\u5fc5\u987b\u5f15\u5165\u4e00\u4e2a&#034;\u7f13\u51b2\u533a&#034;&#xff08;buffer&#xff09;\u7b56\u7565&#xff1a;<\/p>\n<p><span class=\"token keyword\">const<\/span> reader <span class=\"token operator\">&#061;<\/span> response<span class=\"token punctuation\">.<\/span>body<span class=\"token punctuation\">.<\/span><span class=\"token function\">getReader<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">const<\/span> decoder <span class=\"token operator\">&#061;<\/span> <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">TextDecoder<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;utf-8&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">let<\/span> buffer <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#034;&#034;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">while<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token boolean\">true<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token keyword\">const<\/span> <span class=\"token punctuation\">{<\/span> done<span class=\"token punctuation\">,<\/span> value <span class=\"token punctuation\">}<\/span> <span class=\"token operator\">&#061;<\/span> <span class=\"token keyword\">await<\/span> reader<span class=\"token punctuation\">.<\/span><span class=\"token function\">read<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>done<span class=\"token punctuation\">)<\/span> <span class=\"token keyword\">break<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  buffer <span class=\"token operator\">&#043;&#061;<\/span> decoder<span class=\"token punctuation\">.<\/span><span class=\"token function\">decode<\/span><span class=\"token punctuation\">(<\/span>value<span class=\"token punctuation\">,<\/span> <span class=\"token punctuation\">{<\/span> <span class=\"token literal-property property\">stream<\/span><span class=\"token operator\">:<\/span> <span class=\"token boolean\">true<\/span> <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  <span class=\"token keyword\">const<\/span> lines <span class=\"token operator\">&#061;<\/span> buffer<span class=\"token punctuation\">.<\/span><span class=\"token function\">split<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\\\\n&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  buffer <span class=\"token operator\">&#061;<\/span> lines<span class=\"token punctuation\">.<\/span><span class=\"token function\">pop<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>               <span class=\"token comment\">\/\/ \u672b\u6bb5\u53ef\u80fd\u662f\u4e0d\u5b8c\u6574\u884c&#xff0c;\u7559\u5230\u4e0b\u4e00\u8f6e\u62fc\u63a5<\/span><br \/>\n  <span class=\"token keyword\">for<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token keyword\">const<\/span> line <span class=\"token keyword\">of<\/span> lines<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">!<\/span>line<span class=\"token punctuation\">.<\/span><span class=\"token function\">trim<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">startsWith<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;data:&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token keyword\">continue<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">const<\/span> data <span class=\"token operator\">&#061;<\/span> line<span class=\"token punctuation\">.<\/span><span class=\"token function\">trim<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">slice<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">5<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">trim<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>data <span class=\"token operator\">&#061;&#061;&#061;<\/span> <span class=\"token string\">&#034;[DONE]&#034;<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span> <span class=\"token comment\">\/* \u7ed3\u675f *\/<\/span> <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token keyword\">const<\/span> chunk <span class=\"token operator\">&#061;<\/span> <span class=\"token constant\">JSON<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">parse<\/span><span class=\"token punctuation\">(<\/span>data<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">const<\/span> delta <span class=\"token operator\">&#061;<\/span> chunk<span class=\"token punctuation\">.<\/span>choices<span class=\"token operator\">?.<\/span><span class=\"token punctuation\">[<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">]<\/span><span class=\"token operator\">?.<\/span>delta<span class=\"token operator\">?.<\/span>content <span class=\"token operator\">??<\/span> <span class=\"token string\">&#034;&#034;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>delta<span class=\"token punctuation\">)<\/span> <span class=\"token function\">onDelta<\/span><span class=\"token punctuation\">(<\/span>delta<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u8fd9\u91cc\u6709\u4e09\u5904\u5bb9\u6613\u88ab\u5ffd\u89c6\u7684\u7ec6\u8282&#xff1a;<\/p>\n<li>decoder.decode(value, { stream: true })&#xff1a;\u8fd9\u4e2a stream: true \u53c2\u6570\u81f3\u5173\u91cd\u8981\u3002\u5b83\u544a\u8bc9\u89e3\u7801\u5668&#034;\u6570\u636e\u8fd8\u6ca1\u7ed3\u675f&#xff0c;\u8bf7\u5904\u7406\u53ef\u80fd\u88ab\u622a\u65ad\u7684\u591a\u5b57\u8282\u5b57\u7b26&#xff08;\u5982\u4e2d\u6587\u7684 UTF-8 \u7f16\u7801&#xff09;&#034;&#xff0c;\u907f\u514d\u51fa\u73b0\u4e71\u7801\u3002<\/li>\n<li>\u672b\u884c\u56de\u586b&#xff1a;buffer &#061; lines.pop() \u628a\u6700\u540e\u4e00\u6bb5&#034;\u4e0d\u5b8c\u6574\u7684\u884c&#034;\u4fdd\u7559\u4e0b\u6765&#xff0c;\u4e0e\u4e0b\u4e00\u6279\u6570\u636e\u62fc\u63a5\u3002\u8fd9\u662f\u6d41\u5f0f\u89e3\u6790\u534a\u5305\u6570\u636e\u7684\u6807\u51c6\u505a\u6cd5\u3002<\/li>\n<li>\u589e\u91cf\u53d6\u6570&#xff1a;\u6bcf\u4e2a chunk \u7684 choices[0].delta.content \u662f\u589e\u91cf\u6587\u672c&#xff08;\u800c\u975e\u5168\u91cf&#xff09;&#xff0c;\u5fc5\u987b\u7d2f\u79ef\u62fc\u63a5\u624d\u80fd\u5f97\u5230\u5b8c\u6574\u56de\u590d\u3002<\/li>\n<p>\u8fd9\u4e00\u6b65&#034;\u7ffb\u8bd1&#034;&#xff0c;\u5b8c\u6210\u4e86\u4ece requests \u751f\u6001\u5230 Web \u5e73\u53f0\u7684\u5e73\u6ed1\u8fc1\u79fb\u3002<\/p>\n<h4>3.3 \u601d\u8003\u9884\u7b97&#xff1a;thinking_budget \u4e0e\u63a8\u7406\u5185\u5bb9<\/h4>\n<p>\u53c2\u8003\u4ee3\u7801\u7684 payload \u91cc\u8fd8\u5305\u542b\u4e00\u4e2a\u7279\u522b\u7684\u53c2\u6570&#xff1a;thinking_budget: 2048\u3002\u8fd9\u7c7b\u53c2\u6570\u6307\u793a\u6a21\u578b\u5728\u56de\u7b54\u524d\u5148\u8fdb\u884c\u4e00\u6bb5&#034;\u5185\u90e8\u601d\u8003&#034;&#xff08;reasoning&#xff09;\u3002\u5728\u8fd4\u56de\u7684\u6d41\u4e2d&#xff0c;\u601d\u8003\u8fc7\u7a0b\u4f1a\u51fa\u73b0\u5728 delta.reasoning_content \u5b57\u6bb5&#xff0c;\u800c\u6b63\u5f0f\u56de\u7b54\u51fa\u73b0\u5728 delta.content\u3002<\/p>\n<p>\u6211\u4eec\u5728\u524d\u7aef\u5bf9\u4e8c\u8005\u505a\u4e86\u5dee\u5f02\u5316\u5904\u7406&#xff1a;\u601d\u8003\u5230\u8fbe\u65f6&#xff0c;\u6c14\u6ce1\u663e\u793a&#034;\u5bfb\u827a\u6b63\u5728\u67e5\u9605\u53e4\u7c4d&#xff0c;\u68b3\u7406\u8109\u7edc\u2026\u2026\u201c\u7684\u5360\u4f4d\u72b6\u6001&#xff0c;\u8425\u9020&#034;\u5b88\u62a4\u4eba\u6b63\u5728\u6c89\u541f&#034;\u7684\u4eea\u5f0f\u611f&#xff1b;\u4e00\u65e6\u6b63\u5f0f\u5185\u5bb9\u5f00\u59cb\u8f93\u51fa&#xff0c;\u7acb\u5373\u5207\u6362\u5230\u6d41\u5f0f\u6253\u5b57\u6548\u679c\u3002\u8fd9\u6837\u65e2\u4fdd\u7559\u4e86\u6a21\u578b\u7684\u601d\u8003\u8d28\u91cf&#xff0c;\u53c8\u4e0d\u4f1a\u8ba9\u7528\u6237\u9762\u5bf9\u4e00\u5927\u6bb5\u65e0\u7528\u7684&#034;\u5185\u5fc3\u72ec\u767d\u201d\u3002<\/p>\n<h3>\u56db\u3001\u7cfb\u7edf\u63d0\u793a\u8bcd&#xff1a;\u8ba9 AI \u8f93\u51fa\u7a0b\u5e8f\u8ba4\u8bc6\u7684 JSON<\/h3>\n<h4>4.1 \u4e3a\u4ec0\u4e48\u8981\u6c42\u7ed3\u6784\u5316\u8f93\u51fa<\/h4>\n<p>\u5982\u679c\u653e\u4efb\u5927\u6a21\u578b\u81ea\u7531\u53d1\u6325&#xff0c;\u56de\u590d\u53ef\u80fd\u662f\u4efb\u610f\u5f62\u6001\u7684\u6587\u672c&#xff1a;\u53ef\u80fd\u662f\u6563\u6587\u3001\u53ef\u80fd\u662f\u5217\u8868\u3001\u53ef\u80fd\u5e26 Markdown&#xff0c;\u4e5f\u53ef\u80fd\u4ec0\u4e48\u683c\u5f0f\u90fd\u6ca1\u6709\u3002\u524d\u7aef\u60f3\u5728\u6b64\u57fa\u7840\u4e0a\u6e32\u67d3&#034;\u8ffd\u95ee\u6309\u94ae&#034;\u6216&#034;\u975e\u9057\u5361\u7247&#034;&#xff0c;\u5c31\u53ea\u80fd\u9760\u6b63\u5219\u53bb\u731c&#xff0c;\u6781\u6613\u51fa\u9519\u3002<\/p>\n<p>\u66f4\u597d\u7684\u505a\u6cd5\u662f\u7528\u7cfb\u7edf\u63d0\u793a\u8bcd\u7ea6\u5b9a\u8f93\u51fa\u534f\u8bae&#xff1a;\u544a\u8bc9 AI&#034;\u4f60\u5fc5\u987b\u53ea\u8f93\u51fa\u4e00\u4e2a\u5408\u6cd5 JSON \u5bf9\u8c61&#034;&#xff0c;\u5e76\u7ed9\u51fa\u660e\u786e\u7684\u5b57\u6bb5\u5b9a\u4e49\u3002\u8fd9\u6837 AI \u7684&#034;\u8bf4\u8bdd&#034;\u5c31\u548c\u7a0b\u5e8f\u7684&#034;\u7406\u89e3&#034;\u5bf9\u9f50\u4e86\u2014\u2014\u8fd9\u6b63\u662f\u5f53\u524d\u5927\u6a21\u578b\u5e94\u7528\u5de5\u7a0b\u4e2d\u7684\u6838\u5fc3\u65b9\u6cd5\u8bba&#xff1a;\u7528\u81ea\u7136\u8bed\u8a00\u5b9a\u4e49\u63a5\u53e3\u5951\u7ea6&#xff08;LLM-native API design&#xff09;\u3002<\/p>\n<h4>4.2 \u6211\u4eec\u7684 JSON \u5951\u7ea6<\/h4>\n<p>\u6211\u4eec\u6700\u7ec8\u5b9a\u4e49\u7684\u54cd\u5e94\u534f\u8bae\u5305\u542b\u4e09\u4e2a\u5b57\u6bb5&#xff1a;<\/p>\n<p><span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token string-property property\">&#034;reply&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;\u56de\u590d\u6b63\u6587&#xff0c;\u53ef\u542b Markdown&#xff0c;\u7ea6 90~260 \u5b57&#xff0c;\u4fe1\u606f\u5bc6\u5ea6\u9ad8&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  <span class=\"token string-property property\">&#034;suggestions&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;\u8ffd\u95ee\u793a\u4f8b1&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;\u8ffd\u95ee\u793a\u4f8b2&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;\u8ffd\u95ee\u793a\u4f8b3&#034;<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  <span class=\"token string-property property\">&#034;related&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">{<\/span><span class=\"token string-property property\">&#034;name&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;\u82cf\u7ee3&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string-property property\">&#034;type&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;\u4f20\u7edf\u7f8e\u672f&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string-property property\">&#034;region&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;\u6c5f\u82cf\u82cf\u5dde&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string-property property\">&#034;desc&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;\u4e00\u53e5\u8bdd\u7b80\u4ecb&#034;<\/span><span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">]<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<ul>\n<li>reply&#xff1a;\u771f\u6b63\u7684\u5bf9\u8bdd\u6b63\u6587&#xff0c;\u5141\u8bb8\u9002\u5ea6\u4f7f\u7528 Markdown&#xff08;\u52a0\u7c97\u3001\u5217\u8868\u3001\u5f15\u7528&#xff09;&#xff0c;\u524d\u7aef\u6e32\u67d3\u4e3a\u5bcc\u6587\u672c&#xff1b;<\/li>\n<li>suggestions&#xff1a;\u6070\u597d\u4e09\u6761\u63a8\u8350\u8ffd\u95ee\u3002\u5b83\u627f\u62c5&#034;\u5bf9\u8bdd\u5f15\u5bfc&#034;\u7684\u804c\u8d23\u2014\u2014AI \u4e0d\u4ec5\u8981\u56de\u7b54\u95ee\u9898&#xff0c;\u8fd8\u8981\u628a\u5bf9\u8bdd\u5f15\u5411\u6df1\u5165\u3002\u70b9\u51fb\u8ffd\u95ee\u5373\u53ef\u7ee7\u7eed\u5bf9\u8bdd&#xff0c;\u5f62\u6210\u5bf9\u8bdd\u95ed\u73af&#xff1b;<\/li>\n<li>related&#xff1a;\u6d89\u53ca\u5177\u4f53\u975e\u9057\u9879\u76ee\u65f6\u8f93\u51fa\u7684&#034;\u77e5\u8bc6\u5361\u7247&#034;\u3002\u5305\u542b\u9879\u76ee\u540d\u79f0\u3001\u6240\u5c5e\u95e8\u7c7b\u3001\u5730\u533a\u4e0e\u7b80\u4ecb&#xff0c;\u524d\u7aef\u6e32\u67d3\u4e3a\u5361\u7247\u5899&#xff0c;\u628a\u96f6\u6563\u7684\u56de\u590d\u6c89\u6dc0\u4e3a\u53ef\u6d4f\u89c8\u7684\u77e5\u8bc6\u5355\u5143\u3002<\/li>\n<\/ul>\n<h4>4.3 \u89d2\u8272\u8bbe\u5b9a\u7684\u5199\u4f5c\u6280\u5de7<\/h4>\n<p>\u7cfb\u7edf\u63d0\u793a\u8bcd\u7684\u89d2\u8272\u5851\u9020&#xff0c;\u6211\u4eec\u523b\u610f\u878d\u5165\u4e86&#034;\u4eba\u5473&#034;&#xff1a;\u4e0d\u8981\u5b98\u65b9\u8f9e\u4ee4\u5f0f\u7684&#034;\u672c\u52a9\u624b\u4e3a\u60a8\u89e3\u7b54&#034;&#xff0c;\u800c\u662f&#034;\u4f60\u77e5\u8bc6\u6e0a\u535a\u800c\u6e29\u548c&#xff0c;\u8bf4\u8bdd\u5982\u4e00\u4f4d\u8bb2\u4e66\u4eba&#xff0c;\u4eb2\u5207\u3001\u6709\u753b\u9762\u611f\u3001\u6709\u6e29\u5ea6&#034;&#xff1b;\u8981\u6c42&#034;\u5584\u4e8e\u7528\u8272\u5f69\u3001\u58f0\u97f3\u3001\u89e6\u611f\u6784\u5efa\u753b\u9762&#034;&#xff1b;\u751a\u81f3\u89c4\u5b9a\u4e86&#034;\u6bcf\u6b21\u56de\u590d\u5c3d\u91cf\u4f20\u8fbe\u4e00\u70b9\u65b0\u77e5\u8bc6\u6216\u65b0\u89c6\u89d2&#034;\u3002\u540c\u65f6\u6211\u4eec\u4e5f\u5212\u4e86\u7ea2\u7ebf&#xff1a;\u201c\u4e0d\u7f16\u9020\u975e\u9057\u9879\u76ee\u548c\u4f20\u627f\u4eba\u4fe1\u606f&#xff1b;\u4e0d\u786e\u5b9a\u65f6\u5766\u8bda\u8bf4\u660e&#xff0c;\u5e76\u7ed9\u51fa\u67e5\u9605\u65b9\u5411\u201d\u3002<\/p>\n<p>\u5b9e\u6d4b\u6548\u679c\u4ee4\u4eba\u60ca\u559c&#xff1a;\u6a21\u578b\u56de\u7b54&#034;\u82cf\u7ee3\u7684\u8d77\u6e90&#034;\u65f6&#xff0c;\u4f1a\u8bb2\u8ff0\u6d63\u7eb1\u5973\u897f\u65bd&#034;\u4ee5\u8840\u67d3\u7ebf\u7ee3\u8299\u84c9&#034;\u7684\u4f20\u8bf4&#xff1b;\u56de\u7b54&#034;\u6881\u795d&#034;\u65f6&#xff0c;\u4f1a\u805a\u7126&#034;\u5341\u516b\u76f8\u9001&#034;\u8fd9\u4e2a\u88ab\u5e38\u88ab\u7565\u8fc7\u7684\u52a8\u4eba\u7247\u6bb5\u3002\u597d\u7684\u89d2\u8272\u8bbe\u5b9a&#xff0c;\u662f\u628a\u6a21\u578b\u7684&#034;\u77e5\u8bc6\u91cf&#034;\u8f6c\u5316\u4e3a&#034;\u611f\u67d3\u529b&#034;\u7684\u5173\u952e\u3002<\/p>\n<h3>\u4e94\u3001\u524d\u7aef\u589e\u91cf\u89e3\u6790&#xff1a;\u65e0\u635f\u5730\u4ece\u6d41\u4e2d&#034;\u635e\u51fa&#034; JSON<\/h3>\n<h4>5.1 \u96be\u70b9&#xff1a;\u6d41\u5f0f\u4e0e JSON \u7684\u5929\u7136\u51b2\u7a81<\/h4>\n<p>\u6d41\u5f0f\u54cd\u5e94\u662f&#034;\u8fb9\u751f\u6210\u8fb9\u4f20\u8f93&#034;\u7684&#xff0c;\u56e0\u6b64\u4efb\u610f\u65f6\u523b\u6211\u4eec\u624b\u91cc\u7684\u6587\u672c\u90fd\u662f\u4e0d\u5b8c\u6574\u7684 JSON \u7247\u6bb5\u3002\u5982\u679c\u7b49\u5168\u90e8\u4f20\u8f93\u5b8c\u6bd5\u518d\u89e3\u6790&#xff0c;\u5c31\u4e27\u5931\u4e86\u6d41\u5f0f\u5373\u65f6\u6e32\u67d3\u7684\u610f\u4e49&#xff1b;\u5982\u679c\u6025\u4e8e\u89e3\u6790&#xff0c;\u53c8\u4f1a\u88ab&#034;\u534a\u4e2a\u5bf9\u8c61&#034;\u5361\u4f4f\u3002\u6211\u4eec\u7684\u76ee\u6807\u662f&#xff1a;\u4e00\u65e6 JSON \u5728\u5927\u62ec\u53f7\u5c42\u9762\u95ed\u5408\u3001\u53ef\u4ee5\u88ab\u5b8c\u6574\u89e3\u6790&#xff0c;\u5c31\u7acb\u5373\u6e32\u67d3&#xff0c;\u4e00\u79d2\u4e5f\u4e0d\u7528\u7b49\u3002<\/p>\n<h4>5.2 \u65b9\u6848&#xff1a;\u5b57\u7b26\u4e32\u611f\u77e5\u7684\u5927\u62ec\u53f7\u914d\u5bf9\u626b\u63cf<\/h4>\n<p>\u6700\u521d\u7684\u5199\u6cd5\u662f text.lastIndexOf(&#034;{&#034;) \u62ff\u6700\u540e\u4e00\u4e2a\u5de6\u82b1\u62ec\u53f7\u4f5c\u4e3a\u8d77\u70b9\u53bb\u89e3\u6790\u2014\u2014\u4f46\u8fd9\u5728\u5e26\u7f29\u8fdb\u683c\u5f0f\u7684\u591a\u5c42 JSON \u524d\u4f1a\u5931\u6548&#xff1a;related \u6570\u7ec4\u91cc\u5d4c\u5957\u5bf9\u8c61\u81ea\u8eab\u7684 { \u624d\u662f\u6700\u540e\u4e00\u4e2a\u82b1\u62ec\u53f7&#xff0c;\u4ece\u5b83\u5f00\u59cb\u7684\u5b50\u4e32\u6839\u672c\u4e0d\u662f\u5408\u6cd5 JSON&#xff08;\u89c1\u4e0b\u56fe\u793a\u610f&#xff09;\u3002<\/p>\n<p>{<br \/>\n  &#034;reply&#034;: &#034;&#8230;&#034;,<br \/>\n  &#034;suggestions&#034;: [&#8230;],<br \/>\n  &#034;related&#034;: [ { &#034;name&#034;: &#8230;, &#8230; } ]   \u2190 \u6700\u540e\u4e00\u4e2a { \u5728\u8fd9\u91cc&#xff0c;\u4ece\u5b83\u5207\u7247\u5fc5\u5931\u8d25<br \/>\n}<\/p>\n<p>\u6b63\u786e\u7684\u89e3\u6cd5\u662f\u4ece\u5934\u626b\u63cf\u3001\u72b6\u6001\u673a\u5f0f\u5730\u7edf\u8ba1\u82b1\u62ec\u53f7\u914d\u5bf9&#xff0c;\u540c\u65f6\u8df3\u8fc7\u5b57\u7b26\u4e32\u5b57\u9762\u91cf\u5185\u7684\u82b1\u62ec\u53f7&#xff1a;<\/p>\n<p><span class=\"token keyword\">function<\/span> <span class=\"token function\">extractJsonObj<\/span><span class=\"token punctuation\">(<\/span><span class=\"token parameter\">text<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token keyword\">const<\/span> start <span class=\"token operator\">&#061;<\/span> text<span class=\"token punctuation\">.<\/span><span class=\"token function\">indexOf<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;{&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>start <span class=\"token operator\">&lt;<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token keyword\">return<\/span> <span class=\"token keyword\">null<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  <span class=\"token keyword\">let<\/span> depth <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">,<\/span> inStr <span class=\"token operator\">&#061;<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">,<\/span> escaped <span class=\"token operator\">&#061;<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  <span class=\"token keyword\">for<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token keyword\">let<\/span> i <span class=\"token operator\">&#061;<\/span> start<span class=\"token punctuation\">;<\/span> i <span class=\"token operator\">&lt;<\/span> text<span class=\"token punctuation\">.<\/span>length<span class=\"token punctuation\">;<\/span> i<span class=\"token operator\">&#043;&#043;<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">const<\/span> ch <span class=\"token operator\">&#061;<\/span> text<span class=\"token punctuation\">[<\/span>i<span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>inStr<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n      <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>escaped<span class=\"token punctuation\">)<\/span> escaped <span class=\"token operator\">&#061;<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span><br \/>\n      <span class=\"token keyword\">else<\/span> <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>ch <span class=\"token operator\">&#061;&#061;&#061;<\/span> <span class=\"token string\">&#034;\\\\\\\\&#034;<\/span><span class=\"token punctuation\">)<\/span> escaped <span class=\"token operator\">&#061;<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span><br \/>\n      <span class=\"token keyword\">else<\/span> <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>ch <span class=\"token operator\">&#061;&#061;&#061;<\/span> <span class=\"token string\">&#039;&#034;&#039;<\/span><span class=\"token punctuation\">)<\/span> inStr <span class=\"token operator\">&#061;<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span><br \/>\n      <span class=\"token keyword\">continue<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>ch <span class=\"token operator\">&#061;&#061;&#061;<\/span> <span class=\"token string\">&#039;&#034;&#039;<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span> inStr <span class=\"token operator\">&#061;<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token keyword\">continue<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>ch <span class=\"token operator\">&#061;&#061;&#061;<\/span> <span class=\"token string\">&#034;{&#034;<\/span><span class=\"token punctuation\">)<\/span> depth<span class=\"token operator\">&#043;&#043;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">else<\/span> <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>ch <span class=\"token operator\">&#061;&#061;&#061;<\/span> <span class=\"token string\">&#034;}&#034;<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n      depth<span class=\"token operator\">&#8212;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n      <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>depth <span class=\"token operator\">&#061;&#061;&#061;<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token keyword\">return<\/span> <span class=\"token constant\">JSON<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">parse<\/span><span class=\"token punctuation\">(<\/span>text<span class=\"token punctuation\">.<\/span><span class=\"token function\">slice<\/span><span class=\"token punctuation\">(<\/span>start<span class=\"token punctuation\">,<\/span> i <span class=\"token operator\">&#043;<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span><br \/>\n  <span class=\"token keyword\">return<\/span> <span class=\"token keyword\">null<\/span><span class=\"token punctuation\">;<\/span>  <span class=\"token comment\">\/\/ \u5c1a\u672a\u95ed\u5408<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u8fd9\u4e2a\u51fd\u6570\u6709\u4e09\u5c42\u4fdd\u9669&#xff1a;\u5b57\u7b26\u4e32\u5185\u7684\u5927\u62ec\u53f7\u4e0d\u8ba1\u5165\u914d\u5bf9&#xff08;\u9632\u6b62\u56de\u590d\u6b63\u6587\u91cc\u7684 {} \u5e72\u6270&#xff09;&#xff1b;\u95ed\u5408\u5230\u9876\u5c42\u5373\u5c1d\u8bd5\u89e3\u6790&#xff08;\u4fdd\u8bc1\u6548\u7387&#xff09;&#xff1b;\u89e3\u6790\u5931\u8d25\u8fd4\u56de null \u800c\u975e\u629b\u9519&#xff08;\u4fdd\u8bc1\u6d41\u5f0f\u8fc7\u7a0b\u96f6\u4e2d\u65ad&#xff09;\u3002\u5b83\u540c\u65f6\u88ab\u7528\u4e8e\u6d41\u5f0f\u8fc7\u7a0b\u4e2d\u7684&#034;\u589e\u91cf\u5c1d\u8bd5&#034;\u548c\u6d41\u7ed3\u675f\u540e\u7684&#034;\u6700\u7ec8\u515c\u5e95&#034;&#xff0c;\u4e00\u5904\u5b9e\u73b0\u3001\u4e24\u5904\u590d\u7528\u3002<\/p>\n<h4>5.3 \u6e32\u67d3\u4f18\u5148\u7ea7\u7684\u8bbe\u8ba1<\/h4>\n<p>\u5728\u6d41\u5f0f\u8fc7\u7a0b\u4e2d\u6211\u4eec\u9075\u5faa\u8fd9\u6837\u7684\u6e32\u67d3\u7b56\u7565&#xff1a;<\/p>\n<li>\u6536\u5230\u9996\u6bb5\u589e\u91cf \u2192 \u6e05\u9664&#034;\u601d\u8003\u5360\u4f4d&#034;&#xff0c;\u5f00\u59cb\u5c55\u793a\u6b63\u5728\u751f\u6210\u7684\u6587\u672c&#xff08;\u622a\u65ad\u9884\u89c8&#xff09;&#xff1b;<\/li>\n<li>\u6bcf\u6b21\u589e\u91cf\u5230\u8fbe \u2192 \u7528\u914d\u5bf9\u626b\u63cf\u5c1d\u8bd5\u89e3\u6790&#xff1b;\u4e00\u65e6\u547d\u4e2d\u5b8c\u6574 JSON \u2192 \u7acb\u5373\u6e32\u67d3\u6700\u7ec8\u5f62\u6001&#xff1a;\u5bcc\u6587\u672c &#043; \u8ffd\u95ee\u6309\u94ae &#043; \u975e\u9057\u5361\u7247&#xff1b;<\/li>\n<li>\u6e32\u67d3\u5b8c\u6210\u540e\u6807\u8bb0 rendered&#xff0c;\u540e\u7eed\u589e\u91cf\u4e0d\u518d\u91cd\u590d\u6e32\u67d3&#xff08;\u56e0\u4e3a\u5b8c\u6574\u5bf9\u8c61\u95ed\u5408\u540e&#xff0c;\u5269\u4f59\u5185\u5bb9\u57fa\u672c\u4e0d\u4f1a\u518d\u6709&#xff09;\u2014\u2014\u907f\u514d\u6296\u52a8\u548c\u4e00\u5e27\u591a\u753b\u3002<\/li>\n<p>\u8fd9\u5957\u7b56\u7565\u5728\u4fdd\u6301&#034;\u5373\u65f6\u611f&#034;\u7684\u540c\u65f6&#xff0c;\u628a\u6700\u7ec8\u5448\u73b0\u5207\u6362\u5f97\u5e72\u51c0\u5229\u843d\u3002\u5b9e\u6d4b\u4e2d&#xff0c;\u6a21\u578b\u7ea6\u5728\u6570\u79d2\u5185\u5b8c\u6210\u6574\u6bb5\u8f93\u51fa&#xff0c;\u7528\u6237\u51e0\u4e4e\u65e0\u611f\u77e5\u5730\u770b\u5230&#034;\u6253\u5b57 \u2192 \u5361\u7247\u6d6e\u73b0&#034;\u7684\u6d41\u7545\u8fc7\u6e21\u3002<\/p>\n<h3>\u516d\u3001\u5bcc\u6587\u672c\u6e32\u67d3\u4e0e XSS \u9632\u62a4<\/h3>\n<h4>6.1 \u81ea\u7814\u8f7b\u91cf Markdown \u6e32\u67d3\u5668<\/h4>\n<p>\u4e3a\u4fdd\u6301\u96f6\u4f9d\u8d56&#xff0c;\u6211\u4eec\u6ca1\u6709\u5f15\u5165 marked \/ markdown-it \u7b49\u5e93&#xff0c;\u800c\u662f\u624b\u5199\u4e86\u4e00\u4e2a\u7ea6\u56db\u5341\u884c\u7684\u8f7b\u91cf\u6e32\u67d3\u5668&#xff0c;\u8986\u76d6\u5bf9\u8bdd\u573a\u666f\u6700\u5e38\u7528\u7684\u8bed\u6cd5&#xff1a;\u884c\u5185\u4ee3\u7801\u3001\u52a0\u7c97\u3001&gt; \u5f15\u7528\u3001####\/### \u6807\u9898\u3001- \u65e0\u5e8f\u5217\u8868\u3001\u6bb5\u843d\u5206\u9694\u3002\u6e32\u67d3\u987a\u5e8f\u7ecf\u8fc7\u7cbe\u5fc3\u8bbe\u8ba1&#xff1a;\u5148\u505a HTML \u8f6c\u4e49&#xff0c;\u518d\u505a\u6a21\u5f0f\u66ff\u6362&#xff0c;\u5e76\u4e14\u6ce8\u610f&#034;\u5217\u8868\u9879\u5148\u5206\u7ec4\u4e3a ul\u3001\u518d\u7ec4\u6bb5\u843d&#034;\u7684\u987a\u5e8f&#xff0c;\u907f\u514d\u5d4c\u5957\u9519\u4e71\u3002<\/p>\n<h4>6.2 \u5b89\u5168\u662f\u786c\u5e95\u7ebf<\/h4>\n<p>AI \u751f\u6210\u7684\u5185\u5bb9\u662f\u4e0d\u53ef\u4fe1\u7684\u7b2c\u4e09\u65b9\u8f93\u5165\u3002\u5982\u679c\u76f4\u63a5\u628a\u6a21\u578b\u7684\u8f93\u51fa\u62fc\u8fdb innerHTML&#xff0c;\u4e00\u65e6\u6a21\u578b\u88ab\u8bf1\u5bfc\u8f93\u51fa &lt;script&gt; \u6216 &lt;img onerror&gt; \u4e4b\u7c7b\u7684\u8f7d\u8377&#xff0c;\u5c31\u4f1a\u9020\u6210\u5b58\u50a8\u578b XSS\u3002\u56e0\u6b64\u6211\u4eec\u575a\u6301&#xff1a;<\/p>\n<li>\u6240\u6709\u6e32\u67d3\u8def\u5f84\u5148\u7ecf\u8fc7 escapeHtml()&#xff0c;\u628a &lt; &gt; &amp; &#034; \u8f6c\u4e49\u4e3a\u5b9e\u4f53&#xff1b;<\/li>\n<li>\u518d\u5728\u8f6c\u4e49\u540e\u7684\u6587\u672c\u4e0a\u5e94\u7528 Markdown \u66ff\u6362\u89c4\u5219&#xff08;\u6b64\u65f6\u66ff\u6362\u4ea7\u7269\u662f\u53d7\u63a7\u7684\u6807\u7b7e&#xff0c;\u6ce8\u5165\u7684\u539f\u59cb\u6807\u7b7e\u65e9\u5df2\u5931\u6548&#xff09;&#xff1b;<\/li>\n<li>\u8ffd\u95ee\u6309\u94ae\u3001\u5361\u7247\u6587\u672c\u4e00\u5f8b\u901a\u8fc7 textContent \u5199\u5165&#xff0c;\u7edd\u4e0d\u76f4\u63a5\u63d2\u5165 HTML\u3002<\/li>\n<p>\u201c\u5148\u8f6c\u4e49\u3001\u540e\u5bcc\u5316\u201d \u662f\u5b89\u5168\u5bcc\u6587\u672c\u6e32\u67d3\u7684\u9ec4\u91d1\u6b21\u5e8f&#xff0c;\u4efb\u4f55\u76f4\u63a5\u5bf9\u6a21\u578b\u8f93\u51fa\u505a .replace \u6ce8\u5165\u6807\u7b7e\u518d\u8d4b\u7ed9 innerHTML \u7684\u505a\u6cd5\u90fd\u5e94\u89c6\u4e3a\u9ad8\u5371\u3002<\/p>\n<h3>\u4e03\u3001\u4f53\u9a8c\u7ec6\u8282&#xff1a;\u90a3\u4e9b\u8ba9\u4ea7\u54c1&#034;\u6709\u6e29\u5ea6&#034;\u7684\u5c0f\u4e8b<\/h3>\n<p>\u4e00\u4e2a\u4ea7\u54c1\u7684\u8d28\u611f&#xff0c;\u5f80\u5f80\u85cf\u5728\u4e0d\u88ab\u6ce8\u610f\u7684\u7ec6\u8282\u91cc\u3002\u6211\u4eec\u5728\u8fd9\u4e00\u7248\u91cc\u6253\u78e8\u4e86\u8fd9\u4e9b\u70b9&#xff1a;<\/p>\n<ul>\n<li>Enter \u53d1\u9001\u3001Shift&#043;Enter \u6362\u884c&#xff1a;\u9075\u5faa\u5373\u65f6\u901a\u8baf\u8f6f\u4ef6\u7684\u5fc3\u667a\u6a21\u578b&#xff0c;\u957f\u6587\u672c\u9700\u6c42\u4ea4\u7ed9\u6362\u884c\u952e&#xff1b;<\/li>\n<li>Textarea \u81ea\u9002\u5e94\u9ad8\u5ea6&#xff1a;\u8f93\u5165\u6846\u968f\u5185\u5bb9\u589e\u957f&#xff0c;\u6700\u9ad8 140px&#xff0c;\u8d85\u8fc7\u540e\u5185\u90e8\u6eda\u52a8&#xff0c;\u907f\u514d\u906e\u6321\u5bf9\u8bdd\u533a&#xff1b;<\/li>\n<li>\u5feb\u6377\u8ffd\u95ee\u6761&#xff1a;\u6700\u8fd1\u4e00\u6b21\u7684\u7ed3\u6784\u5316\u56de\u590d\u4e2d\u7684\u8ffd\u95ee&#xff0c;\u4f1a\u5e38\u9a7b\u8f93\u5165\u6846\u4e0a\u65b9&#xff0c;\u5f62\u6210&#034;\u7535\u68af\u6309\u94ae&#034;\u5f0f\u7684\u5f15\u5bfc&#xff0c;\u7528\u6237\u53ef\u4ee5\u8fde\u7eed\u8ffd\u95ee\u800c\u65e0\u9700\u6253\u5b57&#xff1b;<\/li>\n<li>\u4e24\u4e2a\u53d1\u9645\u7ebf&#xff1a;AI \u4fa7\u7528\u9edb\u84dd\u5370\u7ae0&#034;\u5bfb&#034;&#xff0c;\u7528\u6237\u4fa7\u7528\u6731\u7802\u5370\u7ae0&#034;\u827a&#034;&#xff0c;\u4e00\u51b7\u4e00\u6696&#xff0c;\u547c\u5e94&#034;\u5b88\u62a4\u4eba&#034;\u4e0e&#034;\u63a2\u827a\u4eba&#034;\u7684\u8eab\u4efd\u5bf9\u5e94&#xff1b;<\/li>\n<li>\u672c\u5730\u4f1a\u8bdd\u8bb0\u5fc6&#xff1a;\u5bf9\u8bdd\u5386\u53f2\u6301\u4e45\u5316\u5230 localStorage&#xff0c;\u5237\u65b0\u9875\u9762\u540e\u539f\u6837\u6062\u590d&#xff1b;&#034;\u65b0\u5bf9\u8bdd&#034;\u6309\u94ae\u4e00\u952e\u6e05\u7a7a\u91cd\u5efa&#xff1b;<\/li>\n<li>\u6253\u5b57\u673a\u4e0e\u601d\u8003\u5360\u4f4d&#xff1a;\u6309\u94ae\u7981\u7528\u3001\u5360\u4f4d\u6587\u6848\u5207\u6362\u3001&#034;\u9605\u8bfb\u53e4\u7c4d&#034;\u7684\u8010\u5fc3\u63d0\u793a&#xff0c;\u907f\u514d\u7528\u6237\u5728\u7b49\u5f85\u4e2d\u7684\u7126\u8651&#xff1b;<\/li>\n<li>\u6d41\u5f0f\u9519\u8bef\u515c\u5e95&#xff1a;\u9047\u7f51\u7edc\u9519\u8bef\u5f39\u51fa toast \u5e76\u4fdd\u7559\u73b0\u573a&#xff1b;\u6781\u7aef\u60c5\u51b5\u4e0b\u6a21\u578b\u672a\u6309\u7ea6\u8fd4\u56de JSON \u65f6&#xff0c;\u81ea\u52a8\u9000\u5316\u4e3a\u7eaf\u6587\u672c\u6e32\u67d3&#xff0c;\u4ea7\u54c1\u7edd\u4e0d&#034;\u767d\u5c4f&#034;\u3002<\/li>\n<\/ul>\n<p>\u6240\u8c13\u5320\u5fc3&#xff0c;\u4e0d\u8fc7\u662f\u628a\u8fd9\u4e9b\u51e0\u50cf\u7d20\u7ea7\u7684\u5de5\u4f5c\u4e00\u4e00\u505a\u5b8c\u3002<\/p>\n<h3>\u516b\u3001\u56fd\u98ce\u89c6\u89c9&#xff1a;\u8ba9\u754c\u9762\u672c\u8eab\u6210\u4e3a&#034;\u975e\u9057\u4f5c\u54c1&#034;<\/h3>\n<h4>8.1 \u8272\u5f69\u53d6\u81ea\u53e4\u7c4d<\/h4>\n<p>\u6574\u5957\u89c6\u89c9\u4f53\u7cfb\u5efa\u7acb\u5728\u5ba3\u7eb8\u4e0e\u58a8\u8272\u7684\u610f\u8c61\u4e0a&#xff1a;\u7c73\u767d\u5ba3\u7eb8\u5e95\u8272 #f7f1e5&#xff0c;\u914d\u4ee5\u58a8\u8272\u6b63\u6587 #2b2520 \u4e0e\u6b21\u7ea7\u68d5\u7070\u6587\u5b57&#xff1b;\u70b9\u7f00\u8272\u9009\u7528\u4e86\u4f20\u7edf\u8272\u4e2d\u7684\u6731\u7802\u7ea2&#xff08;#a63a2b&#xff09;\u4e0e\u9edb\u84dd&#xff08;#33465f&#xff09;&#xff0c;\u938f\u91d1&#xff08;#b98a2f&#xff09;\u4ec5\u7528\u4e8e\u5fbd\u6807\u3001\u5f15\u7528\u7b49\u5c11\u91cf\u70b9\u7f00\u3002\u4e09\u79cd\u8272\u76f8\u7684\u9971\u548c\u5ea6\u90fd\u7ecf\u8fc7\u538b\u5236&#xff0c;\u4fdd\u6301&#034;\u7d20\u96c5&#034;\u7684\u6587\u4eba\u6c14\u8d28&#xff0c;\u4e5f\u4fdd\u8bc1\u957f\u65f6\u95f4\u7684\u9605\u8bfb\u8212\u9002\u3002<\/p>\n<h4>8.2 \u5b57\u4f53\u5e08\u627f\u5b8b\u660e<\/h4>\n<p>\u6b63\u6587\u91c7\u7528\u65e0\u886c\u7ebf\u7684\u73b0\u4ee3\u4e2d\u6587&#xff08;\u82f9\u65b9\u3001\u96c5\u9ed1&#xff09;&#xff0c;\u800c\u6807\u9898\u4e0e\u5370\u7ae0\u5219\u56de\u843d\u5230 Songti \/ SimSun \/ Noto Serif SC \u7b49\u5b8b\u4f53\u5b57\u65cf\u2014\u2014\u5b8b\u4f53\u627f\u8f7d\u7740\u523b\u4e66\u4e0e\u7248\u753b\u7684\u5343\u5e74\u8bb0\u5fc6&#xff0c;\u6070\u4e0e\u9879\u76ee\u6c14\u8d28\u76f8\u5408\u3002\u9875\u5934\u7684&#034;\u5bfb&#034;\u5b57\u5370\u7ae0&#xff0c;\u7528\u6731\u7802\u6e10\u53d8\u6253\u5e95\u3001\u6d6e\u96d5\u63cf\u8fb9&#xff0c;\u662f\u6574\u5957\u89c6\u89c9\u7684\u951a\u70b9\u3002<\/p>\n<h4>8.3 \u7ec6\u8282\u91cc\u7684\u4e1c\u65b9\u610f\u8c61<\/h4>\n<ul>\n<li>\u6b22\u8fce\u9875\u6807\u9898\u4e0b\u7684\u938f\u91d1\u4e0b\u5212\u7ebf&#xff0c;\u7528 SVG data-URI \u7ed8\u5236\u4e86\u4e00\u9053&#034;\u98de\u767d&#034;\u7b14\u610f&#xff1b;<\/li>\n<li>\u6d88\u606f\u6c14\u6ce1\u9ed8\u8ba4\u5c16\u89d2\u671d\u4e0a&#xff0c;AI \u6d88\u606f\u76f4\u89d2\u5fae\u5706\u3001\u7528\u6237\u6d88\u606f\u6731\u7802\u6e10\u53d8&#xff0c;\u7b26\u5408&#034;\u5ba3\u7eb8\u5bf9\u8bdd&#034;\u7684\u9690\u55bb&#xff1b;<\/li>\n<li>\u5361\u7247\u3001\u5fbd\u7ae0\u3001\u72b6\u6001\u706f\u5747\u91c7\u7528\u514b\u5236\u800c\u7edf\u4e00\u7684\u5706\u89d2\u7cfb\u7edf&#xff0c;\u6574\u5957\u754c\u9762\u65e0\u4e00\u5f20\u5916\u90e8\u56fe\u7247\u2014\u2014\u5168\u90e8\u88c5\u9970\u7531 CSS \u4e0e\u5185\u8054 SVG \u5b8c\u6210&#xff0c;\u8f7b\u91cf\u4e14\u5feb\u3002<\/li>\n<\/ul>\n<p>\u6211\u4eec\u5e0c\u671b\u7528\u6237\u5728\u6253\u5f00\u9875\u9762\u7684\u7b2c\u4e00\u79d2&#xff0c;\u5c31\u80fd\u4ece\u89c6\u89c9\u4e0a\u76f8\u4fe1&#xff1a;\u8fd9\u662f\u4e00\u4f4d&#034;\u8bb2\u4e66\u4eba&#034;&#xff0c;\u800c\u4e0d\u662f\u4e00\u53f0\u51b0\u51b7\u7684\u95ee\u7b54\u673a\u5668\u3002<\/p>\n<h3>\u4e5d\u3001\u8d28\u91cf\u9a8c\u8bc1&#xff1a;\u4e0d\u6b62\u4e8e&#034;\u80fd\u8dd1&#034;<\/h3>\n<p>\u5728\u4ea4\u4ed8\u4e4b\u524d&#xff0c;\u6211\u4eec\u505a\u4e86\u4e24\u5c42\u81ea\u52a8\u5316\u9a8c\u8bc1\u3002<\/p>\n<h4>9.1 \u771f\u5b9e API \u81ea\u6d4b\u811a\u672c<\/h4>\n<p>scripts\/test_api.js \u4ee5 Node \u73af\u5883\u5b8c\u6574\u8d70\u901a&#xff1a;\u53d1\u8d77\u6d41\u5f0f\u8bf7\u6c42 \u2192 \u7d2f\u79ef\u589e\u91cf \u2192 \u9a8c\u8bc1 JSON \u53ef\u89e3\u6790 \u2192 \u6821\u9a8c reply \/ suggestions \/ related \u5b57\u6bb5\u7684\u5b8c\u6574\u6027\u3002\u5728\u672c\u5730\u5b9e\u6d4b\u4e2d&#xff0c;\u6a21\u578b\u987a\u5229\u8fd4\u56de\u4e86\u7b26\u5408\u5951\u7ea6\u7684\u7ed3\u6784&#xff1a;<\/p>\n<p><span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token string-property property\">&#034;reply&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;\u8bb2\u5230\u975e\u9057&#xff0c;\u6211\u60f3\u8d77**\u6881\u795d\u4f20\u8bf4**&#xff08;\u6c11\u95f4\u6587\u5b66\u00b7\u6d59\u6c5f\u7ecd\u5174\u4e0a\u865e&#xff09;\u2026\u2026&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  <span class=\"token string-property property\">&#034;suggestions&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;\u6881\u795d\u5728\u54ea\u4e9b\u5730\u65b9\u6d41\u4f20\u6700\u5e7f&#xff1f;&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;\u8d8a\u5267\u300a\u6881\u795d\u300b\u548c\u539f\u4f20\u8bf4\u6709\u4ec0\u4e48\u4e0d\u540c&#xff1f;&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;\u8fd8\u6709\u54ea\u4e9b\u975e\u9057\u91cc\u85cf\u7740\u7231\u60c5\u4f20\u8bf4&#xff1f;&#034;<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  <span class=\"token string-property property\">&#034;related&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">{<\/span> <span class=\"token string-property property\">&#034;name&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;\u6881\u795d\u4f20\u8bf4&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string-property property\">&#034;type&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;\u6c11\u95f4\u6587\u5b66&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string-property property\">&#034;region&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;\u6d59\u6c5f\u676d\u5dde\u3001\u5b81\u6ce2\u911e\u5dde\u3001\u7ecd\u5174\u4e0a\u865e\u7b49&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string-property property\">&#034;desc&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;\u4e2d\u56fd\u53e4\u4ee3\u56db\u5927\u6c11\u95f4\u4f20\u8bf4\u4e4b\u4e00\u2026\u2026&#034;<\/span> <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">]<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<h4>9.2 \u6d4f\u89c8\u5668\u7ea7\u7aef\u5230\u7aef\u9a8c\u8bc1<\/h4>\n<p>scripts\/verify_page.js \u57fa\u4e8e Puppeteer \u5728\u65e0\u5934 Chromium \u4e2d\u5b8c\u6210\u7aef\u5230\u7aef\u56de\u5f52&#xff1a;\u52a0\u8f7d\u9875\u9762 \u2192 \u65ad\u8a00\u6b22\u8fce\u9875\u4e0e\u56db\u5f20\u63a8\u8350\u5361 \u2192 \u70b9\u51fb\u63a8\u8350\u5361\u89e6\u53d1\u771f\u5b9e\u5bf9\u8bdd \u2192 \u7b49\u5f85\u6d41\u5f0f\u8fd4\u56de \u2192 \u65ad\u8a00\u7528\u6237\u6d88\u606f\u4e0e AI \u6c14\u6ce1\u51fa\u73b0 \u2192 \u65ad\u8a00\u8ffd\u95ee\u6309\u94ae&#xff08;\u22653&#xff09;\u4e0e\u975e\u9057\u5361\u7247&#xff08;\u22651&#xff09;\u6e32\u67d3\u6210\u529f \u2192 \u65ad\u8a00\u53d1\u9001\u6309\u94ae\u6062\u590d\u53ef\u7528\u3002\u8fd9\u6761\u94fe\u8def\u628a&#034;\u754c\u9762 \u2192 \u8c03\u7528 \u2192 \u89e3\u6790 \u2192 \u6e32\u67d3&#034;\u5168\u90e8\u4e32\u8d77\u6765&#xff0c;\u9632\u6b62\u4efb\u4f55\u4e00\u73af\u6084\u6084\u9000\u5316\u3002<\/p>\n<p>\u4e24\u4efd\u811a\u672c\u8fde\u540c\u7528\u6cd5\u4e00\u5e76\u5199\u5165\u4e86 README&#xff0c;\u8ba9\u9879\u76ee&#034;\u53ef\u88ab\u6d4b&#034;&#xff0c;\u800c\u4e0d\u53ea\u662f&#034;\u80fd\u8fd0\u884c&#034;\u3002<\/p>\n<h3>\u5341\u3001\u8fc7\u7a0b\u4e2d\u7684\u8e29\u5751\u590d\u76d8<\/h3>\n<p>\u5f00\u53d1\u5e76\u975e\u4e00\u5e06\u98ce\u987a&#xff0c;\u8fd9\u4e9b\u5751\u503c\u5f97\u8bb0\u5f55&#xff1a;<\/p>\n<li>lastIndexOf \u89e3\u6790\u7f29\u8fdb JSON \u5931\u8d25&#xff1a;\u5df2\u5728\u7b2c\u4e94\u7ae0\u8be6\u8ff0&#xff0c;\u6700\u7ec8\u4ee5\u72b6\u6001\u673a\u914d\u5bf9\u626b\u63cf\u89e3\u51b3\u2014\u2014\u907f\u514d&#034;\u7528\u6b63\u5219\u89e3\u6790\u7ed3\u6784&#034;\u7684\u5178\u578b\u9677\u9631\u3002<\/li>\n<li>js \u6d4b\u8bd5\u6c99\u7bb1\u4e2d\u9876\u5c42 const \u4e0d\u53ef\u89c1\u4e8e\u5168\u5c40\u5bf9\u8c61&#xff1a;\u5728 Node \u7684 vm \u6c99\u7bb1\u9a8c\u8bc1\u65f6&#xff0c;\u53d1\u73b0\u7528 vm.runInContext \u6267\u884c\u811a\u672c\u540e&#xff0c;\u9876\u5c42 const AI_SYSTEM_PROMPT \u4e0d\u4f1a\u6302\u8f7d\u5230\u6c99\u7bb1\u5168\u5c40\u5bf9\u8c61&#xff0c;\u5bfc\u81f4\u53d1\u7ed9 API \u7684 system \u6d88\u606f content \u4e3a undefined&#xff0c;\u8bf7\u6c42 400\u3002\u8fd9\u4e0d\u662f\u6d4f\u89c8\u5668\u7684\u95ee\u9898&#xff08;\u6d4f\u89c8\u5668\u591a\u4e2a &lt;script&gt; \u5171\u4eab\u8bcd\u6cd5\u73af\u5883&#xff09;&#xff0c;\u4f46\u63d0\u9192\u6211\u4eec&#xff1a;\u8de8\u73af\u5883\u590d\u7528\u65f6&#xff0c;\u663e\u5f0f\u5bfc\u51fa&#xff08;globalThis.__EXPORT&#xff09;\u6c38\u8fdc\u662f\u66f4\u7a33\u7684\u505a\u6cd5\u3002<\/li>\n<li>\u591a\u5b57\u8282\u5b57\u7b26\u534a\u5305&#xff1a;\u4e2d\u6587\u5728 UTF-8 \u4e0b\u5360 3 \u5b57\u8282&#xff0c;\u7f51\u7edc\u5206\u5305\u53ef\u80fd\u628a\u5b57\u7b26&#034;\u5288&#034;\u6210\u4e24\u534a&#xff0c;\u82e5\u76f4\u63a5\u6309\u5757\u89e3\u7801\u4f1a\u4e71\u7801\u3002\u5fc5\u987b\u914d\u5408 decoder.decode(value, { stream: true })\u3002<\/li>\n<li>\u6a21\u578b\u5076\u5c14\u4e0d\u5b88\u5951\u7ea6&#xff1a;\u5373\u4fbf\u63d0\u793a\u8bcd\u5199\u660e&#034;\u53ea\u8f93\u51fa JSON&#034;&#xff0c;\u6781\u7aef\u60c5\u51b5\u4ecd\u6709\u975e JSON \u8f93\u51fa\u3002\u56e0\u6b64\u515c\u5e95\u903b\u8f91\u5fc5\u987b\u5b58\u5728&#xff1a;JSON \u89e3\u6790\u5931\u8d25\u65f6\u9000\u5316\u4e3a\u666e\u901a\u6587\u672c\u6e32\u67d3&#xff0c;\u4fdd\u8bc1\u7528\u6237\u6c38\u8fdc\u6709\u6240\u89c1\u3002<\/li>\n<li>favicon 404&#xff1a;\u9875\u9762\u9a8c\u8bc1\u65f6\u6355\u83b7\u5230\u6d4f\u89c8\u5668\u81ea\u52a8\u8bf7\u6c42 \/favicon.ico \u8fd4\u56de 404 \u7684\u62a5\u9519&#xff0c;\u6700\u7ec8\u4ee5\u5185\u8054 SVG data-URI \u56fe\u6807\u6839\u9664\u2014\u2014\u987a\u624b\u6d88\u706d\u6bcf\u4e00\u4e2a\u63a7\u5236\u53f0\u7ea2\u5b57&#xff0c;\u662f\u5bf9\u54c1\u8d28\u7684\u6d01\u7656\u3002<\/li>\n<h3>\u5341\u4e00\u3001\u6210\u679c\u4e0e\u5c55\u671b<\/h3>\n<p>\u76ee\u524d&#034;\u5bfb\u827a&#034;\u5df2\u5b8c\u6210\u7b2c\u4e00\u4e2a\u53ef\u4ea4\u4ed8\u7248\u672c&#xff0c;\u5e76\u901a\u8fc7\u771f\u5b9e\u73af\u5883\u9a8c\u8bc1\u3002\u7528\u6237\u53ef\u4ee5\u5728\u6b22\u8fce\u9875\u4e00\u952e\u5f00\u542f\u56db\u7c7b\u65c5\u7a0b&#xff1a;\u542c\u4f20\u627f\u6545\u4e8b\u3001\u6309\u63a8\u8350\u5bfb\u827a\u3001\u5b66\u6280\u827a\u5165\u95e8\u3001\u53c2\u4e0e\u5b88\u62a4\u884c\u52a8\u3002<\/p>\n<p>\u56de\u671b\u8fd9\u6bb5\u5f00\u53d1&#xff0c;\u6211\u4eec\u66f4\u613f\u610f\u628a\u5b83\u770b\u4f5c\u4e00\u4e2a&#034;\u65b9\u6cd5\u8bba\u6837\u672c&#034;&#xff1a;\u5982\u4f55\u7528\u6781\u7b80\u7684\u6280\u672f\u6808&#xff0c;\u642d\u4e00\u4e2a\u6709\u6e29\u5ea6\u7684 AI \u4ea7\u54c1\u3002 \u9879\u76ee\u672a\u6765\u7684\u60f3\u8c61\u7a7a\u95f4\u8fd8\u6709\u5f88\u591a&#xff1a;<\/p>\n<ul>\n<li>\u5bf9\u8bdd\u56fe\u8c31\u5316&#xff1a;\u628a\u7528\u6237\u63a2\u7d22\u8fc7\u7684\u975e\u9057\u9879\u76ee\u6c89\u6dc0\u4e3a\u4e00\u5f20\u53ef\u89c6\u5316\u77e5\u8bc6\u56fe\u8c31&#xff1b;<\/li>\n<li>\u591a\u6a21\u6001\u5bfb\u827a&#xff1a;\u5f15\u5165\u56fe\u7247\u751f\u6210&#xff0c;\u8ba9&#034;\u82cf\u7ee3\u9488\u6cd5&#034;&#034;\u76ae\u5f71\u96d5\u523b&#034;\u4ee5\u56fe\u8bf4\u8bdd&#xff1b;<\/li>\n<li>\u4f20\u627f\u4eba\u8fde\u9ea6&#xff1a;\u63a5\u5165\u8bed\u97f3&#xff0c;\u8ba9\u7528\u6237&#034;\u542c&#034;\u5230\u4f20\u627f\u4eba\u7684\u53e3\u8ff0\u53f2&#xff1b;<\/li>\n<li>\u5f00\u653e API \u5316&#xff1a;\u5c06&#034;\u975e\u9057\u5b88\u62a4\u4eba&#034;\u7684\u80fd\u529b\u5c01\u88c5\u4e3a\u53ef\u5d4c\u5165\u7684\u5bf9\u8bdd\u63d2\u4ef6&#xff0c;\u52a9\u529b\u6587\u65c5\u573a\u666f\u3002<\/li>\n<\/ul>\n<h3>\u5341\u4e8c\u3001\u7ed3\u8bed<\/h3>\n<p>\u975e\u9057\u4f20\u627f\u7684\u672c\u8d28&#xff0c;\u662f\u4e00\u573a\u8de8\u8d8a\u65f6\u7a7a\u7684\u5bf9\u8bdd&#xff1a;\u53e4\u4eba\u628a\u6280\u827a\u4ea4\u7ed9\u4eca\u4eba&#xff0c;\u4eca\u4eba\u518d\u628a\u5b83\u8bb2\u7ed9\u673a\u5668&#xff0c;\u673a\u5668\u53c8\u5c06\u8fd9\u4efd\u8bb0\u5fc6\u8bb2\u7ed9\u4e0b\u4e00\u4ee3\u3002\u5728\u8fd9\u573a\u5bf9\u8bdd\u91cc&#xff0c;AI \u4e0d\u8be5\u662f\u66ff\u4ee3\u8005&#xff0c;\u800c\u5e94\u8be5\u662f\u6446\u6e21\u4eba\u3002<\/p>\n<p>&#034;\u5bfb\u827a&#034;\u662f\u4e00\u4e2a\u5f88\u5c0f\u7684\u9879\u76ee&#xff0c;\u5c0f\u5230\u53ea\u6709\u51e0\u4efd\u6587\u4ef6&#xff1b;\u5b83\u4e5f\u5f88\u91cd&#xff0c;\u91cd\u5230\u627f\u8f7d\u7740\u8ba9\u5e74\u8f7b\u4eba&#034;\u88ab\u975e\u9057\u6253\u52a8\u4e00\u6b21&#034;\u7684\u613f\u671b\u3002\u6211\u4eec\u8d70\u5728\u7801\u9053\u4e0a&#xff0c;\u5199\u4e0b\u4ee3\u7801&#xff1b;\u4e5f\u8d70\u5728\u6587\u5316\u7684\u957f\u8def\u4e0a&#xff0c;\u6361\u8d77\u6280\u827a\u3002\u613f\u6bcf\u4e00\u4f4d\u6253\u5f00\u8fd9\u4e2a\u9875\u9762\u7684\u670b\u53cb&#xff0c;\u90fd\u80fd\u9047\u5230\u90a3\u4f4d\u6301\u6731\u7802\u5370\u7684\u5b88\u62a4\u4eba&#xff0c;\u95ee\u4e00\u53e5&#xff1a;\u201c\u6c5f\u6e56\u8fd9\u4e48\u8fdc&#xff0c;\u4f60\u4ece\u54ea\u91cc\u6765&#xff1f;\u201d<\/p>\n<p>\u9879\u76ee\u5730\u5740&#xff1a;https:\/\/gitcode.com\/Zch070214\/FEIYI<\/p>\n<p>\u6700\u540e&#xff0c;\u501f\u4e00\u53e5\u5728\u6c11\u95f4\u5e7f\u4e3a\u6d41\u4f20\u7684\u8001\u8bdd\u4f5c\u7ed3\u2014\u2014\u201c\u624b\u827a\u4eba&#xff0c;\u5b88\u827a\u4eba\u4e5f\u3002\u201d \u5728\u7801\u9053\u4e0a&#xff0c;\u613f\u6211\u4eec\u90fd\u80fd\u6210\u4e3a\u65b0\u4e00\u4ee3\u7684\u5b88\u827a\u4eba\u3002<\/p>\n<h3>\u9644\u5f55\u4e00&#xff1a;\u4e09\u5206\u949f\u8dd1\u8d77\u6765<\/h3>\n<p>\u62ff\u5230\u4ee3\u7801\u4e4b\u540e&#xff0c;\u6700\u5feb\u7684\u65b9\u5f0f\u6709\u4e24\u79cd\u3002<\/p>\n<p>\u65b9\u5f0f\u4e00&#xff1a;\u76f4\u63a5\u6253\u5f00\u3002 \u4f7f\u7528\u6700\u65b0\u7248\u7684 Chrome\u3001Edge \u6216 Firefox \u6d4f\u89c8\u5668&#xff0c;\u53cc\u51fb index.html \u5373\u53ef\u3002\u9875\u9762\u4f1a\u81ea\u52a8\u643a\u5e26\u5bc6\u94a5\u5411\u4e91\u7aef API \u53d1\u8d77\u8bf7\u6c42&#xff0c;\u9002\u5408\u5feb\u901f\u4f53\u9a8c\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f&#xff0c;\u90e8\u5206\u6d4f\u89c8\u5668\u5bf9 file:\/\/ \u534f\u8bae\u4e0b\u7684\u7f51\u7edc\u8bf7\u6c42\u6709\u66f4\u4e25\u683c\u7684\u9650\u5236&#xff0c;\u82e5\u9047\u5230\u8de8\u57df\u6216\u8bf7\u6c42\u5931\u8d25&#xff0c;\u5efa\u8bae\u6539\u7528\u672c\u5730\u670d\u52a1\u5668\u65b9\u5f0f\u3002<\/p>\n<p>\u65b9\u5f0f\u4e8c&#xff1a;\u672c\u5730\u670d\u52a1\u5668\u3002 \u9879\u76ee\u9644\u5e26\u4e86\u4e00\u4e2a\u56db\u5341\u884c\u5de6\u53f3\u7684\u96f6\u4f9d\u8d56\u9759\u6001\u670d\u52a1\u5668\u811a\u672c&#xff1a;<\/p>\n<p><span class=\"token function\">node<\/span> scripts\/serve.js<\/p>\n<p>\u7136\u540e\u8bbf\u95ee http:\/\/127.0.0.1:8642\u3002\u672c\u5730\u670d\u52a1\u5668\u65b9\u5f0f\u6700\u63a5\u8fd1\u751f\u4ea7\u73af\u5883&#xff0c;\u4e5f\u4fbf\u4e8e\u8c03\u8bd5\u3002\u5c06\u8be5\u76ee\u5f55\u6574\u4f53\u4e0a\u4f20\u5230\u4efb\u610f\u9759\u6001\u6258\u7ba1\u5e73\u53f0&#xff08;\u5982 GitCode Pages\u3001Nginx\u3001\u5bf9\u8c61\u5b58\u50a8&#xff09;\u540c\u6837\u53ef\u4ee5\u76f4\u63a5\u8fd0\u884c&#xff0c;\u56e0\u4e3a\u672c\u9879\u76ee\u6ca1\u6709\u540e\u7aef\u3001\u6ca1\u6709\u6784\u5efa\u6b65\u9aa4&#xff0c;\u5168\u4ed3\u5e93\u90fd\u662f\u7eaf\u9759\u6001\u4ea7\u7269\u3002<\/p>\n<h3>\u9644\u5f55\u4e8c&#xff1a;\u914d\u7f6e\u4e0e\u66ff\u6362<\/h3>\n<p>\u6240\u6709\u914d\u7f6e\u90fd\u6536\u62e2\u5728 js\/config.js \u4e00\u4e2a\u6587\u4ef6\u91cc&#xff0c;\u6309\u9700\u4fee\u6539\u5373\u53ef&#xff1a;<\/p>\n<ul>\n<li>API_URL&#xff1a;\u9ed8\u8ba4\u6307\u5411 GitCode AI \u7684\u804a\u5929\u8865\u5168\u63a5\u53e3&#xff0c;\u82e5\u5207\u6362\u5230\u5176\u4ed6\u517c\u5bb9 OpenAI \u98ce\u683c\u7684\u7f51\u5173&#xff0c;\u53ea\u9700\u66ff\u6362\u6b64\u5730\u5740&#xff1b;<\/li>\n<li>API_KEY&#xff1a;\u66ff\u6362\u4e3a\u4f60\u81ea\u5df1\u7684\u4ee4\u724c&#xff1b;<\/li>\n<li>MODEL&#xff1a;\u9ed8\u8ba4 deepseek-ai\/DeepSeek-V4-Flash&#xff1b;<\/li>\n<li>MAX_TOKENS\u3001TEMPERATURE\u3001TOP_P\u3001FREQUENCY_PENALTY \u4e0e THINKING_BUDGET&#xff1a;\u751f\u6210\u53c2\u6570&#xff0c;\u4e0e\u53c2\u8003\u4ee3\u7801\u4e00\u4e00\u5bf9\u5e94\u3002<\/li>\n<\/ul>\n<p>\u66ff\u6362\u5b8c\u6210\u540e&#xff0c;Ctrl &#043; F5 \u5f3a\u5236\u5237\u65b0\u5373\u53ef\u751f\u6548\u3002\u82e5\u5e0c\u671b\u66f4\u6362\u89d2\u8272\u8bbe\u5b9a&#xff0c;\u76f4\u63a5\u4fee\u6539 AI_SYSTEM_PROMPT \u5b57\u7b26\u4e32\u2014\u2014\u628a&#034;\u975e\u9057\u5b88\u62a4\u4eba&#034;\u6362\u6210&#034;\u8336\u6587\u5316\u5bfc\u5e08&#034;\u201c\u53e4\u5efa\u8bb2\u89e3\u5458\u201d&#xff0c;\u524d\u7aef\u65e0\u9700\u4efb\u4f55\u6539\u52a8&#xff0c;\u56e0\u4e3a\u6e32\u67d3\u5951\u7ea6\u662f\u901a\u7528\u7684\u3002<\/p>\n<h3>\u9644\u5f55\u4e09&#xff1a;\u5e38\u89c1\u95ee\u9898<\/h3>\n<p>\u95ee&#xff1a;\u4e3a\u4ec0\u4e48\u56de\u590d\u6709\u65f6\u662f\u7eaf\u6587\u672c&#xff0c;\u6ca1\u6709\u5361\u7247&#xff1f; \u7b54&#xff1a;\u7cfb\u7edf\u63d0\u793a\u8bcd\u89c4\u5b9a&#xff0c;\u4ec5\u5f53\u56de\u590d\u786e\u5b9e\u6d89\u53ca\u5177\u4f53\u975e\u9057\u9879\u76ee\u65f6\u624d\u8f93\u51fa related \u5361\u7247&#xff1b;\u5bd2\u6684\u7c7b\u3001\u79d1\u666e\u7c7b\u56de\u590d\u4f1a\u8fd4\u56de\u7a7a\u6570\u7ec4\u3002\u8fd9\u662f\u523b\u610f\u7684\u8bbe\u8ba1&#xff0c;\u907f\u514d&#034;\u786c\u585e\u5361\u7247&#034;\u7834\u574f\u5bf9\u8bdd\u81ea\u7136\u611f\u3002\u82e5\u4f60\u5e0c\u671b\u4efb\u4f55\u56de\u590d\u90fd\u5e26\u5361\u7247\u8c03\u6574\u5b57\u6bb5\u5373\u53ef\u3002<\/p>\n<p>\u95ee&#xff1a;\u5bc6\u94a5\u5199\u5728\u6d4f\u89c8\u5668\u91cc\u5b89\u5168\u5417&#xff1f; \u7b54&#xff1a;\u7eaf\u524d\u7aef\u65b9\u6848\u4e0b\u5bc6\u94a5\u5bf9\u7528\u6237\u53ef\u89c1&#xff0c;\u8fd9\u662f\u53d6\u820d\u800c\u975e\u758f\u6f0f\u3002\u9762\u5411\u516c\u4f17\u7684\u5927\u89c4\u6a21\u90e8\u7f72&#xff0c;\u5efa\u8bae\u628a\u8bf7\u6c42\u653e\u5230\u540e\u7aef\u4ee3\u7406&#xff0c;\u7531\u670d\u52a1\u7aef\u6301\u6709\u5bc6\u94a5\u5e76\u505a\u9891\u63a7\u3001\u9274\u6743&#xff1b;\u4e2a\u4eba\u81ea\u7528\u6216\u6f14\u793a\u573a\u666f&#xff0c;\u76f4\u63a5\u66b4\u9732\u662f\u53ef\u63a5\u53d7\u7684\u3002<\/p>\n<p>\u95ee&#xff1a;\u4e3a\u4ec0\u4e48\u4e0d\u7528 Vue \u6216 React&#xff1f; \u7b54&#xff1a;\u672c\u9879\u76ee\u523b\u610f\u4fdd\u6301\u539f\u751f\u5b9e\u73b0&#xff0c;\u4e3a\u7684\u662f&#034;\u6bcf\u4e00\u884c\u90fd\u53ef\u8bfb\u3001\u6bcf\u4e00\u5904\u90fd\u53ef\u6539&#034;&#xff0c;\u540c\u65f6\u628a\u8fd0\u884c\u65f6\u4f53\u79ef\u538b\u7f29\u5230\u6781\u81f4\u3002\u5bf9\u4e8e\u5355\u9875\u5bf9\u8bdd\u5e94\u7528&#xff0c;\u539f\u751f DOM \u64cd\u4f5c\u5b8c\u5168\u591f\u7528&#xff1b;\u82e5\u672a\u6765\u4ea4\u4e92\u590d\u6742\u5ea6\u4e0a\u5347&#xff0c;\u8fc1\u79fb\u5230\u6846\u67b6\u65f6&#xff0c;api.js \u4e0e config.js \u7684\u804c\u8d23\u8fb9\u754c\u4e5f\u80fd\u65e0\u7f1d\u590d\u7528\u3002<\/p>\n<p>\u95ee&#xff1a;\u591a\u8f6e\u5bf9\u8bdd\u7684\u4e0a\u4e0b\u6587\u662f\u600e\u4e48\u7ef4\u62a4\u7684&#xff1f; \u7b54&#xff1a;\u524d\u7aef\u7ef4\u62a4\u4e00\u4e2a messages \u6570\u7ec4&#xff0c;system \u63d0\u793a\u8bcd\u6052\u5728\u9996\u4f4d&#xff0c;\u5176\u540e\u6309\u5e8f\u8ffd\u52a0\u7528\u6237\u4e0e\u52a9\u624b\u7684\u6d88\u606f&#xff0c;\u8d85\u51fa\u4e8c\u5341\u6761\u65f6\u81ea\u52a8\u4e22\u5f03\u6700\u65e7\u7684\u8f6e\u6b21&#xff0c;\u907f\u514d\u4e0a\u4e0b\u6587\u8d85\u957f\u3002\u6bcf\u6b21\u53d1\u9001\u65f6\u628a\u6574\u4e2a\u6570\u7ec4\u968f\u8bf7\u6c42\u5e26\u8fc7\u53bb&#xff0c;\u6a21\u578b\u636e\u6b64\u7406\u89e3\u5bf9\u8bdd\u8109\u7edc\u3002<\/p>\n<p>\u95ee&#xff1a;\u6a21\u578b\u5076\u5c14\u4e0d\u6309 JSON \u8fd4\u56de\u600e\u4e48\u529e&#xff1f; \u7b54&#xff1a;\u8fd9\u662f\u6240\u6709&#034;LLM \u5373\u540e\u7aef&#034;\u5e94\u7528\u7684\u5e38\u6001\u98ce\u9669\u3002\u6211\u4eec\u7684\u7b56\u7565\u662f&#034;\u63d0\u793a\u8bcd\u7ea6\u675f &#043; \u589e\u91cf\u89e3\u6790 &#043; \u53cc\u91cd\u91cd\u8bd5 &#043; \u7eaf\u6587\u672c\u515c\u5e95&#034;\u56db\u9053\u9632\u7ebf&#xff1a;\u5148\u5c3d\u91cf\u8ba9\u6a21\u578b\u6309\u5951\u7ea6\u8f93\u51fa&#xff1b;\u6d41\u5f0f\u9014\u4e2d\u5b9e\u65f6\u5c1d\u8bd5\u89e3\u6790&#xff1b;\u7ed3\u675f\u540e\u82e5\u4ecd\u5931\u8d25&#xff0c;\u5219\u7528\u5bbd\u677e\u6a21\u5f0f\u6293\u53d6\u4efb\u610f\u5b8c\u6574\u5bf9\u8c61&#xff1b;\u8fde\u5bf9\u8c61\u90fd\u6293\u4e0d\u5230\u65f6&#xff0c;\u628a\u539f\u59cb\u6587\u672c\u5f53\u4f5c\u666e\u901a\u56de\u590d\u6e32\u67d3\u3002\u7528\u6237\u5728\u4efb\u4f55\u60c5\u51b5\u4e0b\u90fd\u4e0d\u4f1a\u9762\u5bf9\u7a7a\u767d\u9875\u9762\u3002<\/p>\n<hr \/>\n<p>\u672c\u6587\u7531&#034;\u5bfb\u827a \u00b7 \u975e\u9057\u4ea4\u4e92\u5f0f\u5bf9\u8bdd\u5e73\u53f0&#034;\u9879\u76ee\u5f00\u53d1\u8fc7\u7a0b\u6574\u7406\u800c\u6210\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7801\u9053 \u00b7 \u5bfb\u827a\u2014\u2014\u4ece\u96f6\u6784\u5efa\\&#8221;\u975e\u9057\u4ea4\u4e92\u5f0f\u5bf9\u8bdd\u5e73\u53f0\\&#8221;\u7684\u5b8c\u6574\u5b9e\u8df5\u7528\u4e00\u884c\u884c\u4ee3\u7801&#xff0c;\u5728\u6570\u5b57\u4e16\u754c\u91cc\u4e3a\u5343\u5e74\u6280\u827a\u7559\u4e00\u76cf\u706f\u3002<br \/>\n\u2014\u2014 \u8bb0\\&#8221;\u5bfb\u827a \u00b7 \u975e\u9057\u4ea4\u4e92\u5f0f\u5bf9\u8bdd\u5e73\u53f0\\&#8221;\u7684\u8bde\u751f\u4ed3\u5e93\u5730\u5740&#xff1a;https:\/\/gitcode.com\/Zch070214\/FEIYI\u7801\u9053\u4ee3\u7801\u751f\u6210\u4e00\u3001\u5199\u5728\u524d\u9762&#xff1a;\u6211\u4eec\u4e3a\u4ec0\u4e48\u8981\u505a\u8fd9\u4ef6\u4e8b<br \/>\n\u4e2d\u56fd\u975e\u7269\u8d28\u6587\u5316\u9057\u4ea7\u6d69\u5982\u70df\u6d77\u3002\u636e\u6587\u5316\u548c\u65c5\u6e38\u90e8\u516c\u5e03\u7684\u6570\u636e&#xff0c;\u6211\u56fd\u5df2\u6709\u56fd\u5bb6\u7ea7\u975e\u7269\u8d28\u6587\u5316\u9057\u4ea7\u4ee3\u8868\u6027\u9879\u76ee\u4e00\u5343\u4e94\u767e\u4f59\u9879&#xff0c;\u6db5\u76d6\u6c11\u95f4\u6587\u5b66\u3001\u4f20\u7edf\u97f3\u4e50\u3001<\/p>\n","protected":false},"author":2,"featured_media":107568,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[1175,964],"topic":[],"class_list":["post-107570","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-css3","tag-html5"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u7801\u9053 \u00b7 \u5bfb\u827a\u2014\u2014\u4ece\u96f6\u6784\u5efa\u201c\u975e\u9057\u4ea4\u4e92\u5f0f\u5bf9\u8bdd\u5e73\u53f0\u201c\u7684\u5b8c\u6574\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/107570.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u7801\u9053 \u00b7 \u5bfb\u827a\u2014\u2014\u4ece\u96f6\u6784\u5efa\u201c\u975e\u9057\u4ea4\u4e92\u5f0f\u5bf9\u8bdd\u5e73\u53f0\u201c\u7684\u5b8c\u6574\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u7801\u9053 \u00b7 \u5bfb\u827a\u2014\u2014\u4ece\u96f6\u6784\u5efa&quot;\u975e\u9057\u4ea4\u4e92\u5f0f\u5bf9\u8bdd\u5e73\u53f0&quot;\u7684\u5b8c\u6574\u5b9e\u8df5\u7528\u4e00\u884c\u884c\u4ee3\u7801&#xff0c;\u5728\u6570\u5b57\u4e16\u754c\u91cc\u4e3a\u5343\u5e74\u6280\u827a\u7559\u4e00\u76cf\u706f\u3002 \u2014\u2014 \u8bb0&quot;\u5bfb\u827a \u00b7 \u975e\u9057\u4ea4\u4e92\u5f0f\u5bf9\u8bdd\u5e73\u53f0&quot;\u7684\u8bde\u751f\u4ed3\u5e93\u5730\u5740&#xff1a;https:\/\/gitcode.com\/Zch070214\/FEIYI\u7801\u9053\u4ee3\u7801\u751f\u6210\u4e00\u3001\u5199\u5728\u524d\u9762&#xff1a;\u6211\u4eec\u4e3a\u4ec0\u4e48\u8981\u505a\u8fd9\u4ef6\u4e8b \u4e2d\u56fd\u975e\u7269\u8d28\u6587\u5316\u9057\u4ea7\u6d69\u5982\u70df\u6d77\u3002\u636e\u6587\u5316\u548c\u65c5\u6e38\u90e8\u516c\u5e03\u7684\u6570\u636e&#xff0c;\u6211\u56fd\u5df2\u6709\u56fd\u5bb6\u7ea7\u975e\u7269\u8d28\u6587\u5316\u9057\u4ea7\u4ee3\u8868\u6027\u9879\u76ee\u4e00\u5343\u4e94\u767e\u4f59\u9879&#xff0c;\u6db5\u76d6\u6c11\u95f4\u6587\u5b66\u3001\u4f20\u7edf\u97f3\u4e50\u3001\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/107570.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-19T13:08:58+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260919130854-6aae8966cf123.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"13 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/107570.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/107570.html\",\"name\":\"\u7801\u9053 \u00b7 \u5bfb\u827a\u2014\u2014\u4ece\u96f6\u6784\u5efa\u201c\u975e\u9057\u4ea4\u4e92\u5f0f\u5bf9\u8bdd\u5e73\u53f0\u201c\u7684\u5b8c\u6574\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-19T13:08:58+00:00\",\"dateModified\":\"2026-09-19T13:08:58+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/107570.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/107570.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/107570.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u7801\u9053 \u00b7 \u5bfb\u827a\u2014\u2014\u4ece\u96f6\u6784\u5efa\u201c\u975e\u9057\u4ea4\u4e92\u5f0f\u5bf9\u8bdd\u5e73\u53f0\u201c\u7684\u5b8c\u6574\u5b9e\u8df5\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u7801\u9053 \u00b7 \u5bfb\u827a\u2014\u2014\u4ece\u96f6\u6784\u5efa\u201c\u975e\u9057\u4ea4\u4e92\u5f0f\u5bf9\u8bdd\u5e73\u53f0\u201c\u7684\u5b8c\u6574\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/107570.html","og_locale":"zh_CN","og_type":"article","og_title":"\u7801\u9053 \u00b7 \u5bfb\u827a\u2014\u2014\u4ece\u96f6\u6784\u5efa\u201c\u975e\u9057\u4ea4\u4e92\u5f0f\u5bf9\u8bdd\u5e73\u53f0\u201c\u7684\u5b8c\u6574\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u7801\u9053 \u00b7 \u5bfb\u827a\u2014\u2014\u4ece\u96f6\u6784\u5efa\"\u975e\u9057\u4ea4\u4e92\u5f0f\u5bf9\u8bdd\u5e73\u53f0\"\u7684\u5b8c\u6574\u5b9e\u8df5\u7528\u4e00\u884c\u884c\u4ee3\u7801&#xff0c;\u5728\u6570\u5b57\u4e16\u754c\u91cc\u4e3a\u5343\u5e74\u6280\u827a\u7559\u4e00\u76cf\u706f\u3002 \u2014\u2014 \u8bb0\"\u5bfb\u827a \u00b7 \u975e\u9057\u4ea4\u4e92\u5f0f\u5bf9\u8bdd\u5e73\u53f0\"\u7684\u8bde\u751f\u4ed3\u5e93\u5730\u5740&#xff1a;https:\/\/gitcode.com\/Zch070214\/FEIYI\u7801\u9053\u4ee3\u7801\u751f\u6210\u4e00\u3001\u5199\u5728\u524d\u9762&#xff1a;\u6211\u4eec\u4e3a\u4ec0\u4e48\u8981\u505a\u8fd9\u4ef6\u4e8b \u4e2d\u56fd\u975e\u7269\u8d28\u6587\u5316\u9057\u4ea7\u6d69\u5982\u70df\u6d77\u3002\u636e\u6587\u5316\u548c\u65c5\u6e38\u90e8\u516c\u5e03\u7684\u6570\u636e&#xff0c;\u6211\u56fd\u5df2\u6709\u56fd\u5bb6\u7ea7\u975e\u7269\u8d28\u6587\u5316\u9057\u4ea7\u4ee3\u8868\u6027\u9879\u76ee\u4e00\u5343\u4e94\u767e\u4f59\u9879&#xff0c;\u6db5\u76d6\u6c11\u95f4\u6587\u5b66\u3001\u4f20\u7edf\u97f3\u4e50\u3001","og_url":"https:\/\/www.wsisp.com\/helps\/107570.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-19T13:08:58+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260919130854-6aae8966cf123.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"13 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/107570.html","url":"https:\/\/www.wsisp.com\/helps\/107570.html","name":"\u7801\u9053 \u00b7 \u5bfb\u827a\u2014\u2014\u4ece\u96f6\u6784\u5efa\u201c\u975e\u9057\u4ea4\u4e92\u5f0f\u5bf9\u8bdd\u5e73\u53f0\u201c\u7684\u5b8c\u6574\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-19T13:08:58+00:00","dateModified":"2026-09-19T13:08:58+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/107570.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/107570.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/107570.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u7801\u9053 \u00b7 \u5bfb\u827a\u2014\u2014\u4ece\u96f6\u6784\u5efa\u201c\u975e\u9057\u4ea4\u4e92\u5f0f\u5bf9\u8bdd\u5e73\u53f0\u201c\u7684\u5b8c\u6574\u5b9e\u8df5"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/107570","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=107570"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/107570\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/107568"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=107570"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=107570"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=107570"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=107570"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}