{"id":94573,"date":"2026-08-14T18:57:52","date_gmt":"2026-08-14T10:57:52","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/94573.html"},"modified":"2026-08-14T18:57:52","modified_gmt":"2026-08-14T10:57:52","slug":"5-%e5%88%86%e9%92%9f%e7%94%a8-python-%e8%b0%83%e9%80%9a%e5%a4%a7%e6%a8%a1%e5%9e%8basync-%e9%98%bf%e9%87%8c%e4%ba%91-coding-plan","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/94573.html","title":{"rendered":"5 \u5206\u949f\u7528 Python \u8c03\u901a\u5927\u6a21\u578b(async + \u963f\u91cc\u4e91 Coding Plan)"},"content":{"rendered":"<p>\u4f5c\u4e3a\u4e00\u4e2a\u524d\u7aef\u5de5\u7a0b\u5e08,\u6211\u4e00\u76f4\u628a Python \u5f53\u6210\u8f6c AI \u7684\u4e00\u9053\u574e\u3002\u76f4\u5230\u6211\u771f\u6b63\u52a8\u624b\u2014\u2014\u624d\u53d1\u73b0\u771f\u6b63\u8981\u91cd\u65b0\u9002\u5e94\u7684\u4e0d\u5230 20%\u3002<\/p>\n<p>\u8fd9\u7bc7\u6587\u7ae0\u8bb0\u5f55\u6211\u7528 2 \u5c0f\u65f6\u505a\u7684\u4e8b:\u641e\u61c2 Python async \u548c JS \u7684\u771f\u5b9e\u5dee\u5f02\u3001\u7528 Python \u8c03\u901a\u4e86\u963f\u91cc\u4e91 Coding Plan \u7684\u5927\u6a21\u578b API\u3002\u5176\u5b9e\u7eaf\u5c31\u8c03\u7528\u65b9\u5f0f\u6765\u8bf4,\u548c OpenAI\u3001Anthropic \u7684\u5b98\u65b9\u534f\u8bae\u5dee\u522b\u4e0d\u5927\u2014\u2014\u4e3b\u6d41\u7684 LLM \u8c03\u7528\u5c31\u8fd9\u4e24\u5957\u534f\u8bae,\u628a\u5b83\u4eec\u4efb\u4e00\u5957\u641e\u719f,\u8f6c\u6808\u6210\u672c\u6781\u4f4e\u3002<\/p>\n<p>\u5982\u679c\u4f60\u4e5f\u662f\u524d\u7aef\u60f3\u8f6c AI,\u8fd9\u662f\u6211\u80fd\u7ed9\u7684\u6700\u77ed\u8def\u5f84\u3002<\/p>\n<hr \/>\n<h3>\u7b2c 1 \u8282:async \u4f60\u65e9\u5c31\u4f1a,\u4f46 Python \u6709 3 \u4e2a\u6697\u5751<\/h3>\n<p>\u524d\u7aef\u5bf9 async\/await \u4e0d\u964c\u751f\u3002\u6211\u5199\u4e86\u4e2a&#034;\u70e7\u6c34 &#043; \u70e4\u9762\u5305&#034;\u7684\u4f8b\u5b50:<\/p>\n<p>\u540c\u6b65\u7248:<\/p>\n<p>import time<\/p>\n<p>def make_tea():<br \/>\n print(&#034;\u5f00\u59cb\u70e7\u6c34&#8230;&#034;)<br \/>\n time.sleep(2)<br \/>\n print(&#034;\u6c34\u5f00\u4e86,\u6ce1\u8336\u5b8c\u6210&#034;)<\/p>\n<p>def make_toast():<br \/>\n print(&#034;\u5f00\u59cb\u70e4\u9762\u5305&#8230;&#034;)<br \/>\n time.sleep(2)<br \/>\n print(&#034;\u9762\u5305\u70e4\u597d\u4e86&#034;)<\/p>\n<p>start &#061; time.time()<br \/>\nmake_tea()<br \/>\nmake_toast()<br \/>\nprint(f&#034;\u603b\u8017\u65f6: {time.time() &#8211; start:.1f} \u79d2&#034;)<\/p>\n<p>\u8dd1\u51fa\u6765 4 \u79d2\u2014\u2014\u4e24\u4ef6\u4e8b\u4e32\u7740\u505a,\u6ca1\u6bdb\u75c5\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260814105746-6a7ef4aa702c2.webp\" alt=\"async-4s.png\" \/><\/p>\n<p>\u5f02\u6b65\u7248(\u6539\u52a8\u5f88\u5c0f,\u51e0\u4e4e\u5bf9\u7167 JS \u76f4\u7ffb):<\/p>\n<p>import asyncio, time<\/p>\n<p>async def make_tea():<br \/>\n print(&#034;\u5f00\u59cb\u70e7\u6c34&#8230;&#034;)<br \/>\n await asyncio.sleep(2)<br \/>\n print(&#034;\u6c34\u5f00\u4e86,\u6ce1\u8336\u5b8c\u6210&#034;)<\/p>\n<p>async def make_toast():<br \/>\n print(&#034;\u5f00\u59cb\u70e4\u9762\u5305&#8230;&#034;)<br \/>\n await asyncio.sleep(2)<br \/>\n print(&#034;\u9762\u5305\u70e4\u597d\u4e86&#034;)<\/p>\n<p>async def main():<br \/>\n start &#061; time.time()<br \/>\n await asyncio.gather(make_tea(), make_toast())<br \/>\n print(f&#034;\u603b\u8017\u65f6: {time.time() &#8211; start:.1f} \u79d2&#034;)<\/p>\n<p>asyncio.run(main())<\/p>\n<p>\u8dd1\u51fa\u6765 2 \u79d2\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260814105746-6a7ef4aaa1843.webp\" alt=\"async-2s.png\" \/><\/p>\n<p>\u7b2c\u4e00\u53cd\u5e94:\u8fd9\u4e0d\u5c31\u8ddf JS \u4e00\u6837\u5417? asyncio.gather \u5c31\u662f Python \u7684 Promise.all,async def \u5c31\u662f async function,await \u5c31\u662f await\u3002\u786e\u5b9e,API \u8868\u9762\u4e00\u6a21\u4e00\u6837\u3002<\/p>\n<p>\u4f46\u5f80\u4e0b\u6252\u4e00\u5c42,\u85cf\u7740 3 \u4e2a JS \u515a\u6700\u5bb9\u6613\u683d\u7684\u5751\u3002<\/p>\n<h4>\u5751 1:Python \u5fc5\u987b\u624b\u52a8&#034;\u70b9\u706b&#034;\u4e8b\u4ef6\u5faa\u73af<\/h4>\n<p>JS \u7684\u4e8b\u4ef6\u5faa\u73af\u662f\u8fd0\u884c\u65f6\u81ea\u5e26\u7684\u2014\u2014\u4f60\u5728\u6d4f\u89c8\u5668\u6216 Node \u91cc\u76f4\u63a5\u5199 await fetch() \u5c31\u884c,\u6ca1\u4eba\u95ee\u4f60&#034;\u54ea\u6765\u7684\u4e8b\u4ef6\u5faa\u73af&#034;\u3002<\/p>\n<p>Python \u4e0d\u4e00\u6837\u3002\u6700\u5916\u5c42\u5fc5\u987b\u6709 asyncio.run(main()) \u8fd9\u4e00\u884c\u53bb\u542f\u52a8\u5faa\u73af,\u5426\u5219\u4f60\u7684 async def \u662f\u4e00\u5768\u6b7b\u4ee3\u7801\u3002<\/p>\n<p>\u8fd9\u662f JS \u515a\u7b2c\u4e00\u4e2a\u4e0d\u9002\u5e94\u7684\u5730\u65b9:\u201c\u4e3a\u4ec0\u4e48\u6211\u8fd8\u8981\u64cd\u5fc3\u5faa\u73af\u4ece\u54ea\u513f\u6765?\u201d<\/p>\n<h4>\u5751 2:\u8c03\u7528 async \u51fd\u6570,\u6839\u672c\u4e0d\u4f1a\u6267\u884c<\/h4>\n<p>\u8fd9\u6761\u6700\u5bb9\u6613\u7ffb\u8f66\u3002\u4e0b\u9762\u8fd9\u6bb5\u4ee3\u7801\u770b\u8d77\u6765\u975e\u5e38\u65e0\u5bb3:<\/p>\n<p>result &#061; make_tea()<br \/>\nprint(result)<\/p>\n<p>JS \u76f4\u89c9\u544a\u8bc9\u4f60:\u8c03\u7528 make_tea(),\u51fd\u6570\u4f53\u4f1a\u5f00\u59cb\u6267\u884c,\u7136\u540e\u8fd4\u56de\u4e00\u4e2a Promise\u3002<\/p>\n<p>\u4f46\u5728 Python \u91cc,\u5b83\u8f93\u51fa\u7684\u662f:<\/p>\n<p>&lt;coroutine object make_tea at 0x10a3b5c40&gt;<\/p>\n<p>make_tea() \u6ca1\u6267\u884c\u51fd\u6570\u4f53,\u53ea\u8fd4\u56de\u4e86\u4e00\u4e2a&#034;\u534f\u7a0b\u5bf9\u8c61&#034;\u3002\u8981\u771f\u6b63\u8dd1\u8d77\u6765,\u5fc5\u987b await make_tea() \u6216\u4ea4\u7ed9 asyncio.gather\/run\u3002<\/p>\n<p>\u6211\u81ea\u5df1\u770b\u5230\u8fd9\u884c\u7684\u65f6\u5019\u6123\u4e86\u4e00\u4e0b\u2014\u2014\u8fd9\u4e2a\u5dee\u5f02\u4e4b\u524d\u771f\u7684\u4e0d\u77e5\u9053,\u5982\u679c\u6309 JS \u76f4\u89c9\u5199\u4ee3\u7801,\u80af\u5b9a\u4f1a\u8e29\u5751\u3002<\/p>\n<p>\u5199\u4e00\u53e5\u8bdd\u8bb0\u4e00\u4e0b:<\/p>\n<ul>\n<li>JS:\u8c03\u7528 async \u51fd\u6570 \u2192 \u7acb\u5373\u5f00\u59cb\u6267\u884c &#043; \u8fd4\u56de Promise<\/li>\n<li>Python:\u8c03\u7528 async \u51fd\u6570 \u2192 \u4ec0\u4e48\u90fd\u4e0d\u53d1\u751f,\u53ea\u8fd4\u56de\u534f\u7a0b\u5bf9\u8c61<\/li>\n<\/ul>\n<h4>\u5751 3:sleep \u5343\u4e07\u522b\u7528\u9519<\/h4>\n<table>\n<tr>\u9519\u5bf9<\/tr>\n<tbody>\n<tr>\n<td>time.sleep(2) \u5199\u5728 async \u51fd\u6570\u91cc<\/td>\n<td>await asyncio.sleep(2)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>time.sleep \u662f\u540c\u6b65\u963b\u585e\u7684\u2014\u2014\u5b83\u4f1a\u5361\u6b7b\u6574\u4e2a\u4e8b\u4ef6\u5faa\u73af\u3002\u4f60\u4ee5\u4e3a\u81ea\u5df1\u5728\u5199\u5f02\u6b65,\u7ed3\u679c\u5176\u4ed6\u534f\u7a0b\u5168\u5728\u7b49\u4f60\u7761\u5b8c,\u5f02\u6b65\u767d\u5199\u3002<\/p>\n<p>\u8bb0\u4f4f:async \u51fd\u6570\u91cc\u51e1\u662f\u8981&#034;\u7b49&#034;,\u90fd\u7528 await asyncio.xxx\u3002<\/p>\n<hr \/>\n<h4>&#x1faa4; \u987a\u4fbf\u8bb0\u4e00\u4e2a\u5f00\u5f20\u7b2c\u4e00\u5751:f-string \u5fd8\u52a0 f<\/h4>\n<p>\u8fd9\u8ddf async \u65e0\u5173,\u4f46\u662f\u7b2c\u4e00\u6b21\u5199 Python \u51e0\u4e4e\u90fd\u4f1a\u683d:<\/p>\n<p>print(f&#034;\u603b\u8017\u65f6:{time.time() &#8211; start:.1f} \u79d2&#034;) # \u5bf9<br \/>\nprint(&#034;\u603b\u8017\u65f6:{time.time() &#8211; start:.1f} \u79d2&#034;) # \u9519<\/p>\n<p>\u7b2c\u4e8c\u884c\u6ca1\u52a0 f \u524d\u7f00,Python \u4f1a\u628a {&#8230;} \u5f53\u6210\u5b57\u9762\u91cf\u2014\u2014\u5927\u62ec\u53f7\u539f\u6837\u6253\u51fa\u6765,\u6216\u8005\u66f4\u8be1\u5f02\u7684\u60c5\u51b5:\u683c\u5f0f\u5316\u7b26\u53f7\u88ab\u9519\u8bef\u89e3\u8bfb\u6210\u79d1\u5b66\u8ba1\u6570\u6cd5,\u8f93\u51fa\u50cf \u603b\u8017\u65f6:4e&#043;00 \u79d2 \u8fd9\u79cd\u9b3c\u4e1c\u897f\u3002<\/p>\n<p>\u8fd9\u662f JS \u6a21\u677f\u5b57\u7b26\u4e32\u515a\u6700\u5bb9\u6613\u683d\u7684\u5751:<\/p>\n<ul>\n<li>JS:\u53cd\u5f15\u53f7 &#096; \u89e6\u53d1\u6a21\u677f<\/li>\n<li>Python:\u5b57\u7b26\u4e32\u524d\u7f00 f \u89e6\u53d1\u6a21\u677f<\/li>\n<\/ul>\n<p>\u6ca1\u6709 f \u7684\u5b57\u7b26\u4e32\u91cc,{} \u5c31\u662f\u666e\u901a\u5b57\u7b26\u3002<\/p>\n<hr \/>\n<h3>\u7b2c 2 \u8282:\u8c03\u4e00\u6b21\u5927\u6a21\u578b,\u5c31\u660e\u767d\u4e3a\u4ec0\u4e48 AI \u79bb\u4e0d\u5f00\u5f02\u6b65<\/h3>\n<p>\u7406\u8bba\u8bf4\u5b8c\u4e86,\u770b\u4e2a\u771f\u5b9e\u573a\u666f\u3002\u6211\u7528 httpx(Python \u7248\u7684 fetch)\u5e76\u53d1\u53d1\u4e86 3 \u4e2a\u8bf7\u6c42,\u5206\u522b\u7b49 1\u30012\u30013 \u79d2:<\/p>\n<p>async with httpx.AsyncClient(timeout&#061;15) as client:<br \/>\n await asyncio.gather(<br \/>\n fetch_delay(client, 1),<br \/>\n fetch_delay(client, 2),<br \/>\n fetch_delay(client, 3),<br \/>\n )<\/p>\n<p>\u6559\u79d1\u4e66\u4f1a\u544a\u8bc9\u4f60:\u4e32\u884c 6 \u79d2,\u5e76\u53d1 3 \u79d2\u3002<\/p>\n<p>\u5b9e\u9645\u8dd1\u51fa\u6765:\u5e76\u53d1\u7248 5 \u79d2,\u4e32\u884c\u7248 8~10 \u79d2\u3002<\/p>\n<p>\u5dee\u8ddd\u6ca1\u6709\u6559\u79d1\u4e66\u90a3\u4e48\u6f02\u4eae,\u56e0\u4e3a\u591a\u4e86 TLS \u63e1\u624b\u3001\u8de8\u5883\u7f51\u7edc\u3001\u670d\u52a1\u7aef\u5904\u7406\u8fd9\u4e9b\u5f00\u9500\u3002\u4f46\u8fd9\u6070\u6070\u662f\u771f\u5b9e\u751f\u4ea7\u73af\u5883\u7684\u6837\u5b50\u2014\u2014\u8c03\u7528\u5927\u6a21\u578b API \u6c38\u8fdc\u662f&#034;\u7406\u8bba\u503c &#043; \u7f51\u7edc\u6296\u52a8&#034;\u7684\u7ec4\u5408\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260814105746-6a7ef4aab63ca.webp\" alt=\"sequential-8s.png\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260814105746-6a7ef4aaca726.webp\" alt=\"concurrent-3s.png\" \/><\/p>\n<p>\u628a\u8fd9\u4e24\u4e2a\u622a\u56fe\u5e76\u6392\u653e\u4e00\u4e0b,\u4ef7\u503c\u5c31\u51fa\u6765\u4e86:<\/p>\n<ul>\n<li>\u4e32\u884c 8 \u79d2 vs \u5e76\u53d1 5 \u79d2<\/li>\n<li>\u7701\u4e0b\u6765\u7684 3 \u79d2\u5c31\u662f\u5f02\u6b65\u7684\u771f\u5b9e\u6536\u76ca<\/li>\n<\/ul>\n<p>\u4e3a\u4ec0\u4e48 AI \u5e94\u7528\u91cc\u5f02\u6b65\u4e0d\u662f\u53ef\u9009\u9879?\u56e0\u4e3a\u7528\u6237\u80fd\u76f4\u63a5\u611f\u53d7\u5230 5 \u79d2\u548c 10 \u79d2\u7684\u5dee\u8ddd\u3002\u7b49\u5f85\u5927\u6a21\u578b\u751f\u6210\u56de\u590d\u672c\u6765\u5c31\u6162,\u5982\u679c\u80cc\u540e\u8fd8\u4e32\u884c\u8c03\u591a\u4e2a API,\u4f53\u9a8c\u76f4\u63a5\u5d29\u3002<\/p>\n<hr \/>\n<h3>\u7b2c 3 \u8282:5 \u5206\u949f,\u7528 Python \u8c03\u901a\u5927\u6a21\u578b<\/h3>\n<p>\u91cc\u7a0b\u7891\u5728\u8fd9\u91cc\u3002<\/p>\n<p>\u6211\u7684\u73af\u5883\u662f \u963f\u91cc\u4e91 Coding Plan\u2014\u2014\u4e00\u4e2a\u628a Qwen\u3001GLM\u3001Kimi\u3001MiniMax \u7b49\u56fd\u4ea7\u6a21\u578b\u6253\u5305\u6309\u6708\u8ba2\u9605\u7684\u670d\u52a1,\u540c\u65f6\u63d0\u4f9b OpenAI \u517c\u5bb9 \u548c Anthropic \u517c\u5bb9 \u4e24\u5957 endpoint\u3002\u6211\u4e4b\u524d\u7528 Claude Code \u65f6,key \u5176\u5b9e\u5c31\u662f\u5b83(sk-sp- \u5f00\u5934)\u3002<\/p>\n<p>\u8fd9\u91cc\u6709\u4e2a\u503c\u5f97\u8bb2\u7684\u5de5\u7a0b\u8ba4\u77e5:2024 \u5e74\u4e4b\u540e,\u4e3b\u6d41 LLM \u8c03\u7528\u57fa\u672c\u53ea\u6709\u4e24\u5957\u534f\u8bae\u2014\u2014OpenAI \u517c\u5bb9 \u548c Anthropic \u517c\u5bb9\u3002\u4efb\u4f55\u6a21\u578b\u63d0\u4f9b\u5546(\u963f\u91cc\u3001DeepSeek\u3001Moonshot\u3001\u672c\u5730 Ollama)\u90fd\u4f1a\u517c\u5bb9\u8fd9\u4e24\u5957\u4e2d\u7684\u81f3\u5c11\u4e00\u5957\u3002\u5b66\u4f1a\u5176\u4e2d\u4e00\u5957,\u6362\u6808\u6210\u672c\u6781\u4f4e\u2014\u2014\u8fd9\u662f\u4e3a\u4ec0\u4e48\u6211\u4e0d\u7126\u8651&#034;\u4eca\u5929\u7528\u4e86 Claude,\u660e\u5929\u8981\u6362 Qwen&#034;\u3002<\/p>\n<h4>\u88c5\u5305<\/h4>\n<p>uv add openai python-dotenv<\/p>\n<p>\u6ce8\u610f\u2014\u2014\u7528 openai SDK \u4e0d\u4ee3\u8868\u7528 OpenAI \u7684\u6a21\u578b\u3002\u5b83\u53ea\u662f OpenAI \u517c\u5bb9\u534f\u8bae\u7684\u5ba2\u6237\u7aef,\u6362\u4e2a base_url \u5c31\u80fd\u63a5\u4efb\u4f55\u517c\u5bb9\u670d\u52a1\u3002\u8fd9\u79cd&#034;\u534f\u8bae\u4e92\u8ba4&#034;\u662f\u5f53\u4e0b LLM \u751f\u6001\u7684\u6807\u51c6\u73a9\u6cd5\u3002<\/p>\n<h4>\u4e09\u884c\u8c03\u901a<\/h4>\n<p>from openai import OpenAI<br \/>\nfrom dotenv import load_dotenv<br \/>\nimport os<\/p>\n<p>load_dotenv()<\/p>\n<p>client &#061; OpenAI(<br \/>\n api_key&#061;os.getenv(&#034;DASHSCOPE_API_KEY&#034;),<br \/>\n base_url&#061;&#034;https:\/\/coding.dashscope.aliyuncs.com\/v1&#034;, # \u2190 \u5173\u952e:\u6307\u5230\u963f\u91cc\u4e91 Coding Plan<br \/>\n)<\/p>\n<p>response &#061; client.chat.completions.create(<br \/>\n model&#061;&#034;qwen3-max&#034;,<br \/>\n max_tokens&#061;200,<br \/>\n messages&#061;[{&#034;role&#034;: &#034;user&#034;, &#034;content&#034;: &#034;\u7528\u4e00\u53e5\u8bdd\u89e3\u91ca\u4ec0\u4e48\u662f RAG,\u9762\u5411\u524d\u7aef\u5de5\u7a0b\u5e08\u3002&#034;}],<br \/>\n)<\/p>\n<p>print(response.choices[0].message.content)<\/p>\n<p>\u8dd1\u4e00\u6b21,qwen3-max \u7ed9\u6211\u5410\u51fa\u4e00\u6bb5\u5b8c\u6574\u56de\u590d\u3002<\/p>\n<p>\u7b2c\u4e00\u6b21\u7528 Python \u8c03\u901a\u5927\u6a21\u578b\u90a3\u4e00\u523b\u7684\u611f\u89c9:\u6a21\u578b\u8c03\u7528\u771f\u6ca1\u90a3\u4e48\u9ad8\u6df1\u3002\u88c5\u5305\u3001\u7ed9 key\u3001\u6539\u4e2a base_url\u3001\u53d1\u6761 message\u2014\u2014\u548c\u524d\u7aef\u8c03 REST API \u533a\u522b\u4e0d\u5927\u3002\u548c\u8fc7\u53bb\u51e0\u5e74\u60f3\u8c61\u4e2d\u7684&#034;AI \u5de5\u7a0b\u5e08&#034;\u5149\u73af\u5bf9\u6bd4,\u8fd9\u91cc\u66f4\u50cf\u662f&#034;\u666e\u901a\u7684 HTTP \u5ba2\u6237\u7aef,\u53ea\u662f\u56de\u590d\u5185\u5bb9\u662f\u6a21\u578b\u751f\u6210\u7684&#034;\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260814105746-6a7ef4aae3bf5.webp\" alt=\"llm-hello.png\" \/><\/p>\n<p>\u4f46\u6709\u4e00\u70b9\u4e0d\u8212\u670d:\u8fd9\u79cd\u4e00\u6b21\u6027\u7b49\u6a21\u578b\u628a\u7b54\u6848\u5168\u5410\u5b8c\u518d\u6253\u5370,\u4f53\u611f\u6bd4\u8f83\u6162\u2014\u2014\u4e0d\u50cf Claude Code \u91cc\u90a3\u79cd\u6253\u5b57\u673a\u6548\u679c\u3002<\/p>\n<h4>\u6d41\u5f0f\u8f93\u51fa,\u51e0\u884c\u7684\u4e8b<\/h4>\n<p>\u628a stream&#061;True \u5f00\u8d77\u6765:<\/p>\n<p>stream &#061; client.chat.completions.create(<br \/>\n model&#061;&#034;qwen3-max&#034;,<br \/>\n stream&#061;True,<br \/>\n messages&#061;[{&#034;role&#034;: &#034;user&#034;, &#034;content&#034;: &#034;\u7ed9\u524d\u7aef\u5de5\u7a0b\u5e08 3 \u6761\u8f6c AI \u5e94\u7528\u5f00\u53d1\u7684\u5efa\u8bae,\u6bcf\u6761\u4e00\u53e5\u8bdd\u3002&#034;}],<br \/>\n)<\/p>\n<p>for chunk in stream:<br \/>\n delta &#061; chunk.choices[0].delta.content<br \/>\n if delta:<br \/>\n print(delta, end&#061;&#034;&#034;, flush&#061;True)<\/p>\n<p>\u56de\u590d\u77ac\u95f4\u53d8\u6210\u4e00\u4e2a\u5b57\u4e00\u4e2a\u5b57\u5192\u51fa\u6765\u3002\u6240\u6709\u9762\u5411\u7528\u6237\u7684 AI \u5e94\u7528\u90fd\u7528\u6d41\u5f0f\u8f93\u51fa\u2014\u2014\u8fd9\u662f\u540e\u9762 SSE \/ WebSocket \u5de5\u7a0b\u5316\u7684\u57fa\u7840\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260814105747-6a7ef4ab03ec3.jpg\" alt=\"\u5916\u94fe\u56fe\u7247\u8f6c\u5b58\u5931\u8d25,\u6e90\u7ad9\u53ef\u80fd\u6709\u9632\u76d7\u94fe\u673a\u5236,\u5efa\u8bae\u5c06\u56fe\u7247\u4fdd\u5b58\u4e0b\u6765\u76f4\u63a5\u4e0a\u4f20\" \/><\/p>\n<hr \/>\n<h3>\u51e0\u53e5\u53ef\u4ee5\u6458\u8d70\u7684\u7ed3\u8bba<\/h3>\n<p>f-string \u5fd8\u52a0 f,\u8f93\u51fa\u5c31\u957f\u5f97\u50cf\u79d1\u5b66\u8ba1\u6570\u6cd5\u7684\u602a\u4e1c\u897f\u3002 \u2014\u2014 JS \u515a\u8f6c Python \u7684\u5f00\u5f20\u7b2c\u4e00\u5751<\/p>\n<p>\u524d\u7aef\u8f6c Python,80% \u7684\u8bed\u6cd5\u662f\u514d\u8d39\u7684\u3002 \u2014\u2014 \u771f\u6b63\u8981\u91cd\u65b0\u9002\u5e94\u7684,\u662f\u90a3 20% \u7684\u8fd0\u884c\u65f6\u6a21\u578b\u5dee\u5f02(\u534f\u7a0b\u5bf9\u8c61\u3001\u663e\u5f0f\u4e8b\u4ef6\u5faa\u73af\u3001\u963b\u585e sleep)<\/p>\n<p>\u6a21\u578b\u8c03\u7528\u6ca1\u90a3\u4e48\u590d\u6742,\u4e5f\u6ca1\u90a3\u4e48\u9ad8\u6df1\u3002 \u2014\u2014 \u4e3b\u6d41\u5c31 OpenAI \u517c\u5bb9 &#043; Anthropic \u517c\u5bb9\u4e24\u5957\u534f\u8bae,\u4f1a\u4e00\u5957\u5c31\u591f<\/p>\n<hr \/>\n<h3>\u7ed3\u5c3e<\/h3>\n<p>\u95e8\u69db\u6ca1\u6709\u60f3\u8c61\u4e2d\u90a3\u4e48\u9ad8,\u52a8\u624b\u90a3\u4e00\u523b\u5c31\u7834\u4e86\u3002<\/p>\n<p>\u8fd9\u662f\u300c\u524d\u7aef\u8f6c AI \u5e94\u7528\u5f00\u53d1\u300d\u7cfb\u5217\u7684\u7b2c 2 \u7bc7\u3002\u4e0b\u4e00\u7bc7\u6211\u4f1a\u5199 LangChain Python \u5b98\u65b9 quickstart,\u5bf9\u7167\u539f\u751f SDK \u770b LangChain \u5230\u5e95\u591a\u505a\u4e86\u4ec0\u4e48\u2014\u2014\u8fd9\u662f\u5927\u591a\u6570 AI \u5e94\u7528\u9762\u8bd5\u9898\u7684\u57fa\u7840\u3002<\/p>\n<p>\u5982\u679c\u4f60\u4e5f\u5728\u8f6c AI,\u8bc4\u8bba\u533a\u544a\u8bc9\u6211\u4f60\u5361\u5728\u54ea\u4e00\u6b65\u2014\u2014\u6211\u4f1a\u6311\u9ad8\u9891\u95ee\u9898\u4e13\u95e8\u5199\u4e00\u7bc7\u3002<\/p>\n<hr \/>\n<p>\u8fd9\u91cc\u7ed9\u5927\u5bb6\u7cbe\u5fc3\u6574\u7406\u4e86\u4e00\u4efd\u5168\u9762\u7684AI\u5927\u6a21\u578b\u5b66\u4e60\u8d44\u6e90&#xff0c;\u5305\u62ec&#xff1a;AI\u5927\u6a21\u578b\u5168\u5957\u5b66\u4e60\u8def\u7ebf\u56fe&#xff08;\u4ece\u5165\u95e8\u5230\u5b9e\u6218&#xff09;\u3001\u7cbe\u54c1AI\u5927\u6a21\u578b\u5b66\u4e60\u4e66\u7c4d\u624b\u518c\u3001\u89c6\u9891\u6559\u7a0b\u3001\u5b9e\u6218\u5b66\u4e60\u3001\u9762\u8bd5\u9898\u7b49&#xff0c;\u8d44\u6599\u514d\u8d39\u5206\u4eab&#xff01;<\/p>\n<p>&#x1f447;&#x1f447;\u626b\u7801\u514d\u8d39\u9886\u53d6\u5168\u90e8\u5185\u5bb9&#x1f447;&#x1f447; <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260814105747-6a7ef4ab43b84.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h3>1. \u6210\u957f\u8def\u7ebf\u56fe&amp;\u5b66\u4e60\u89c4\u5212<\/h3>\n<p>\u8981\u5b66\u4e60\u4e00\u95e8\u65b0\u7684\u6280\u672f&#xff0c;\u4f5c\u4e3a\u65b0\u624b\u4e00\u5b9a\u8981\u5148\u5b66\u4e60\u6210\u957f\u8def\u7ebf\u56fe&#xff0c;\u65b9\u5411\u4e0d\u5bf9&#xff0c;\u52aa\u529b\u767d\u8d39\u3002<\/p>\n<p>\u8fd9\u91cc&#xff0c;\u6211\u4eec\u4e3a\u65b0\u624b\u548c\u60f3\u8981\u8fdb\u4e00\u6b65\u63d0\u5347\u7684\u4e13\u4e1a\u4eba\u58eb\u51c6\u5907\u4e86\u4e00\u4efd\u8be6\u7ec6\u7684\u5b66\u4e60\u6210\u957f\u8def\u7ebf\u56fe\u548c\u89c4\u5212\u3002\u53ef\u4ee5\u8bf4\u662f\u6700\u79d1\u5b66\u6700\u7cfb\u7edf\u7684\u5b66\u4e60\u6210\u957f\u8def\u7ebf\u3002 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260814105747-6a7ef4abb38f1.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h3>2. \u5927\u6a21\u578b\u7ecf\u5178PDF\u4e66\u7c4d<\/h3>\n<p>\u4e66\u7c4d\u548c\u5b66\u4e60\u6587\u6863\u8d44\u6599\u662f\u5b66\u4e60\u5927\u6a21\u578b\u8fc7\u7a0b\u4e2d\u5fc5\u4e0d\u53ef\u5c11\u7684&#xff0c;\u6211\u4eec\u7cbe\u9009\u4e86\u4e00\u7cfb\u5217\u6df1\u5165\u63a2\u8ba8\u5927\u6a21\u578b\u6280\u672f\u7684\u4e66\u7c4d\u548c\u5b66\u4e60\u6587\u6863&#xff0c;\u5b83\u4eec\u7531\u9886\u57df\u5185\u7684\u9876\u5c16\u4e13\u5bb6\u64b0\u5199&#xff0c;\u5185\u5bb9\u5168\u9762\u3001\u6df1\u5165\u3001\u8be6\u5c3d&#xff0c;\u4e3a\u4f60\u5b66\u4e60\u5927\u6a21\u578b\u63d0\u4f9b\u575a\u5b9e\u7684\u7406\u8bba\u57fa\u7840\u3002&#xff08;\u4e66\u7c4d\u542b\u7535\u5b50\u7248PDF&#xff09;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260814105748-6a7ef4acbe26a.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h3>3. \u5927\u6a21\u578b\u89c6\u9891\u6559\u7a0b<\/h3>\n<p>\u5bf9\u4e8e\u5f88\u591a\u81ea\u5b66\u6216\u8005\u6ca1\u6709\u57fa\u7840\u7684\u540c\u5b66\u6765\u8bf4&#xff0c;\u4e66\u7c4d\u8fd9\u4e9b\u7eaf\u6587\u5b57\u7c7b\u7684\u5b66\u4e60\u6559\u6750\u4f1a\u89c9\u5f97\u6bd4\u8f83\u6666\u6da9\u96be\u4ee5\u7406\u89e3&#xff0c;\u56e0\u6b64&#xff0c;\u6211\u4eec\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u5927\u6a21\u578b\u89c6\u9891\u6559\u7a0b&#xff0c;\u4ee5\u52a8\u6001\u3001\u5f62\u8c61\u7684\u65b9\u5f0f\u5c55\u793a\u6280\u672f\u6982\u5ff5&#xff0c;\u5e2e\u52a9\u4f60\u66f4\u5feb\u3001\u66f4\u8f7b\u677e\u5730\u638c\u63e1\u6838\u5fc3\u77e5\u8bc6\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260814105749-6a7ef4ad144f1.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h3>4. 2026\u884c\u4e1a\u62a5\u544a<\/h3>\n<p>\u884c\u4e1a\u5206\u6790\u4e3b\u8981\u5305\u62ec\u5bf9\u4e0d\u540c\u884c\u4e1a\u7684\u73b0\u72b6\u3001\u8d8b\u52bf\u3001\u95ee\u9898\u3001\u673a\u4f1a\u7b49\u8fdb\u884c\u7cfb\u7edf\u5730\u8c03\u7814\u548c\u8bc4\u4f30&#xff0c;\u4ee5\u4e86\u89e3\u54ea\u4e9b\u884c\u4e1a\u66f4\u9002\u5408\u5f15\u5165\u5927\u6a21\u578b\u7684\u6280\u672f\u548c\u5e94\u7528&#xff0c;\u4ee5\u53ca\u5728\u54ea\u4e9b\u65b9\u9762\u53ef\u4ee5\u53d1\u6325\u5927\u6a21\u578b\u7684\u4f18\u52bf\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260814105749-6a7ef4ad7ab36.png\" alt=\"\" \/><\/p>\n<h3>5. \u5927\u6a21\u578b\u9879\u76ee\u5b9e\u6218<\/h3>\n<p>\u5b66\u4ee5\u81f4\u7528 &#xff0c;\u5f53\u4f60\u7684\u7406\u8bba\u77e5\u8bc6\u79ef\u7d2f\u5230\u4e00\u5b9a\u7a0b\u5ea6&#xff0c;\u5c31\u9700\u8981\u901a\u8fc7\u9879\u76ee\u5b9e\u6218&#xff0c;\u5728\u5b9e\u9645\u64cd\u4f5c\u4e2d\u68c0\u9a8c\u548c\u5de9\u56fa\u4f60\u6240\u5b66\u5230\u7684\u77e5\u8bc6&#xff0c;\u540c\u65f6\u4e3a\u4f60\u627e\u5de5\u4f5c\u548c\u804c\u4e1a\u53d1\u5c55\u6253\u4e0b\u575a\u5b9e\u7684\u57fa\u7840\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260814105750-6a7ef4ae8a424.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h3>6. \u5927\u6a21\u578b\u9762\u8bd5\u9898<\/h3>\n<p>\u9762\u8bd5\u4e0d\u4ec5\u662f\u6280\u672f\u7684\u8f83\u91cf&#xff0c;\u66f4\u9700\u8981\u5145\u5206\u7684\u51c6\u5907\u3002<\/p>\n<p>\u5728\u4f60\u5df2\u7ecf\u638c\u63e1\u4e86\u5927\u6a21\u578b\u6280\u672f\u4e4b\u540e&#xff0c;\u5c31\u9700\u8981\u5f00\u59cb\u51c6\u5907\u9762\u8bd5&#xff0c;\u6211\u4eec\u5c06\u63d0\u4f9b\u7cbe\u5fc3\u6574\u7406\u7684\u5927\u6a21\u578b\u9762\u8bd5\u9898\u5e93&#xff0c;\u6db5\u76d6\u5f53\u524d\u9762\u8bd5\u4e2d\u53ef\u80fd\u9047\u5230\u7684\u5404\u79cd\u6280\u672f\u95ee\u9898&#xff0c;\u8ba9\u4f60\u5728\u9762\u8bd5\u4e2d\u6e38\u5203\u6709\u4f59\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260814105750-6a7ef4aebf77d.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h3>7. \u8d44\u6599\u9886\u53d6&#xff1a;\u5168\u5957\u5185\u5bb9\u514d\u8d39\u62b1\u8d70&#xff0c;\u5b66 AI \u4e0d\u7528\u518d\u627e\u7b2c\u4e8c\u4efd<\/h3>\n<p>\u4e0d\u7ba1\u4f60\u662f 0 \u57fa\u7840\u60f3\u5165\u95e8 AI \u5927\u6a21\u578b&#xff0c;\u8fd8\u662f\u6709\u57fa\u7840\u60f3\u51b2\u523a\u5927\u5382\u3001\u4e86\u89e3\u884c\u4e1a\u8d8b\u52bf&#xff0c;\u8fd9\u4efd\u8d44\u6599\u90fd\u80fd\u6ee1\u8db3\u4f60&#xff01; \u73b0\u5728\u53ea\u9700\u6309\u7167\u63d0\u793a\u64cd\u4f5c&#xff0c;\u5c31\u80fd\u514d\u8d39\u9886\u53d6&#xff1a;<\/p>\n<p>&#x1f447;&#x1f447;\u626b\u7801\u514d\u8d39\u9886\u53d6\u5168\u90e8\u5185\u5bb9&#x1f447;&#x1f447; <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260814105751-6a7ef4af277c1.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4f5c\u4e3a\u4e00\u4e2a\u524d\u7aef\u5de5\u7a0b\u5e08,\u6211\u4e00\u76f4\u628a Python \u5f53\u6210\u8f6c AI \u7684\u4e00\u9053\u574e\u3002\u76f4\u5230\u6211\u771f\u6b63\u52a8\u624b\u2014\u2014\u624d\u53d1\u73b0\u771f\u6b63\u8981\u91cd\u65b0\u9002\u5e94\u7684\u4e0d\u5230 20%\u3002<br \/>\n\u8fd9\u7bc7\u6587\u7ae0\u8bb0\u5f55\u6211\u7528 2 \u5c0f\u65f6\u505a\u7684\u4e8b:\u641e\u61c2 Python async \u548c JS \u7684\u771f\u5b9e\u5dee\u5f02\u3001\u7528 Python \u8c03\u901a\u4e86\u963f\u91cc\u4e91 Coding Plan \u7684\u5927\u6a21\u578b API\u3002\u5176\u5b9e\u7eaf\u5c31\u8c03\u7528\u65b9\u5f0f\u6765\u8bf4,\u548c OpenAI\u3001Anthropic \u7684\u5b98\u65b9\u534f\u8bae\u5dee\u522b\u4e0d\u5927\u2014\u2014\u4e3b\u6d41\u7684 LLM \u8c03\u7528\u5c31\u8fd9\u4e24\u5957\u534f\u8bae,\u628a\u5b83\u4eec\u4efb\u4e00\u5957\u641e\u719f,\u8f6c\u6808\u6210\u672c\u6781\u4f4e\u3002<br \/>\n\u5982\u679c\u4f60\u4e5f\u662f\u524d\u7aef\u60f3\u8f6c AI,\u8fd9\u662f\u6211\u80fd\u7ed9\u7684\u6700<\/p>\n","protected":false},"author":2,"featured_media":94559,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[99,81,50,87,132],"topic":[],"class_list":["post-94573","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-java","tag-python","tag-50","tag-87","tag-132"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>5 \u5206\u949f\u7528 Python \u8c03\u901a\u5927\u6a21\u578b(async + \u963f\u91cc\u4e91 Coding Plan) - \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\/94573.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"5 \u5206\u949f\u7528 Python \u8c03\u901a\u5927\u6a21\u578b(async + \u963f\u91cc\u4e91 Coding Plan) - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u4f5c\u4e3a\u4e00\u4e2a\u524d\u7aef\u5de5\u7a0b\u5e08,\u6211\u4e00\u76f4\u628a Python \u5f53\u6210\u8f6c AI \u7684\u4e00\u9053\u574e\u3002\u76f4\u5230\u6211\u771f\u6b63\u52a8\u624b\u2014\u2014\u624d\u53d1\u73b0\u771f\u6b63\u8981\u91cd\u65b0\u9002\u5e94\u7684\u4e0d\u5230 20%\u3002 \u8fd9\u7bc7\u6587\u7ae0\u8bb0\u5f55\u6211\u7528 2 \u5c0f\u65f6\u505a\u7684\u4e8b:\u641e\u61c2 Python async \u548c JS \u7684\u771f\u5b9e\u5dee\u5f02\u3001\u7528 Python \u8c03\u901a\u4e86\u963f\u91cc\u4e91 Coding Plan \u7684\u5927\u6a21\u578b API\u3002\u5176\u5b9e\u7eaf\u5c31\u8c03\u7528\u65b9\u5f0f\u6765\u8bf4,\u548c OpenAI\u3001Anthropic \u7684\u5b98\u65b9\u534f\u8bae\u5dee\u522b\u4e0d\u5927\u2014\u2014\u4e3b\u6d41\u7684 LLM \u8c03\u7528\u5c31\u8fd9\u4e24\u5957\u534f\u8bae,\u628a\u5b83\u4eec\u4efb\u4e00\u5957\u641e\u719f,\u8f6c\u6808\u6210\u672c\u6781\u4f4e\u3002 \u5982\u679c\u4f60\u4e5f\u662f\u524d\u7aef\u60f3\u8f6c AI,\u8fd9\u662f\u6211\u80fd\u7ed9\u7684\u6700\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/94573.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-08-14T10:57:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260814105746-6a7ef4aa702c2.webp\" \/>\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=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/94573.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/94573.html\",\"name\":\"5 \u5206\u949f\u7528 Python \u8c03\u901a\u5927\u6a21\u578b(async + \u963f\u91cc\u4e91 Coding Plan) - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-08-14T10:57:52+00:00\",\"dateModified\":\"2026-08-14T10:57:52+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/94573.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/94573.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/94573.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"5 \u5206\u949f\u7528 Python \u8c03\u901a\u5927\u6a21\u578b(async + \u963f\u91cc\u4e91 Coding Plan)\"}]},{\"@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":"5 \u5206\u949f\u7528 Python \u8c03\u901a\u5927\u6a21\u578b(async + \u963f\u91cc\u4e91 Coding Plan) - \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\/94573.html","og_locale":"zh_CN","og_type":"article","og_title":"5 \u5206\u949f\u7528 Python \u8c03\u901a\u5927\u6a21\u578b(async + \u963f\u91cc\u4e91 Coding Plan) - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u4f5c\u4e3a\u4e00\u4e2a\u524d\u7aef\u5de5\u7a0b\u5e08,\u6211\u4e00\u76f4\u628a Python \u5f53\u6210\u8f6c AI \u7684\u4e00\u9053\u574e\u3002\u76f4\u5230\u6211\u771f\u6b63\u52a8\u624b\u2014\u2014\u624d\u53d1\u73b0\u771f\u6b63\u8981\u91cd\u65b0\u9002\u5e94\u7684\u4e0d\u5230 20%\u3002 \u8fd9\u7bc7\u6587\u7ae0\u8bb0\u5f55\u6211\u7528 2 \u5c0f\u65f6\u505a\u7684\u4e8b:\u641e\u61c2 Python async \u548c JS \u7684\u771f\u5b9e\u5dee\u5f02\u3001\u7528 Python \u8c03\u901a\u4e86\u963f\u91cc\u4e91 Coding Plan \u7684\u5927\u6a21\u578b API\u3002\u5176\u5b9e\u7eaf\u5c31\u8c03\u7528\u65b9\u5f0f\u6765\u8bf4,\u548c OpenAI\u3001Anthropic \u7684\u5b98\u65b9\u534f\u8bae\u5dee\u522b\u4e0d\u5927\u2014\u2014\u4e3b\u6d41\u7684 LLM \u8c03\u7528\u5c31\u8fd9\u4e24\u5957\u534f\u8bae,\u628a\u5b83\u4eec\u4efb\u4e00\u5957\u641e\u719f,\u8f6c\u6808\u6210\u672c\u6781\u4f4e\u3002 \u5982\u679c\u4f60\u4e5f\u662f\u524d\u7aef\u60f3\u8f6c AI,\u8fd9\u662f\u6211\u80fd\u7ed9\u7684\u6700","og_url":"https:\/\/www.wsisp.com\/helps\/94573.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-08-14T10:57:52+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260814105746-6a7ef4aa702c2.webp"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/94573.html","url":"https:\/\/www.wsisp.com\/helps\/94573.html","name":"5 \u5206\u949f\u7528 Python \u8c03\u901a\u5927\u6a21\u578b(async + \u963f\u91cc\u4e91 Coding Plan) - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-08-14T10:57:52+00:00","dateModified":"2026-08-14T10:57:52+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/94573.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/94573.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/94573.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"5 \u5206\u949f\u7528 Python \u8c03\u901a\u5927\u6a21\u578b(async + \u963f\u91cc\u4e91 Coding Plan)"}]},{"@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\/94573","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=94573"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/94573\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/94559"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=94573"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=94573"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=94573"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=94573"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}