{"id":3574,"date":"2026-08-15T20:10:10","date_gmt":"2026-08-15T12:10:10","guid":{"rendered":"http:\/\/ai.zhousir.top\/?p=3574"},"modified":"2026-08-16T10:03:08","modified_gmt":"2026-08-16T02:03:08","slug":"ai%e5%a4%a7%e6%a8%a1%e5%9e%8b%e5%bc%80%e5%8f%91%e4%bb%8eopenai%e8%b0%83%e7%94%a8%e5%bc%80%e5%a7%8b","status":"publish","type":"post","link":"https:\/\/ai.zhousir.top\/?p=3574","title":{"rendered":"AI\u5927\u6a21\u578b\u5f00\u53d1\u4eceOpenAI\u8c03\u7528\u5f00\u59cb"},"content":{"rendered":"<section id=\"wenyan\" data-provider=\"WenYan\" style=\"font-family: system-ui, &quot;Apple Color Emoji&quot;, &quot;Segoe UI&quot;, &quot;Segoe UI Symbol&quot;, &quot;Noto Sans&quot;, Roboto, sans-serif; line-height: 1.75; font-size: 16px; color: rgb(0, 0, 0); caret-color: rgb(0, 0, 0);\">\n<h2 style=\"padding: 1px 12.5px; color: rgb(255, 255, 255); margin: 1.2em 0px 1em; border-radius: 4px; display: inline-block; background-color: rgb(72, 112, 172); font-size: 1.3em;\"><span>\u5f15\u8a00<\/span><\/h2>\n<p style=\"margin: 1em 0px;\">\u5c0f\u660e\u7684\u8001\u677f\u4e0a\u5468\u4e22\u7ed9\u4ed6\u4e00\u4e2a\u4efb\u52a1\uff1a&#8221;\u54b1\u4eec\u7684\u5ba2\u670d\u7cfb\u7edf\u592a\u62c9\u4e86\uff0c\u7528\u6237\u95ee\u534a\u5929\u6ca1\u4eba\u56de\uff0c\u4f60\u641e\u4e2a AI \u5ba2\u670d\u51fa\u6765\uff0c\u4e0b\u5468\u4e0a\u7ebf\u3002&#8221;<\/p>\n<p style=\"margin: 1em 0px;\">\u5c0f\u660e\u614c\u4e86\u3002AI\uff1f\u5927\u6a21\u578b\uff1f\u4ed6\u53ea\u5728\u65b0\u95fb\u91cc\u89c1\u8fc7\u2014\u2014&#8221;ChatGPT \u53c8\u5347\u7ea7\u4e86&#8221;&#8221;\u67d0\u67d0\u5927\u5382\u53d1\u5e03\u5343\u4ebf\u53c2\u6570\u6a21\u578b&#8221;&#8221;AI \u66ff\u4ee3\u7a0b\u5e8f\u5458\u8fd8\u8981\u591a\u4e45&#8221;\u3002\u53ef\u771f\u8f6e\u5230\u4e0a\u624b\uff0c\u8111\u5b50\u4e00\u7247\u7a7a\u767d\u3002<\/p>\n<p style=\"margin: 1em 0px;\">\u4ed6\u627e\u5230\u7ec4\u91cc\u7684\u8001\u5f20\u6c42\u6551\u3002\u8001\u5f20\u5e72\u4e86\u5341\u5e74\u540e\u7aef\uff0c\u542c\u4e86\u53ea\u8bf4\u4e86\u4e00\u53e5\u8bdd\uff1a<\/p>\n<p style=\"margin: 1em 0px;\"><strong style=\"color: rgb(72, 112, 172);\">&#8220;\u522b\u7ba1\u90a3\u4e9b\u6982\u5ff5\u3002\u8c03\u4e2a API\uff0c\u62ff\u5230\u56de\u590d\uff0c\u5c31\u7b97\u5165\u95e8\u3002&#8221;<\/strong><\/p>\n<p style=\"margin: 1em 0px;\">\u4e8e\u662f\u8001\u5f20\u5e26\u7740\u5c0f\u660e\uff0c\u4ece\u96f6\u5f00\u59cb\uff0c30 \u884c\u4ee3\u7801\u8dd1\u901a\u4e86\u7b2c\u4e00\u6b21\u5927\u6a21\u578b\u8c03\u7528\u3002\u5c0f\u660e\u540e\u6765\u8ddf\u6211\u8bf4\uff0c\u90a3\u4e00\u523b\u4ed6\u624d\u771f\u6b63\u660e\u767d\u2014\u2014\u5927\u6a21\u578b\u5f00\u53d1\u6ca1\u90a3\u4e48\u7384\u4e4e\uff0c\u5c31\u8ddf\u4f60\u8c03\u5fae\u4fe1\u652f\u4ed8\u63a5\u53e3\u3001\u8c03\u77ed\u4fe1\u63a5\u53e3\u4e00\u6837\uff0c\u672c\u8d28\u4e0a\u90fd\u662f\u5728\u8c03 API\u3002<\/p>\n<p style=\"margin: 1em 0px;\">\u8fd9\u7bc7\u6587\u7ae0\uff0c\u5c31\u662f\u628a\u8001\u5f20\u5e26\u5c0f\u660e\u7684\u8fc7\u7a0b\u5199\u4e0b\u6765\u3002\u4e0d\u8c08\u539f\u7406\uff0c\u53ea\u8bb2\u600e\u4e48\u52a8\u624b\u3002<\/p>\n<h2 style=\"padding: 1px 12.5px; color: rgb(255, 255, 255); margin: 1.2em 0px 1em; border-radius: 4px; display: inline-block; background-color: rgb(72, 112, 172); font-size: 1.3em;\"><span>\u4e3a\u4ec0\u4e48\u4ece OpenAI \u63a5\u53e3\u5f00\u59cb<\/span><\/h2>\n<p style=\"margin: 1em 0px;\">\u5c0f\u660e\u7b2c\u4e00\u4e2a\u95ee\u9898\u662f\uff1a&#8221;\u6211\u53c8\u4e0d\u7528 ChatGPT\uff0c\u4e3a\u4ec0\u4e48\u8981\u5b66 OpenAI \u7684\u63a5\u53e3\uff1f&#8221;<\/p>\n<p style=\"margin: 1em 0px;\">\u8001\u5f20\u6253\u5f00\u6d4f\u89c8\u5668\uff0c\u7ed9\u4ed6\u770b\u4e86\u5f20\u8868\uff1a<\/p>\n<ul style=\"padding-left: 1rem; margin-left: 1rem; font-size: 0.9rem; list-style-type: disc;\">\n<li>\n<section><strong style=\"color: rgb(72, 112, 172);\">\u963f\u91cc\u901a\u4e49\u5343\u95ee<\/strong> \u2014 \u5b98\u65b9\u63d0\u4f9b <code>compatible-mode<\/code> \u7aef\u70b9\uff0c\u5b8c\u5168\u517c\u5bb9 OpenAI \u683c\u5f0f<\/section>\n<\/li>\n<li>\n<section><strong style=\"color: rgb(72, 112, 172);\">DeepSeek<\/strong> \u2014 \u63a5\u53e3\u683c\u5f0f\u8ddf OpenAI \u4e00\u6a21\u4e00\u6837<\/section>\n<\/li>\n<li>\n<section><strong style=\"color: rgb(72, 112, 172);\">\u667a\u8c31 GLM<\/strong> \u2014 \u5b98\u65b9 SDK \u5bf9\u63a5\u7684\u5c31\u662f OpenAI \u683c\u5f0f<\/section>\n<\/li>\n<li>\n<section><strong style=\"color: rgb(72, 112, 172);\">\u6708\u4e4b\u6697\u9762 Kimi<\/strong> \u2014 \u540c\u4e0a<\/section>\n<\/li>\n<li>\n<section><strong style=\"color: rgb(72, 112, 172);\">\u767e\u5ea6\u6587\u5fc3\u4e00\u8a00<\/strong> \u2014 \u540c\u4e0a<\/section>\n<\/li>\n<li>\n<section><strong style=\"color: rgb(72, 112, 172);\">\u5b57\u8282\u8c46\u5305<\/strong> \u2014 \u706b\u5c71\u5f15\u64ce\u63d0\u4f9b\u517c\u5bb9\u6a21\u5f0f<\/section>\n<\/li>\n<\/ul>\n<p style=\"margin: 1em 0px;\">&#8220;\u770b\u89c1\u4e86\u6ca1\uff1f&#8221;\u8001\u5f20\u8bf4\uff0c&#8221;OpenAI \u7684\u63a5\u53e3\u683c\u5f0f\u5df2\u7ecf\u662f\u5168\u884c\u4e1a\u7684\u6807\u51c6\u3002\u4f60\u5b66\u4f1a\u8fd9\u4e00\u5957\uff0c\u6362\u54ea\u4e2a\u5e73\u53f0\u90fd\u53ea\u9700\u8981\u6539\u4e24\u884c\u914d\u7f6e\u2014\u2014API \u5730\u5740\u548c\u5bc6\u94a5\u3002\u5c31\u8ddf\u4f60\u4f1a\u5f00\u5927\u4f17\u5c31\u4f1a\u5f00\u4e30\u7530\u4e00\u6837\u3002&#8221;<\/p>\n<p style=\"margin: 1em 0px;\">\u5c0f\u660e\u8fd9\u4e0b\u61c2\u4e86\u3002\u4e0d\u662f\u975e\u5f97\u7528 OpenAI\uff0c\u662f\u5b66\u4e00\u5957\u901a\u7528\u7684\u8c03\u7528\u8303\u5f0f\u3002<\/p>\n<h2 style=\"padding: 1px 12.5px; color: rgb(255, 255, 255); margin: 1.2em 0px 1em; border-radius: 4px; display: inline-block; background-color: rgb(72, 112, 172); font-size: 1.3em;\"><span>\u628a\u73af\u5883\u642d\u8d77\u6765<\/span><\/h2>\n<p style=\"margin: 1em 0px;\">\u8001\u5f20\u8ba9\u5c0f\u660e\u5148\u88c5\u4e24\u4e2a\u5305\uff1a<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 12px; background: rgb(0, 43, 54); max-width: 100%; overflow-wrap: normal;\"><section style=\"display: block; background-repeat: no-repeat; width: 100%; height: 16px;\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" version=\"1.1\" width=\"45\" height=\"12\" viewBox=\"0 0 450 130\"><ellipse cx=\"65\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(220,60,54)\" stroke-width=\"2\" fill=\"rgb(237,108,96)\"><\/ellipse><ellipse cx=\"225\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(218,151,33)\" stroke-width=\"2\" fill=\"rgb(247,193,81)\"><\/ellipse><ellipse cx=\"385\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(27,161,37)\" stroke-width=\"2\" fill=\"rgb(100,200,86)\"><\/ellipse><\/svg><\/section><code class=\"hljs language-bash\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; display: block; overflow-x: auto; margin: 0.5em; padding: 3px 5px; color: rgb(147, 161, 161); background: rgb(0, 43, 54); overflow-wrap: normal;\">pip install openai python-dotenv\n<\/code><\/pre>\n<ul style=\"padding-left: 1rem; margin-left: 1rem; font-size: 0.9rem; list-style-type: disc;\">\n<li>\n<section><code>openai<\/code> \u2014 \u5b98\u65b9 Python SDK\uff0c\u6240\u6709\u517c\u5bb9\u7684\u5e73\u53f0\u90fd\u80fd\u7528<\/section>\n<\/li>\n<li>\n<section><code>python-dotenv<\/code> \u2014 \u4ece <code>.env<\/code> \u6587\u4ef6\u8bfb\u914d\u7f6e\uff0c\u907f\u514d\u628a\u5bc6\u94a5\u5199\u6b7b\u5728\u4ee3\u7801\u91cc<\/section>\n<\/li>\n<\/ul>\n<p style=\"margin: 1em 0px;\">\u7136\u540e\u521b\u5efa <code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; color: rgb(72, 112, 172); font-size: 0.9em; font-weight: normal; overflow-wrap: break-word; padding: 2px 4px; border-radius: 3px; margin: 2px; background-color: rgb(246, 248, 250); word-break: break-all;\">.env<\/code> \u6587\u4ef6\u653e\u5bc6\u94a5\uff1a<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 12px; background: rgb(0, 43, 54); max-width: 100%; overflow-wrap: normal;\"><section style=\"display: block; background-repeat: no-repeat; width: 100%; height: 16px;\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" version=\"1.1\" width=\"45\" height=\"12\" viewBox=\"0 0 450 130\"><ellipse cx=\"65\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(220,60,54)\" stroke-width=\"2\" fill=\"rgb(237,108,96)\"><\/ellipse><ellipse cx=\"225\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(218,151,33)\" stroke-width=\"2\" fill=\"rgb(247,193,81)\"><\/ellipse><ellipse cx=\"385\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(27,161,37)\" stroke-width=\"2\" fill=\"rgb(100,200,86)\"><\/ellipse><\/svg><\/section><code class=\"hljs language-env\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; display: block; overflow-x: auto; margin: 0.5em; padding: 3px 5px; color: rgb(147, 161, 161); background: rgb(0, 43, 54); overflow-wrap: normal;\">LLM_BASE_URL=https:\/\/dashscope.aliyuncs.com\/compatible-mode\/v1\nLLM_API_KEY=sk-xxxxxxxxxxxxxxxxxxxx\nLLM_MODEL_ID=qwen-plus\n<\/code><\/pre>\n<p style=\"margin: 1em 0px;\"><strong style=\"color: rgb(72, 112, 172);\">\u6ce8\u610f\uff1a\u8fd9\u4e2a <code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; color: rgb(72, 112, 172); font-size: 0.9em; font-weight: normal; overflow-wrap: break-word; padding: 2px 4px; border-radius: 3px; margin: 2px; background-color: rgb(246, 248, 250); word-break: break-all;\">.env<\/code> \u6587\u4ef6\u5fc5\u987b\u52a0\u5165 <code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; color: rgb(72, 112, 172); font-size: 0.9em; font-weight: normal; overflow-wrap: break-word; padding: 2px 4px; border-radius: 3px; margin: 2px; background-color: rgb(246, 248, 250); word-break: break-all;\">.gitignore<\/code>\uff0c\u7edd\u5bf9\u4e0d\u80fd\u63d0\u4ea4\u5230 Git\u3002<\/strong> \u8001\u5f20\u7279\u522b\u5f3a\u8c03\u2014\u2014\u4ed6\u89c1\u8fc7\u592a\u591a\u4eba\u628a\u5bc6\u94a5\u4f20\u5230 GitHub\uff0c\u51e0\u5206\u949f\u5c31\u88ab\u722c\u866b\u626b\u8d70\uff0c\u8d26\u5355\u8dd1\u51fa\u51e0\u4e07\u5757\u3002<\/p>\n<p style=\"margin: 1em 0px;\">\u5c0f\u660e\u95ee\uff1a&#8221;\u90a3\u6211\u8981\u7528 DeepSeek \u600e\u4e48\u529e\uff1f&#8221;<\/p>\n<p style=\"margin: 1em 0px;\">\u8001\u5f20\u53c8\u5217\u4e86\u5f20\u8868\uff1a<\/p>\n<table style=\"display: table; text-align: left; overflow: auto; border-collapse: collapse; margin: 1.4em auto; max-width: 100%; table-layout: fixed; overflow-wrap: break-word; word-break: break-all;\">\n<thead>\n<tr>\n<th align=\"left\" style=\"border: 1px solid rgb(217, 223, 228); padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top; text-align: center; font-weight: bold; color: rgb(72, 112, 172); background: rgb(247, 247, 247);\">\u5e73\u53f0<\/th>\n<th align=\"left\" style=\"border: 1px solid rgb(217, 223, 228); padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top; text-align: center; font-weight: bold; color: rgb(72, 112, 172); background: rgb(247, 247, 247);\">LLM_BASE_URL<\/th>\n<th align=\"left\" style=\"border: 1px solid rgb(217, 223, 228); padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top; text-align: center; font-weight: bold; color: rgb(72, 112, 172); background: rgb(247, 247, 247);\">LLM_MODEL_ID<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td align=\"left\" style=\"border: 1px solid rgb(217, 223, 228); padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\">\u963f\u91cc\u901a\u4e49\u5343\u95ee<\/td>\n<td align=\"left\" style=\"border: 1px solid rgb(217, 223, 228); padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\"><code>https:\/\/dashscope.aliyuncs.com\/compatible-mode\/v1<\/code><\/td>\n<td align=\"left\" style=\"border: 1px solid rgb(217, 223, 228); padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\"><code>qwen-plus<\/code><\/td>\n<\/tr>\n<tr>\n<td align=\"left\" style=\"border: 1px solid rgb(217, 223, 228); padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\">DeepSeek<\/td>\n<td align=\"left\" style=\"border: 1px solid rgb(217, 223, 228); padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\"><code>https:\/\/api.deepseek.com\/v1<\/code><\/td>\n<td align=\"left\" style=\"border: 1px solid rgb(217, 223, 228); padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\"><code>deepseek-chat<\/code><\/td>\n<\/tr>\n<tr>\n<td align=\"left\" style=\"border: 1px solid rgb(217, 223, 228); padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\">\u667a\u8c31 GLM<\/td>\n<td align=\"left\" style=\"border: 1px solid rgb(217, 223, 228); padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\"><code>https:\/\/open.bigmodel.cn\/api\/paas\/v4<\/code><\/td>\n<td align=\"left\" style=\"border: 1px solid rgb(217, 223, 228); padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\"><code>glm-4<\/code><\/td>\n<\/tr>\n<tr>\n<td align=\"left\" style=\"border: 1px solid rgb(217, 223, 228); padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\">\u6708\u4e4b\u6697\u9762 Kimi<\/td>\n<td align=\"left\" style=\"border: 1px solid rgb(217, 223, 228); padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\"><code>https:\/\/api.moonshot.cn\/v1<\/code><\/td>\n<td align=\"left\" style=\"border: 1px solid rgb(217, 223, 228); padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\"><code>moonshot-v1-8k<\/code><\/td>\n<\/tr>\n<tr>\n<td align=\"left\" style=\"border: 1px solid rgb(217, 223, 228); padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\">OpenAI \u5b98\u65b9<\/td>\n<td align=\"left\" style=\"border: 1px solid rgb(217, 223, 228); padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\"><code>https:\/\/api.openai.com\/v1<\/code><\/td>\n<td align=\"left\" style=\"border: 1px solid rgb(217, 223, 228); padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\"><code>gpt-4o<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin: 1em 0px;\">&#8220;\u6362\u5e73\u53f0\u5c31\u6539\u8fd9\u4e24\u4e2a\u503c\uff0c\u4ee3\u7801\u4e00\u884c\u4e0d\u7528\u52a8\u3002\u8fd9\u5c31\u662f\u5b66 OpenAI \u683c\u5f0f\u7684\u597d\u5904\u3002&#8221;<\/p>\n<h2 style=\"padding: 1px 12.5px; color: rgb(255, 255, 255); margin: 1.2em 0px 1em; border-radius: 4px; display: inline-block; background-color: rgb(72, 112, 172); font-size: 1.3em;\"><span>\u5199\u4e2a\u914d\u7f6e\u6a21\u5757<\/span><\/h2>\n<p style=\"margin: 1em 0px;\">\u8001\u5f20\u8bf4\uff1a&#8221;\u597d\u7684\u4e60\u60ef\u4ece\u7b2c\u4e00\u5929\u5c31\u8981\u517b\u6210\u2014\u2014\u914d\u7f6e\u548c\u4e1a\u52a1\u903b\u8f91\u5206\u5f00\u3002&#8221;<\/p>\n<p style=\"margin: 1em 0px;\">\u4ed6\u8ba9\u5c0f\u660e\u521b\u5efa <code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; color: rgb(72, 112, 172); font-size: 0.9em; font-weight: normal; overflow-wrap: break-word; padding: 2px 4px; border-radius: 3px; margin: 2px; background-color: rgb(246, 248, 250); word-break: break-all;\">config.py<\/code>\uff1a<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 12px; background: rgb(0, 43, 54); max-width: 100%; overflow-wrap: normal;\"><section style=\"display: block; background-repeat: no-repeat; width: 100%; height: 16px;\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" version=\"1.1\" width=\"45\" height=\"12\" viewBox=\"0 0 450 130\"><ellipse cx=\"65\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(220,60,54)\" stroke-width=\"2\" fill=\"rgb(237,108,96)\"><\/ellipse><ellipse cx=\"225\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(218,151,33)\" stroke-width=\"2\" fill=\"rgb(247,193,81)\"><\/ellipse><ellipse cx=\"385\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(27,161,37)\" stroke-width=\"2\" fill=\"rgb(100,200,86)\"><\/ellipse><\/svg><\/section><code class=\"hljs language-python\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; display: block; overflow-x: auto; margin: 0.5em; padding: 3px 5px; color: rgb(147, 161, 161); background: rgb(0, 43, 54); overflow-wrap: normal;\"><span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"\"\"API \u4e0e\u6a21\u578b\u914d\u7f6e\uff08\u5bc6\u94a5\u8bf7\u7528\u73af\u5883\u53d8\u91cf\u6ce8\u5165\uff09\u3002\"\"\"<\/span>\n\n<span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">import<\/span> os\n<span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">from<\/span> dotenv <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">import<\/span> load_dotenv\n<span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">from<\/span> openai <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">import<\/span> OpenAI\n\nload_dotenv()\n\nMODEL = os.getenv(<span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"LLM_MODEL_ID\"<\/span>, <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"qwen-plus\"<\/span>)\nLLM_BASE_URL = os.getenv(\n  <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"LLM_BASE_URL\"<\/span>,\n  <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"https:\/\/dashscope.aliyuncs.com\/compatible-mode\/v1\"<\/span>,\n)\n\n<span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">def<\/span> <span class=\"hljs-title function_\" style=\"color: rgb(38, 139, 210);\">get_client<\/span>() -&gt; OpenAI:\n  api_key = os.getenv(<span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"LLM_API_KEY\"<\/span>, <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"\"<\/span>).strip()\n  <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">if<\/span> <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">not<\/span> api_key:\n    <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">raise<\/span> RuntimeError(<span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"\u672a\u914d\u7f6e LLM_API_KEY\uff0c\u8bf7\u68c0\u67e5 .env \u6587\u4ef6\u3002\"<\/span>)\n  <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">return<\/span> OpenAI(api_key=api_key, base_url=LLM_BASE_URL)\n<\/code><\/pre>\n<p style=\"margin: 1em 0px;\">\u8001\u5f20\u6307\u7740\u4ee3\u7801\u9010\u884c\u89e3\u91ca\uff1a<\/p>\n<ol style=\"padding-left: 1rem; margin-left: 1rem; font-size: 0.9rem; list-style-type: decimal;\">\n<li>\n<section><strong style=\"color: rgb(72, 112, 172);\"><code>load_dotenv()<\/code><\/strong> \u2014 \u628a <code>.env<\/code> \u91cc\u7684\u914d\u7f6e\u52a0\u8f7d\u5230\u73af\u5883\u53d8\u91cf\uff0c<code>os.getenv()<\/code> \u624d\u80fd\u8bfb\u5230<\/section>\n<\/li>\n<li>\n<section><strong style=\"color: rgb(72, 112, 172);\"><code>MODEL<\/code><\/strong> \u2014 \u6a21\u578b\u540d\uff0c\u4e0d\u540c\u5e73\u53f0\u4e0d\u540c\uff0c\u6539 <code>.env<\/code> \u5c31\u884c<\/section>\n<\/li>\n<li>\n<section><strong style=\"color: rgb(72, 112, 172);\"><code>LLM_BASE_URL<\/code><\/strong> \u2014 API \u5730\u5740\uff0c\u6307\u5411\u54ea\u5bb6\u5c31\u8c03\u54ea\u5bb6<\/section>\n<\/li>\n<li>\n<section><strong style=\"color: rgb(72, 112, 172);\"><code>get_client()<\/code><\/strong> \u2014 \u521b\u5efa\u4e00\u4e2a\u914d\u7f6e\u597d\u7684\u5ba2\u6237\u7aef\u3002\u5bc6\u94a5\u4e3a\u7a7a\u76f4\u63a5\u62a5\u9519\uff0c\u522b\u7b49\u5230\u7f51\u7edc\u8bf7\u6c42\u624d\u70b8\uff0c\u65e9\u62a5\u9519\u65e9\u89e3\u51b3<\/section>\n<\/li>\n<\/ol>\n<p style=\"margin: 1em 0px;\">&#8220;\u8fd9\u4e2a <code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; color: rgb(72, 112, 172); font-size: 0.9em; font-weight: normal; overflow-wrap: break-word; padding: 2px 4px; border-radius: 3px; margin: 2px; background-color: rgb(246, 248, 250); word-break: break-all;\">get_client()<\/code> \u91cc\u7684\u5bc6\u94a5\u6821\u9a8c\uff0c\u53eb\u9632\u5fa1\u6027\u7f16\u7a0b\u3002&#8221;\u8001\u5f20\u8bf4\uff0c&#8221;\u5931\u8d25\u65e9\u70b9\u62a5\uff0c\u522b\u8ba9\u4eba\u7b49\u5230 timeout\u3002&#8221;<\/p>\n<h2 style=\"padding: 1px 12.5px; color: rgb(255, 255, 255); margin: 1.2em 0px 1em; border-radius: 4px; display: inline-block; background-color: rgb(72, 112, 172); font-size: 1.3em;\"><span>30 \u884c\u4ee3\u7801\uff0c\u7b2c\u4e00\u6b21\u8c03\u901a<\/span><\/h2>\n<p style=\"margin: 1em 0px;\">\u914d\u7f6e\u597d\u4e86\uff0c\u8001\u5f20\u8ba9\u5c0f\u660e\u521b\u5efa <code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; color: rgb(72, 112, 172); font-size: 0.9em; font-weight: normal; overflow-wrap: break-word; padding: 2px 4px; border-radius: 3px; margin: 2px; background-color: rgb(246, 248, 250); word-break: break-all;\">main.py<\/code>\uff1a<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 12px; background: rgb(0, 43, 54); max-width: 100%; overflow-wrap: normal;\"><section style=\"display: block; background-repeat: no-repeat; width: 100%; height: 16px;\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" version=\"1.1\" width=\"45\" height=\"12\" viewBox=\"0 0 450 130\"><ellipse cx=\"65\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(220,60,54)\" stroke-width=\"2\" fill=\"rgb(237,108,96)\"><\/ellipse><ellipse cx=\"225\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(218,151,33)\" stroke-width=\"2\" fill=\"rgb(247,193,81)\"><\/ellipse><ellipse cx=\"385\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(27,161,37)\" stroke-width=\"2\" fill=\"rgb(100,200,86)\"><\/ellipse><\/svg><\/section><code class=\"hljs language-python\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; display: block; overflow-x: auto; margin: 0.5em; padding: 3px 5px; color: rgb(147, 161, 161); background: rgb(0, 43, 54); overflow-wrap: normal;\"><span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"\"\"\n\u7b2c\u4e00\u6b21\u8c03\u7528\u5927\u6a21\u578b API\uff08OpenAI \u517c\u5bb9\u63a5\u53e3\uff09\u3002\n\n\u8fd0\u884c\u65b9\u5f0f\uff1apython main.py\n\u524d\u63d0\uff1a\u9879\u76ee\u6839\u76ee\u5f55\u5df2\u914d\u7f6e .env \u6587\u4ef6\uff08\u542b LLM_BASE_URL \/ LLM_API_KEY \/ LLM_MODEL_ID\uff09\n\"\"\"<\/span>\n\n<span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">from<\/span> config <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">import<\/span> MODEL, get_client\n\n<span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">def<\/span> <span class=\"hljs-title function_\" style=\"color: rgb(38, 139, 210);\">main<\/span>() -&gt; <span class=\"hljs-literal\" style=\"color: rgb(203, 75, 22);\">None<\/span>:\n  client = get_client()\n  completion = client.chat.completions.create(\n    model=MODEL,\n    messages=[\n      {<span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"role\"<\/span>: <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"system\"<\/span>, <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"content\"<\/span>: <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"\u4f60\u662f\u4e00\u4e2a\u804a\u5929\u673a\u5668\u4eba\uff0c\u8bf7\u56de\u7b54\u7528\u6237\u7684\u95ee\u9898\u3002\"<\/span>},\n      {<span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"role\"<\/span>: <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"user\"<\/span>, <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"content\"<\/span>: <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"\u4f60\u662f\u8c01\uff1f\u8bf7\u4ecb\u7ecd\u4e00\u4e0b\u81ea\u5df1\u3002\"<\/span>},\n    ],\n    temperature=<span class=\"hljs-number\" style=\"color: rgb(203, 75, 22);\">0.7<\/span>,\n  )\n  <span class=\"hljs-built_in\" style=\"color: rgb(42, 161, 152);\">print<\/span>(completion.choices[<span class=\"hljs-number\" style=\"color: rgb(203, 75, 22);\">0<\/span>].message.content)\n  <span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">if<\/span> completion.usage:\n    <span class=\"hljs-built_in\" style=\"color: rgb(42, 161, 152);\">print<\/span>(<span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"---\"<\/span>)\n    <span class=\"hljs-built_in\" style=\"color: rgb(42, 161, 152);\">print<\/span>(<span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"\u6d88\u8017 tokens:\"<\/span>, completion.usage.total_tokens)\n\n<span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">if<\/span> __name__ == <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"__main__\"<\/span>:\n  main()\n<\/code><\/pre>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 12px; background: rgb(0, 43, 54); max-width: 100%; overflow-wrap: normal;\"><section style=\"display: block; background-repeat: no-repeat; width: 100%; height: 16px;\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" version=\"1.1\" width=\"45\" height=\"12\" viewBox=\"0 0 450 130\"><ellipse cx=\"65\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(220,60,54)\" stroke-width=\"2\" fill=\"rgb(237,108,96)\"><\/ellipse><ellipse cx=\"225\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(218,151,33)\" stroke-width=\"2\" fill=\"rgb(247,193,81)\"><\/ellipse><ellipse cx=\"385\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(27,161,37)\" stroke-width=\"2\" fill=\"rgb(100,200,86)\"><\/ellipse><\/svg><\/section><code class=\"hljs language-bash\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; display: block; overflow-x: auto; margin: 0.5em; padding: 3px 5px; color: rgb(147, 161, 161); background: rgb(0, 43, 54); overflow-wrap: normal;\">python main.py\n<\/code><\/pre>\n<p style=\"margin: 1em 0px;\">\u7ec8\u7aef\u91cc\u8df3\u51fa\u6a21\u578b\u7684\u56de\u590d\uff1a<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 12px; background: rgb(0, 43, 54); max-width: 100%; overflow-wrap: normal;\"><section style=\"display: block; background-repeat: no-repeat; width: 100%; height: 16px;\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" version=\"1.1\" width=\"45\" height=\"12\" viewBox=\"0 0 450 130\"><ellipse cx=\"65\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(220,60,54)\" stroke-width=\"2\" fill=\"rgb(237,108,96)\"><\/ellipse><ellipse cx=\"225\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(218,151,33)\" stroke-width=\"2\" fill=\"rgb(247,193,81)\"><\/ellipse><ellipse cx=\"385\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(27,161,37)\" stroke-width=\"2\" fill=\"rgb(100,200,86)\"><\/ellipse><\/svg><\/section><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; display: block; overflow-x: auto; margin: 0.5em; padding: 3px 5px; color: rgb(147, 161, 161); background: rgb(0, 43, 54); overflow-wrap: normal;\">\u6211\u662f\u4e00\u4e2aAI\u52a9\u624b\uff0c\u53ef\u4ee5\u56de\u7b54\u4f60\u7684\u95ee\u9898\u3001\u63d0\u4f9b\u4fe1\u606f\u3001\u5e2e\u4f60\u5904\u7406\u5404\u79cd\u4efb\u52a1\u2026\u2026\n---\n\u6d88\u8017 tokens: 156\n<\/code><\/pre>\n<p style=\"margin: 1em 0px;\">\u5c0f\u660e\u76ef\u7740\u5c4f\u5e55\u6123\u4e86\u4e94\u79d2\u3002&#8221;\u5c31\u8fd9\u6837\uff1f\u8fd9\u5c31\u8ddf AI \u5bf9\u8bdd\u4e86\uff1f&#8221;<\/p>\n<p style=\"margin: 1em 0px;\">&#8220;\u5bf9\u3002&#8221;\u8001\u5f20\u8bf4\uff0c&#8221;\u4f60\u8ddf\u5b83\u8bf4\u4e86\u4f60\u662f\u8c01\uff08system\uff09\uff0c\u7136\u540e\u95ee\u4e86\u95ee\u9898\uff08user\uff09\uff0c\u5b83\u56de\u4e86\u4f60\uff0c\u987a\u4fbf\u544a\u8bc9\u4f60\u82b1\u4e86\u591a\u5c11 token\u3002\u4e00\u6761\u8c03\u7528\u94fe\u8def\u5c31\u8fd9\u4e09\u6b65\u3002&#8221;<\/p>\n<p style=\"margin: 1em 0px;\">\u5c0f\u660e\u53c8\u95ee\uff1a&#8221;\u90a3\u8fd9\u4e2a <code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; color: rgb(72, 112, 172); font-size: 0.9em; font-weight: normal; overflow-wrap: break-word; padding: 2px 4px; border-radius: 3px; margin: 2px; background-color: rgb(246, 248, 250); word-break: break-all;\">messages<\/code> \u91cc\u9762 <code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; color: rgb(72, 112, 172); font-size: 0.9em; font-weight: normal; overflow-wrap: break-word; padding: 2px 4px; border-radius: 3px; margin: 2px; background-color: rgb(246, 248, 250); word-break: break-all;\">system<\/code> \u548c <code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; color: rgb(72, 112, 172); font-size: 0.9em; font-weight: normal; overflow-wrap: break-word; padding: 2px 4px; border-radius: 3px; margin: 2px; background-color: rgb(246, 248, 250); word-break: break-all;\">user<\/code> \u5230\u5e95\u5565\u533a\u522b\uff1f<code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; color: rgb(72, 112, 172); font-size: 0.9em; font-weight: normal; overflow-wrap: break-word; padding: 2px 4px; border-radius: 3px; margin: 2px; background-color: rgb(246, 248, 250); word-break: break-all;\">temperature<\/code> \u662f\u5e72\u561b\u7684\uff1f&#8221;<\/p>\n<p style=\"margin: 1em 0px;\">\u8001\u5f20\u8bf4\uff1a&#8221;\u95ee\u5f97\u597d\uff0c\u8fd9\u4e09\u4e2a\u6982\u5ff5\u641e\u61c2\u4e86\uff0c\u8c03 API \u5c31\u901a\u4e86 80%\u3002&#8221;<\/p>\n<h2 style=\"padding: 1px 12.5px; color: rgb(255, 255, 255); margin: 1.2em 0px 1em; border-radius: 4px; display: inline-block; background-color: rgb(72, 112, 172); font-size: 1.3em;\"><span>\u4e09\u4e2a\u6838\u5fc3\u6982\u5ff5<\/span><\/h2>\n<h3 style=\"padding: 0px; color: rgb(72, 112, 172); margin: 1.2em 0px 1em; font-size: 1.3em;\"><span>messages\uff1a\u5bf9\u8bdd\u7684\u7075\u9b42<\/span><\/h3>\n<p style=\"margin: 1em 0px;\">\u8001\u5f20\u5728\u767d\u677f\u4e0a\u753b\u4e86\u4e09\u884c\uff1a<\/p>\n<table style=\"display: table; text-align: left; overflow: auto; border-collapse: collapse; margin: 1.4em auto; max-width: 100%; table-layout: fixed; overflow-wrap: break-word; word-break: break-all;\">\n<thead>\n<tr>\n<th align=\"left\" style=\"border: 1px solid rgb(217, 223, 228); padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top; text-align: center; font-weight: bold; color: rgb(72, 112, 172); background: rgb(247, 247, 247);\">role<\/th>\n<th align=\"left\" style=\"border: 1px solid rgb(217, 223, 228); padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top; text-align: center; font-weight: bold; color: rgb(72, 112, 172); background: rgb(247, 247, 247);\">\u8c01\u8bf4\u7684\u8bdd<\/th>\n<th align=\"left\" style=\"border: 1px solid rgb(217, 223, 228); padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top; text-align: center; font-weight: bold; color: rgb(72, 112, 172); background: rgb(247, 247, 247);\">\u600e\u4e48\u7528<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td align=\"left\" style=\"border: 1px solid rgb(217, 223, 228); padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\"><code>system<\/code><\/td>\n<td align=\"left\" style=\"border: 1px solid rgb(217, 223, 228); padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\">\u4f60\u7ed9 AI \u5b9a\u7684&#8221;\u4eba\u8bbe&#8221;<\/td>\n<td align=\"left\" style=\"border: 1px solid rgb(217, 223, 228); padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\">\u653e\u5728\u6d88\u606f\u5217\u8868\u7b2c\u4e00\u6761\uff0c\u544a\u8bc9 AI \u5b83\u662f\u4ec0\u4e48\u89d2\u8272<\/td>\n<\/tr>\n<tr>\n<td align=\"left\" style=\"border: 1px solid rgb(217, 223, 228); padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\"><code>user<\/code><\/td>\n<td align=\"left\" style=\"border: 1px solid rgb(217, 223, 228); padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\">\u4f60\u95ee\u7684\u8bdd<\/td>\n<td align=\"left\" style=\"border: 1px solid rgb(217, 223, 228); padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\">\u4f60\u5b9e\u9645\u60f3\u95ee\u7684\u95ee\u9898<\/td>\n<\/tr>\n<tr>\n<td align=\"left\" style=\"border: 1px solid rgb(217, 223, 228); padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\"><code>assistant<\/code><\/td>\n<td align=\"left\" style=\"border: 1px solid rgb(217, 223, 228); padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\">AI \u4e0a\u4e00\u8f6e\u7684\u56de\u590d<\/td>\n<td align=\"left\" style=\"border: 1px solid rgb(217, 223, 228); padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\">\u591a\u8f6e\u5bf9\u8bdd\u65f6\u5fc5\u987b\u5e26\u4e0a\uff0c\u4e0d\u7136 AI \u4e0d\u77e5\u9053\u524d\u9762\u804a\u4e86\u5565<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin: 1em 0px;\">&#8220;\u91cd\u70b9\u662f\u8fd9\u4e2a <code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; color: rgb(72, 112, 172); font-size: 0.9em; font-weight: normal; overflow-wrap: break-word; padding: 2px 4px; border-radius: 3px; margin: 2px; background-color: rgb(246, 248, 250); word-break: break-all;\">assistant<\/code>\u3002&#8221;\u8001\u5f20\u6572\u4e86\u51e0\u4e0b\u952e\u76d8\uff0c\u7ed9\u5c0f\u660e\u770b\u591a\u8f6e\u5bf9\u8bdd\u7684\u5199\u6cd5\uff1a<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 12px; background: rgb(0, 43, 54); max-width: 100%; overflow-wrap: normal;\"><section style=\"display: block; background-repeat: no-repeat; width: 100%; height: 16px;\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" version=\"1.1\" width=\"45\" height=\"12\" viewBox=\"0 0 450 130\"><ellipse cx=\"65\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(220,60,54)\" stroke-width=\"2\" fill=\"rgb(237,108,96)\"><\/ellipse><ellipse cx=\"225\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(218,151,33)\" stroke-width=\"2\" fill=\"rgb(247,193,81)\"><\/ellipse><ellipse cx=\"385\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(27,161,37)\" stroke-width=\"2\" fill=\"rgb(100,200,86)\"><\/ellipse><\/svg><\/section><code class=\"hljs language-python\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; display: block; overflow-x: auto; margin: 0.5em; padding: 3px 5px; color: rgb(147, 161, 161); background: rgb(0, 43, 54); overflow-wrap: normal;\">messages = [\n  {<span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"role\"<\/span>: <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"system\"<\/span>, <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"content\"<\/span>: <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"\u4f60\u662f\u4e00\u4e2a Python \u7f16\u7a0b\u52a9\u624b\u3002\"<\/span>},\n  {<span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"role\"<\/span>: <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"user\"<\/span>, <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"content\"<\/span>: <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"\u600e\u4e48\u8bfb\u53d6 JSON \u6587\u4ef6\uff1f\"<\/span>},\n  {<span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"role\"<\/span>: <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"assistant\"<\/span>, <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"content\"<\/span>: <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"\u53ef\u4ee5\u7528 json.load() \u6253\u5f00\u6587\u4ef6\u5e76\u89e3\u6790\u2026\u2026\"<\/span>},\n  {<span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"role\"<\/span>: <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"user\"<\/span>, <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"content\"<\/span>: <span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"\u90a3\u5199\u5165\u5462\uff1f\"<\/span>},  <span class=\"hljs-comment\" style=\"color: rgb(101, 123, 131);\"># \u7b2c\u4e8c\u8f6e\u95ee\u9898<\/span>\n]\n<\/code><\/pre>\n<p style=\"margin: 1em 0px;\">&#8220;\u5927\u6a21\u578b\u672c\u8eab<strong style=\"color: rgb(72, 112, 172);\">\u6ca1\u6709\u8bb0\u5fc6<\/strong>\u3002\u6bcf\u4e00\u8f6e\u5bf9\u8bdd\uff0c\u4f60\u5f97\u628a\u4e4b\u524d\u7684\u6240\u6709\u6d88\u606f\u5168\u90e8\u4f20\u56de\u53bb\u3002\u5b83\u770b\u5230 <code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; color: rgb(72, 112, 172); font-size: 0.9em; font-weight: normal; overflow-wrap: break-word; padding: 2px 4px; border-radius: 3px; margin: 2px; background-color: rgb(246, 248, 250); word-break: break-all;\">assistant<\/code> \u90a3\u6761\u6d88\u606f\uff0c\u624d\u77e5\u9053\u4e0a\u4e00\u8f6e\u81ea\u5df1\u8bf4\u4e86\u4ec0\u4e48\uff0c\u624d\u80fd\u63a5\u4e0a\u4f60\u7684\u65b0\u95ee\u9898\u3002&#8221;<\/p>\n<p style=\"margin: 1em 0px;\">&#8220;\u6240\u6709\u804a\u5929\u5e94\u7528\u2014\u2014ChatGPT\u3001\u6587\u5fc3\u4e00\u8a00\u3001Kimi\u2014\u2014\u5e95\u5c42\u5168\u662f\u8fd9\u4e2a\u903b\u8f91\uff1a<strong style=\"color: rgb(72, 112, 172);\">\u6bcf\u6b21\u8bf7\u6c42\u90fd\u628a\u5386\u53f2\u6d88\u606f\u6253\u5305\u4f20\u8fc7\u53bb\u3002<\/strong>&#8220;<\/p>\n<h3 style=\"padding: 0px; color: rgb(72, 112, 172); margin: 1.2em 0px 1em; font-size: 1.3em;\"><span>temperature\uff1a\u63a7\u5236\u5b83\u591a&#8221;\u9760\u8c31&#8221;<\/span><\/h3>\n<p style=\"margin: 1em 0px;\">&#8220;\u8fd9\u4e2a\u53c2\u6570\u7ba1\u7684\u662f\u8f93\u51fa\u7684\u968f\u673a\u6027\uff0c0 \u5230 2 \u4e4b\u95f4\u3002&#8221;<\/p>\n<table style=\"display: table; text-align: left; overflow: auto; border-collapse: collapse; margin: 1.4em auto; max-width: 100%; table-layout: fixed; overflow-wrap: break-word; word-break: break-all;\">\n<thead>\n<tr>\n<th align=\"left\" style=\"border: 1px solid rgb(217, 223, 228); padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top; text-align: center; font-weight: bold; color: rgb(72, 112, 172); background: rgb(247, 247, 247);\">\u503c<\/th>\n<th align=\"left\" style=\"border: 1px solid rgb(217, 223, 228); padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top; text-align: center; font-weight: bold; color: rgb(72, 112, 172); background: rgb(247, 247, 247);\">\u6548\u679c<\/th>\n<th align=\"left\" style=\"border: 1px solid rgb(217, 223, 228); padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top; text-align: center; font-weight: bold; color: rgb(72, 112, 172); background: rgb(247, 247, 247);\">\u4ec0\u4e48\u65f6\u5019\u7528<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td align=\"left\" style=\"border: 1px solid rgb(217, 223, 228); padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\">0<\/td>\n<td align=\"left\" style=\"border: 1px solid rgb(217, 223, 228); padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\">\u6bcf\u6b21\u56de\u7b54\u51e0\u4e4e\u4e00\u6a21\u4e00\u6837\uff0c\u6700\u786e\u5b9a<\/td>\n<td align=\"left\" style=\"border: 1px solid rgb(217, 223, 228); padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\">\u4ee3\u7801\u751f\u6210\u3001\u6570\u636e\u63d0\u53d6\u3001\u4e8b\u5b9e\u95ee\u7b54<\/td>\n<\/tr>\n<tr>\n<td align=\"left\" style=\"border: 1px solid rgb(217, 223, 228); padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\">0.7<\/td>\n<td align=\"left\" style=\"border: 1px solid rgb(217, 223, 228); padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\">\u6709\u4e00\u5b9a\u53d8\u5316\uff0c\u4f46\u4e0d\u4f1a\u8dd1\u504f<\/td>\n<td align=\"left\" style=\"border: 1px solid rgb(217, 223, 228); padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\">\u666e\u901a\u5bf9\u8bdd\uff0c\u5165\u95e8\u7528\u8fd9\u4e2a\u5c31\u591f\u4e86<\/td>\n<\/tr>\n<tr>\n<td align=\"left\" style=\"border: 1px solid rgb(217, 223, 228); padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\">1.0+<\/td>\n<td align=\"left\" style=\"border: 1px solid rgb(217, 223, 228); padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\">\u5f88\u53d1\u6563\u3001\u5f88\u6709\u521b\u610f<\/td>\n<td align=\"left\" style=\"border: 1px solid rgb(217, 223, 228); padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\">\u5199\u8bd7\u3001\u8d77\u540d\u5b57\u3001\u5934\u8111\u98ce\u66b4<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin: 1em 0px;\">&#8220;\u5165\u95e8\u56fa\u5b9a 0.7\uff0c\u7b49\u4f60\u5bf9\u6a21\u578b\u813e\u6c14\u719f\u4e86\u518d\u8c03\u3002&#8221;<\/p>\n<h3 style=\"padding: 0px; color: rgb(72, 112, 172); margin: 1.2em 0px 1em; font-size: 1.3em;\"><span>\u54cd\u5e94\u91cc\u8fdc\u6bd4&#8221;\u56de\u590d\u5185\u5bb9&#8221;\u591a<\/span><\/h3>\n<p style=\"margin: 1em 0px;\">\u8001\u5f20\u8bf4\uff1a&#8221;\u5927\u90e8\u5206\u4eba\u53ea\u5173\u5fc3 <code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; color: rgb(72, 112, 172); font-size: 0.9em; font-weight: normal; overflow-wrap: break-word; padding: 2px 4px; border-radius: 3px; margin: 2px; background-color: rgb(246, 248, 250); word-break: break-all;\">choices[0].message.content<\/code>\u2014\u2014\u5c31\u662f AI \u8bf4\u7684\u90a3\u6bb5\u8bdd\u3002\u4f46\u4f60\u8fd8\u8981\u770b\u53e6\u5916\u4e24\u4e2a\u4e1c\u897f\u3002&#8221;<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 12px; background: rgb(0, 43, 54); max-width: 100%; overflow-wrap: normal;\"><section style=\"display: block; background-repeat: no-repeat; width: 100%; height: 16px;\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" version=\"1.1\" width=\"45\" height=\"12\" viewBox=\"0 0 450 130\"><ellipse cx=\"65\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(220,60,54)\" stroke-width=\"2\" fill=\"rgb(237,108,96)\"><\/ellipse><ellipse cx=\"225\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(218,151,33)\" stroke-width=\"2\" fill=\"rgb(247,193,81)\"><\/ellipse><ellipse cx=\"385\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(27,161,37)\" stroke-width=\"2\" fill=\"rgb(100,200,86)\"><\/ellipse><\/svg><\/section><code class=\"hljs language-python\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; display: block; overflow-x: auto; margin: 0.5em; padding: 3px 5px; color: rgb(147, 161, 161); background: rgb(0, 43, 54); overflow-wrap: normal;\">completion = client.chat.completions.create(...)\n\n<span class=\"hljs-comment\" style=\"color: rgb(101, 123, 131);\"># 1. \u56de\u590d\u5185\u5bb9 \u2014\u2014 \u6700\u5e38\u7528\u7684<\/span>\n<span class=\"hljs-built_in\" style=\"color: rgb(42, 161, 152);\">print<\/span>(completion.choices[<span class=\"hljs-number\" style=\"color: rgb(203, 75, 22);\">0<\/span>].message.content)\n\n<span class=\"hljs-comment\" style=\"color: rgb(101, 123, 131);\"># 2. \u7ed3\u675f\u539f\u56e0 \u2014\u2014 \u5224\u65ad\u6709\u6ca1\u6709\u88ab\u622a\u65ad<\/span>\n<span class=\"hljs-built_in\" style=\"color: rgb(42, 161, 152);\">print<\/span>(completion.choices[<span class=\"hljs-number\" style=\"color: rgb(203, 75, 22);\">0<\/span>].finish_reason)\n<span class=\"hljs-comment\" style=\"color: rgb(101, 123, 131);\"># \"stop\" = \u6b63\u5e38\u7ed3\u675f\uff0c\"length\" = \u88ab\u622a\u65ad\u4e86\uff0c\u5185\u5bb9\u6ca1\u8bf4\u5b8c<\/span>\n\n<span class=\"hljs-comment\" style=\"color: rgb(101, 123, 131);\"># 3. Token \u7528\u91cf \u2014\u2014 \u76f4\u63a5\u5173\u7cfb\u5230\u82b1\u591a\u5c11\u94b1<\/span>\n<span class=\"hljs-built_in\" style=\"color: rgb(42, 161, 152);\">print<\/span>(completion.usage.prompt_tokens)     <span class=\"hljs-comment\" style=\"color: rgb(101, 123, 131);\"># \u4f60\u8f93\u5165\u6d88\u8017\u7684 token<\/span>\n<span class=\"hljs-built_in\" style=\"color: rgb(42, 161, 152);\">print<\/span>(completion.usage.completion_tokens)   <span class=\"hljs-comment\" style=\"color: rgb(101, 123, 131);\"># AI \u8f93\u51fa\u6d88\u8017\u7684 token<\/span>\n<span class=\"hljs-built_in\" style=\"color: rgb(42, 161, 152);\">print<\/span>(completion.usage.total_tokens)    <span class=\"hljs-comment\" style=\"color: rgb(101, 123, 131);\"># \u603b token \u6570<\/span>\n<\/code><\/pre>\n<p style=\"margin: 1em 0px;\"><strong style=\"color: rgb(72, 112, 172);\">\u6ce8\u610f<\/strong>\uff1a1 \u4e2a\u4e2d\u6587\u5b57\u7ea6\u7b49\u4e8e 1~2 \u4e2a token\u3002\u5173\u6ce8 <code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; color: rgb(72, 112, 172); font-size: 0.9em; font-weight: normal; overflow-wrap: break-word; padding: 2px 4px; border-radius: 3px; margin: 2px; background-color: rgb(246, 248, 250); word-break: break-all;\">finish_reason<\/code> \u5224\u65ad\u662f\u5426\u622a\u65ad\uff0c\u5173\u6ce8 <code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; color: rgb(72, 112, 172); font-size: 0.9em; font-weight: normal; overflow-wrap: break-word; padding: 2px 4px; border-radius: 3px; margin: 2px; background-color: rgb(246, 248, 250); word-break: break-all;\">total_tokens<\/code> \u6838\u7b97\u6210\u672c\uff0c\u8fd9\u662f\u5f00\u53d1\u8005\u57fa\u672c\u7d20\u517b\u3002<\/p>\n<h2 style=\"padding: 1px 12.5px; color: rgb(255, 255, 255); margin: 1.2em 0px 1em; border-radius: 4px; display: inline-block; background-color: rgb(72, 112, 172); font-size: 1.3em;\"><span>\u65b0\u624b\u5fc5\u8e29\u7684\u56db\u4e2a\u5751<\/span><\/h2>\n<p style=\"margin: 1em 0px;\">\u5c0f\u660e\u5b9e\u9645\u8dd1\u4ee3\u7801\u7684\u65f6\u5019\u679c\u7136\u8e29\u4e86\u51e0\u4e2a\u5751\uff0c\u8001\u5f20\u4e00\u4e2a\u4e2a\u5e2e\u4ed6\u6392\u4e86\u3002<\/p>\n<h3 style=\"padding: 0px; color: rgb(72, 112, 172); margin: 1.2em 0px 1em; font-size: 1.3em;\"><span>\u5751\u4e00\uff1a<code>AuthenticationError<\/code> \u8ba4\u8bc1\u5931\u8d25<\/span><\/h3>\n<p style=\"margin: 1em 0px;\">API \u8fd4\u56de 401\uff0c\u63d0\u793a\u5bc6\u94a5\u65e0\u6548\u3002<\/p>\n<p style=\"margin: 1em 0px;\">\u6392\u67e5\u987a\u5e8f\uff1a<\/p>\n<ul style=\"padding-left: 1rem; margin-left: 1rem; font-size: 0.9rem; list-style-type: disc;\">\n<li>\n<section><code>.env<\/code> \u6587\u4ef6\u5728\u9879\u76ee\u6839\u76ee\u5f55\u5417\uff1f<\/section>\n<\/li>\n<li>\n<section><code>LLM_API_KEY<\/code> \u503c\u6709\u6ca1\u6709\u591a\u4f59\u7684\u7a7a\u683c\u6216\u6362\u884c\uff1f<\/section>\n<\/li>\n<li>\n<section>\u52a0\u4e00\u884c <code>print(os.getenv(\"LLM_API_KEY\"))<\/code> \u786e\u8ba4\u8bfb\u6ca1\u8bfb\u5230<\/section>\n<\/li>\n<\/ul>\n<p style=\"margin: 1em 0px;\">\u5c0f\u660e\u7684\u95ee\u9898\u5c31\u662f\u2014\u2014\u4ed6\u628a <code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; color: rgb(72, 112, 172); font-size: 0.9em; font-weight: normal; overflow-wrap: break-word; padding: 2px 4px; border-radius: 3px; margin: 2px; background-color: rgb(246, 248, 250); word-break: break-all;\">.env<\/code> \u653e\u5728\u4e86 <code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; color: rgb(72, 112, 172); font-size: 0.9em; font-weight: normal; overflow-wrap: break-word; padding: 2px 4px; border-radius: 3px; margin: 2px; background-color: rgb(246, 248, 250); word-break: break-all;\">config.py<\/code> \u540c\u76ee\u5f55\uff0c\u800c\u4e0d\u662f\u9879\u76ee\u6839\u76ee\u5f55\u3002<code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; color: rgb(72, 112, 172); font-size: 0.9em; font-weight: normal; overflow-wrap: break-word; padding: 2px 4px; border-radius: 3px; margin: 2px; background-color: rgb(246, 248, 250); word-break: break-all;\">load_dotenv()<\/code> \u9ed8\u8ba4\u4ece\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55\u627e <code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; color: rgb(72, 112, 172); font-size: 0.9em; font-weight: normal; overflow-wrap: break-word; padding: 2px 4px; border-radius: 3px; margin: 2px; background-color: rgb(246, 248, 250); word-break: break-all;\">.env<\/code>\uff0c\u6ca1\u627e\u5230\u5c31\u9759\u9ed8\u8df3\u8fc7\u4e86\u3002<\/p>\n<h3 style=\"padding: 0px; color: rgb(72, 112, 172); margin: 1.2em 0px 1em; font-size: 1.3em;\"><span>\u5751\u4e8c\uff1a<code>ConnectionError<\/code> \u8fde\u4e0d\u4e0a<\/span><\/h3>\n<p style=\"margin: 1em 0px;\">\u8bf7\u6c42\u8d85\u65f6\u3002<\/p>\n<p style=\"margin: 1em 0px;\">\u6392\u67e5\u987a\u5e8f\uff1a<\/p>\n<ul style=\"padding-left: 1rem; margin-left: 1rem; font-size: 0.9rem; list-style-type: disc;\">\n<li>\n<section><code>LLM_BASE_URL<\/code> \u672b\u5c3e\u4e0d\u80fd\u591a\u4e00\u4e2a <code>\/<\/code><\/section>\n<\/li>\n<li>\n<section>\u56fd\u5185\u7f51\u7edc\u76f4\u63a5\u8fde OpenAI \u5b98\u65b9\u9700\u8981\u4ee3\u7406\uff0c\u5165\u95e8\u7528\u56fd\u5185\u517c\u5bb9\u5e73\u53f0\u6700\u7701\u4e8b<\/section>\n<\/li>\n<li>\n<section>\u516c\u53f8\u5185\u7f51\u53ef\u80fd\u9700\u8981\u914d\u7f6e HTTP \u4ee3\u7406<\/section>\n<\/li>\n<\/ul>\n<h3 style=\"padding: 0px; color: rgb(72, 112, 172); margin: 1.2em 0px 1em; font-size: 1.3em;\"><span>\u5751\u4e09\uff1aAI \u8bf4\u4e00\u534a\u65ad\u4e86<\/span><\/h3>\n<p style=\"margin: 1em 0px;\"><code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; color: rgb(72, 112, 172); font-size: 0.9em; font-weight: normal; overflow-wrap: break-word; padding: 2px 4px; border-radius: 3px; margin: 2px; background-color: rgb(246, 248, 250); word-break: break-all;\">finish_reason<\/code> \u663e\u793a <code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; color: rgb(72, 112, 172); font-size: 0.9em; font-weight: normal; overflow-wrap: break-word; padding: 2px 4px; border-radius: 3px; margin: 2px; background-color: rgb(246, 248, 250); word-break: break-all;\">\"length\"<\/code> \u800c\u4e0d\u662f <code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; color: rgb(72, 112, 172); font-size: 0.9em; font-weight: normal; overflow-wrap: break-word; padding: 2px 4px; border-radius: 3px; margin: 2px; background-color: rgb(246, 248, 250); word-break: break-all;\">\"stop\"<\/code>\u3002<\/p>\n<p style=\"margin: 1em 0px;\">\u89e3\u6cd5\uff1a\u663e\u5f0f\u52a0\u5927 <code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; color: rgb(72, 112, 172); font-size: 0.9em; font-weight: normal; overflow-wrap: break-word; padding: 2px 4px; border-radius: 3px; margin: 2px; background-color: rgb(246, 248, 250); word-break: break-all;\">max_tokens<\/code> \u53c2\u6570\uff0c\u6216\u8005\u7f29\u77ed\u8f93\u5165\u7684\u6d88\u606f\u3002\u6a21\u578b\u8f93\u51fa\u6709\u5b57\u6570\u4e0a\u9650\uff0c\u9ed8\u8ba4\u503c\u53ef\u80fd\u4e0d\u591f\u3002<\/p>\n<h3 style=\"padding: 0px; color: rgb(72, 112, 172); margin: 1.2em 0px 1em; font-size: 1.3em;\"><span>\u5751\u56db\uff1aWindows \u7ec8\u7aef\u4e2d\u6587\u4e71\u7801<\/span><\/h3>\n<p style=\"margin: 1em 0px;\">\u82f1\u6587\u6b63\u5e38\uff0c\u4e2d\u6587\u53d8 <code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; color: rgb(72, 112, 172); font-size: 0.9em; font-weight: normal; overflow-wrap: break-word; padding: 2px 4px; border-radius: 3px; margin: 2px; background-color: rgb(246, 248, 250); word-break: break-all;\">\u25a1\u25a1\u25a1<\/code>\u3002<\/p>\n<p style=\"margin: 1em 0px;\">Windows PowerShell \u91cc\u6267\u884c\uff1a<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 12px; background: rgb(0, 43, 54); max-width: 100%; overflow-wrap: normal;\"><section style=\"display: block; background-repeat: no-repeat; width: 100%; height: 16px;\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" version=\"1.1\" width=\"45\" height=\"12\" viewBox=\"0 0 450 130\"><ellipse cx=\"65\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(220,60,54)\" stroke-width=\"2\" fill=\"rgb(237,108,96)\"><\/ellipse><ellipse cx=\"225\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(218,151,33)\" stroke-width=\"2\" fill=\"rgb(247,193,81)\"><\/ellipse><ellipse cx=\"385\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(27,161,37)\" stroke-width=\"2\" fill=\"rgb(100,200,86)\"><\/ellipse><\/svg><\/section><code class=\"hljs language-bash\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; display: block; overflow-x: auto; margin: 0.5em; padding: 3px 5px; color: rgb(147, 161, 161); background: rgb(0, 43, 54); overflow-wrap: normal;\"><span class=\"hljs-variable\" style=\"color: rgb(220, 50, 47);\">$env<\/span>:PYTHONIOENCODING=<span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">\"utf-8\"<\/span>\npython main.py\n<\/code><\/pre>\n<p style=\"margin: 1em 0px;\">\u6216\u8005\u5728\u4ee3\u7801\u5f00\u5934\u52a0\u4e0a\uff1a<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 12px; background: rgb(0, 43, 54); max-width: 100%; overflow-wrap: normal;\"><section style=\"display: block; background-repeat: no-repeat; width: 100%; height: 16px;\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" version=\"1.1\" width=\"45\" height=\"12\" viewBox=\"0 0 450 130\"><ellipse cx=\"65\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(220,60,54)\" stroke-width=\"2\" fill=\"rgb(237,108,96)\"><\/ellipse><ellipse cx=\"225\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(218,151,33)\" stroke-width=\"2\" fill=\"rgb(247,193,81)\"><\/ellipse><ellipse cx=\"385\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(27,161,37)\" stroke-width=\"2\" fill=\"rgb(100,200,86)\"><\/ellipse><\/svg><\/section><code class=\"hljs language-python\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; display: block; overflow-x: auto; margin: 0.5em; padding: 3px 5px; color: rgb(147, 161, 161); background: rgb(0, 43, 54); overflow-wrap: normal;\"><span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">import<\/span> sys\n<span class=\"hljs-keyword\" style=\"color: rgb(108, 113, 196);\">import<\/span> io\nsys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding=<span class=\"hljs-string\" style=\"color: rgb(133, 153, 0);\">'utf-8'<\/span>)\n<\/code><\/pre>\n<hr style=\"margin-top: 20px; margin-bottom: 20px; border-width: 2px 0px 0px; border-style: solid none none; border-color: rgb(238, 242, 245) currentcolor currentcolor; border-image: none; border-radius: 2px;\">\n<h2 style=\"padding: 1px 12.5px; color: rgb(255, 255, 255); margin: 1.2em 0px 1em; border-radius: 4px; display: inline-block; background-color: rgb(72, 112, 172); font-size: 1.3em;\"><span>\u914d\u4e0d\u540c\u5e73\u53f0\u7684\u5b9e\u4f8b<\/span><\/h2>\n<p style=\"margin: 1em 0px;\">\u5c0f\u660e\u641e\u61c2\u4e86\u57fa\u7840\uff0c\u95ee\u8001\u5f20\uff1a&#8221;\u8981\u662f\u6211\u4eec\u516c\u53f8\u51b3\u5b9a\u7528 DeepSeek \u5462\uff1f&#8221;<\/p>\n<p style=\"margin: 1em 0px;\">\u8001\u5f20\u8bf4\uff1a&#8221;\u6539 <code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; color: rgb(72, 112, 172); font-size: 0.9em; font-weight: normal; overflow-wrap: break-word; padding: 2px 4px; border-radius: 3px; margin: 2px; background-color: rgb(246, 248, 250); word-break: break-all;\">.env<\/code>\uff0c\u4ee3\u7801\u4e0d\u52a8\u3002&#8221;<\/p>\n<p style=\"margin: 1em 0px;\"><strong style=\"color: rgb(72, 112, 172);\">\u7528 DeepSeek<\/strong>\uff1a<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 12px; background: rgb(0, 43, 54); max-width: 100%; overflow-wrap: normal;\"><section style=\"display: block; background-repeat: no-repeat; width: 100%; height: 16px;\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" version=\"1.1\" width=\"45\" height=\"12\" viewBox=\"0 0 450 130\"><ellipse cx=\"65\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(220,60,54)\" stroke-width=\"2\" fill=\"rgb(237,108,96)\"><\/ellipse><ellipse cx=\"225\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(218,151,33)\" stroke-width=\"2\" fill=\"rgb(247,193,81)\"><\/ellipse><ellipse cx=\"385\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(27,161,37)\" stroke-width=\"2\" fill=\"rgb(100,200,86)\"><\/ellipse><\/svg><\/section><code class=\"hljs language-env\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; display: block; overflow-x: auto; margin: 0.5em; padding: 3px 5px; color: rgb(147, 161, 161); background: rgb(0, 43, 54); overflow-wrap: normal;\">LLM_BASE_URL=https:\/\/api.deepseek.com\/v1\nLLM_API_KEY=sk-\u4f60\u7684deepseek\u5bc6\u94a5\nLLM_MODEL_ID=deepseek-chat\n<\/code><\/pre>\n<p style=\"margin: 1em 0px;\"><strong style=\"color: rgb(72, 112, 172);\">\u7528\u667a\u8c31 GLM<\/strong>\uff1a<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 12px; background: rgb(0, 43, 54); max-width: 100%; overflow-wrap: normal;\"><section style=\"display: block; background-repeat: no-repeat; width: 100%; height: 16px;\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" version=\"1.1\" width=\"45\" height=\"12\" viewBox=\"0 0 450 130\"><ellipse cx=\"65\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(220,60,54)\" stroke-width=\"2\" fill=\"rgb(237,108,96)\"><\/ellipse><ellipse cx=\"225\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(218,151,33)\" stroke-width=\"2\" fill=\"rgb(247,193,81)\"><\/ellipse><ellipse cx=\"385\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(27,161,37)\" stroke-width=\"2\" fill=\"rgb(100,200,86)\"><\/ellipse><\/svg><\/section><code class=\"hljs language-env\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; display: block; overflow-x: auto; margin: 0.5em; padding: 3px 5px; color: rgb(147, 161, 161); background: rgb(0, 43, 54); overflow-wrap: normal;\">LLM_BASE_URL=https:\/\/open.bigmodel.cn\/api\/paas\/v4\nLLM_API_KEY=\u4f60\u7684\u667a\u8c31\u5bc6\u94a5\nLLM_MODEL_ID=glm-4-flash\n<\/code><\/pre>\n<p style=\"margin: 1em 0px;\"><strong style=\"color: rgb(72, 112, 172);\">\u7528 Kimi<\/strong>\uff1a<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 12px; background: rgb(0, 43, 54); max-width: 100%; overflow-wrap: normal;\"><section style=\"display: block; background-repeat: no-repeat; width: 100%; height: 16px;\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" version=\"1.1\" width=\"45\" height=\"12\" viewBox=\"0 0 450 130\"><ellipse cx=\"65\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(220,60,54)\" stroke-width=\"2\" fill=\"rgb(237,108,96)\"><\/ellipse><ellipse cx=\"225\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(218,151,33)\" stroke-width=\"2\" fill=\"rgb(247,193,81)\"><\/ellipse><ellipse cx=\"385\" cy=\"65\" rx=\"50\" ry=\"52\" stroke=\"rgb(27,161,37)\" stroke-width=\"2\" fill=\"rgb(100,200,86)\"><\/ellipse><\/svg><\/section><code class=\"hljs language-env\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; display: block; overflow-x: auto; margin: 0.5em; padding: 3px 5px; color: rgb(147, 161, 161); background: rgb(0, 43, 54); overflow-wrap: normal;\">LLM_BASE_URL=https:\/\/api.moonshot.cn\/v1\nLLM_API_KEY=sk-\u4f60\u7684kimi\u5bc6\u94a5\nLLM_MODEL_ID=moonshot-v1-8k\n<\/code><\/pre>\n<p style=\"margin: 1em 0px;\">&#8220;\u6539\u5b8c <code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; color: rgb(72, 112, 172); font-size: 0.9em; font-weight: normal; overflow-wrap: break-word; padding: 2px 4px; border-radius: 3px; margin: 2px; background-color: rgb(246, 248, 250); word-break: break-all;\">python main.py<\/code> \u76f4\u63a5\u8dd1\uff0c\u4e00\u4e2a\u5b57\u4e0d\u7528\u52a8\u3002\u8fd9\u5c31\u662f\u6807\u51c6\u5316\u7684\u529b\u91cf\u3002&#8221;<\/p>\n<hr style=\"margin-top: 20px; margin-bottom: 20px; border-width: 2px 0px 0px; border-style: solid none none; border-color: rgb(238, 242, 245) currentcolor currentcolor; border-image: none; border-radius: 2px;\">\n<h2 style=\"padding: 1px 12.5px; color: rgb(255, 255, 255); margin: 1.2em 0px 1em; border-radius: 4px; display: inline-block; background-color: rgb(72, 112, 172); font-size: 1.3em;\"><span>\u4e0b\u4e00\u6b65\u53ef\u4ee5\u505a\u4ec0\u4e48<\/span><\/h2>\n<p style=\"margin: 1em 0px;\">\u8dd1\u901a\u7b2c\u4e00\u6b21\u8c03\u7528\u53ea\u662f\u8d77\u70b9\u3002\u8001\u5f20\u7ed9\u5c0f\u660e\u5217\u4e86\u6761\u5b66\u4e60\u8def\u7ebf\uff1a<\/p>\n<ol style=\"padding-left: 1rem; margin-left: 1rem; font-size: 0.9rem; list-style-type: decimal;\">\n<li>\n<section><strong style=\"color: rgb(72, 112, 172);\">\u591a\u8f6e\u5bf9\u8bdd<\/strong> \u2014 \u624b\u52a8\u7ef4\u62a4 <code>messages<\/code> \u5386\u53f2\uff0c\u505a\u4e00\u4e2a\u80fd\u8fde\u7eed\u804a\u5929\u7684\u673a\u5668\u4eba<\/section>\n<\/li>\n<li>\n<section><strong style=\"color: rgb(72, 112, 172);\">\u6d41\u5f0f\u8f93\u51fa<\/strong> \u2014 \u52a0 <code>stream=True<\/code>\uff0c\u5b9e\u73b0\u6253\u5b57\u673a\u6548\u679c\uff0c\u7528\u6237\u4e0d\u7528\u5e72\u7b49<\/section>\n<\/li>\n<li>\n<section><strong style=\"color: rgb(72, 112, 172);\">Function Calling<\/strong> \u2014 \u8ba9 AI \u80fd\u67e5\u6570\u636e\u5e93\u3001\u8c03\u63a5\u53e3\uff0c\u4e0d\u518d\u53ea\u4f1a&#8221;\u8bf4\u8bdd&#8221;<\/section>\n<\/li>\n<li>\n<section><strong style=\"color: rgb(72, 112, 172);\">RAG \u77e5\u8bc6\u589e\u5f3a<\/strong> \u2014 \u628a\u4f60\u7684\u6587\u6863\u5582\u7ed9 AI\uff0c\u8ba9\u5b83\u57fa\u4e8e\u4f60\u7684\u79c1\u6709\u77e5\u8bc6\u56de\u7b54<\/section>\n<\/li>\n<li>\n<section><strong style=\"color: rgb(72, 112, 172);\">Agent \u5de5\u4f5c\u6d41<\/strong> \u2014 \u8ba9 AI \u81ea\u5df1\u89c4\u5212\u6b65\u9aa4\u3001\u62c6\u89e3\u4efb\u52a1\u3001\u6267\u884c\u590d\u6742\u64cd\u4f5c<\/section>\n<\/li>\n<\/ol>\n<p style=\"margin: 1em 0px;\">&#8220;\u6bcf\u4e00\u6b65\u90fd\u662f\u5728\u8c03 API \u7684\u57fa\u7840\u4e0a\u52a0\u65b0\u4e1c\u897f\u3002\u5e95\u5c42\u4ece\u6765\u6ca1\u53d8\u8fc7\u3002&#8221;<\/p>\n<h2 style=\"padding: 1px 12.5px; color: rgb(255, 255, 255); margin: 1.2em 0px 1em; border-radius: 4px; display: inline-block; background-color: rgb(72, 112, 172); font-size: 1.3em;\"><span>\u603b\u7ed3<\/span><\/h2>\n<p style=\"margin: 1em 0px;\">\u8fd9\u7bc7\u6587\u7ae0\u4ece\u5934\u5230\u5c3e\u6ca1\u6709\u8bb2 Transformer \u67b6\u6784\u3001\u6ca1\u6709\u8bb2\u6ce8\u610f\u529b\u673a\u5236\u3001\u6ca1\u6709\u8bb2 RLHF \u8bad\u7ec3\u3002\u4e0d\u662f\u90a3\u4e9b\u4e0d\u91cd\u8981\uff0c\u800c\u662f<strong style=\"color: rgb(72, 112, 172);\">\u5bf9\u5165\u95e8\u8005\u6765\u8bf4\uff0c\u5148\u52a8\u624b\u6bd4\u5148\u61c2\u539f\u7406\u91cd\u8981\u4e00\u767e\u500d<\/strong>\u3002<\/p>\n<p style=\"margin: 1em 0px;\">\u5927\u6a21\u578b\u5f00\u53d1\u7684\u5165\u53e3\u4e0d\u662f\u8bba\u6587\uff0c\u662f\u4e00\u884c <code style=\"font-family: Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Roboto Mono&quot;, &quot;Courier New&quot;, &quot;Microsoft YaHei&quot;, monospace; color: rgb(72, 112, 172); font-size: 0.9em; font-weight: normal; overflow-wrap: break-word; padding: 2px 4px; border-radius: 3px; margin: 2px; background-color: rgb(246, 248, 250); word-break: break-all;\">client.chat.completions.create()<\/code>\u3002\u4f60\u8c03\u901a\u4e86\u5b83\uff0c\u540e\u9762 RAG\u3001Agent\u3001\u591a\u6a21\u6001\u2014\u2014\u90fd\u662f\u5728\u8fd9\u6761\u8c03\u7528\u94fe\u8def\u4e0a\u505a\u52a0\u6cd5\u3002<\/p>\n<p style=\"margin: 1em 0px;\">\u5c0f\u660e\u540e\u6765\u7528\u4e00\u5468\u65f6\u95f4\u628a AI \u5ba2\u670d\u539f\u578b\u505a\u4e86\u51fa\u6765\uff0c\u8001\u677f\u5f88\u6ee1\u610f\u3002\u4ed6\u8bf4\uff1a&#8221;\u8001\u5f20\u90a3\u53e5\u8bdd\u592a\u5bf9\u4e86\u2014\u2014\u8c03\u4e2a API\uff0c\u62ff\u5230\u56de\u590d\uff0c\u5c31\u7b97\u5165\u95e8\u3002&#8221;<\/p>\n<p style=\"margin: 1em 0px;\">\u5e0c\u671b\u4f60\u4e5f\u4e00\u6837\u3002<\/p>\n<\/section>\n","protected":false},"excerpt":{"rendered":"<p>\u5f15\u8a00 \u5c0f\u660e\u7684\u8001\u677f\u4e0a\u5468\u4e22\u7ed9\u4ed6\u4e00\u4e2a\u4efb\u52a1\uff1a&#8221;\u54b1\u4eec\u7684\u5ba2\u670d\u7cfb\u7edf\u592a\u62c9\u4e86\uff0c\u7528\u6237\u95ee\u534a\u5929\u6ca1\u4eba\u56de\uff0c\u4f60\u641e\u4e2a AI \u5ba2\u670d\u51fa [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3575,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[164,163],"tags":[167,168],"_links":{"self":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/3574"}],"collection":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3574"}],"version-history":[{"count":15,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/3574\/revisions"}],"predecessor-version":[{"id":3593,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/3574\/revisions\/3593"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/media\/3575"}],"wp:attachment":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3574"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3574"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3574"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}