{"id":70793,"date":"2026-02-02T12:33:17","date_gmt":"2026-02-02T04:33:17","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/70793.html"},"modified":"2026-02-02T12:33:17","modified_gmt":"2026-02-02T04:33:17","slug":"%e6%88%91%e8%8a%b1%e4%ba%863%e5%a4%a9%ef%bc%8c%e4%b8%ba-langchain-%e5%86%99%e4%ba%866%e4%b8%87%e8%a1%8c%e4%b8%ad%e6%96%87%e6%b3%a8%e9%87%8a","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/70793.html","title":{"rendered":"\u6211\u82b1\u4e863\u5929\uff0c\u4e3a LangChain \u5199\u4e866\u4e07\u884c\u4e2d\u6587\u6ce8\u91ca"},"content":{"rendered":"<p> <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260202043315-6980290bf186f.jpg\" width=\"150\" \/> <\/p>\n<h2>\u7384\u540c 765<\/h2>\n<p>\u5927\u8bed\u8a00\u6a21\u578b (LLM) \u5f00\u53d1\u5de5\u7a0b\u5e08 | \u4e2d\u56fd\u4f20\u5a92\u5927\u5b66 \u00b7 \u6570\u5b57\u5a92\u4f53\u6280\u672f&#xff08;\u667a\u80fd\u4ea4\u4e92\u4e0e\u6e38\u620f\u8bbe\u8ba1&#xff09;<\/p>\n<p>  CSDN \u00b7 \u4e2a\u4eba\u4e3b\u9875 |   GitHub \u00b7 Follow  <\/p>\n<hr \/>\n<h4>\u5173\u4e8e\u4f5c\u8005<\/h4>\n<ul>\n<li>\u6df1\u8015\u9886\u57df&#xff1a;\u5927\u8bed\u8a00\u6a21\u578b\u5f00\u53d1 \/ RAG \u77e5\u8bc6\u5e93 \/ AI Agent \u843d\u5730 \/ \u6a21\u578b\u5fae\u8c03<\/li>\n<li>\u6280\u672f\u6808&#xff1a;Python | RAG (LangChain \/ Dify &#043; Milvus) | FastAPI &#043; Docker<\/li>\n<li>\u5de5\u7a0b\u80fd\u529b&#xff1a;\u4e13\u6ce8\u6a21\u578b\u5de5\u7a0b\u5316\u90e8\u7f72\u3001\u77e5\u8bc6\u5e93\u6784\u5efa\u4e0e\u4f18\u5316&#xff0c;\u64c5\u957f\u5168\u6d41\u7a0b\u89e3\u51b3\u65b9\u6848<\/li>\n<\/ul>\n<p>\u300c\u8ba9 AI \u4ea4\u4e92\u66f4\u667a\u80fd&#xff0c;\u8ba9\u6280\u672f\u843d\u5730\u66f4\u9ad8\u6548\u300d \u6b22\u8fce\u6280\u672f\u63a2\u8ba8\u4e0e\u9879\u76ee\u5408\u4f5c&#xff0c;\u89e3\u9501\u5927\u6a21\u578b\u4e0e\u667a\u80fd\u4ea4\u4e92\u7684\u65e0\u9650\u53ef\u80fd&#xff01;<\/p>\n<hr \/>\n<p>\u9879\u76ee\u5730\u5740&#xff1a;<\/p>\n<ul>\n<li>GitHub&#xff1a;https:\/\/github.com\/xt765\/LangChain-Chinese-Comment<\/li>\n<li>Gitee&#xff1a;https:\/\/gitee.com\/xt765\/LangChain-Chinese-Comment<\/li>\n<\/ul>\n<p>\u5927\u5bb6\u597d&#xff0c;\u6211\u662f\u7384\u540c765&#xff08;xt765&#xff09;&#xff0c;\u4e00\u540d\u4e13\u6ce8\u4e8e LLM \u5e94\u7528\u5f00\u53d1\u7684\u5de5\u7a0b\u5e08\u3002<\/p>\n<p>\u521a\u521a\u8fc7\u53bb\u76843\u5929&#xff0c;\u6211\u5e72\u4e86\u4e00\u4ef6&#034;\u75af\u72c2&#034;\u7684\u4e8b\u2014\u2014\u5728 AI \u52a9\u624b Kimi-K2.5 \u7684\u5e2e\u52a9\u4e0b&#xff0c;\u628a LangChain \u7684\u6838\u5fc3\u6e90\u7801\u9010\u884c\u8bfb\u4e86\u4e00\u904d&#xff0c;\u5e76\u6574\u7406\u51fa\u4e866\u4e07\u591a\u884c\u7684\u4e2d\u6587\u6ce8\u91ca\u3002<\/p>\n<p>\u4eca\u5929&#xff0c;\u6211\u60f3\u548c\u5927\u5bb6\u5206\u4eab\u4e00\u4e0b\u8fd9\u4e2a\u9879\u76ee\u7684\u7531\u6765\u3001\u6211\u7684\u5fc3\u5f97&#xff0c;\u4ee5\u53ca\u4e3a\u4ec0\u4e48\u6211\u89c9\u5f97\u6bcf\u4e2a\u60f3\u6df1\u5165\u638c\u63e1 LangChain \u7684\u5f00\u53d1\u8005\u90fd\u5e94\u8be5\u770b\u770b\u8fd9\u4e2a\u9879\u76ee\u3002<\/p>\n<p>&#x1f4a1; \u5173\u4e8e\u8fd9\u4e2a\u9879\u76ee\u7684\u7279\u522b\u8bf4\u660e&#xff1a;\u672c\u9879\u76ee\u7684\u4e2d\u6587\u6ce8\u91ca\u662f\u5728 Kimi-K2.5&#xff08;\u6708\u4e4b\u6697\u9762\u6700\u65b0\u7248\u5927\u6a21\u578b&#xff09;\u7684\u8f85\u52a9\u4e0b\u5b8c\u6210\u7684\u3002Kimi-K2.5 \u5f3a\u5927\u7684\u4ee3\u7801\u7406\u89e3\u80fd\u529b\u548c\u4e2d\u6587\u8868\u8fbe\u80fd\u529b&#xff0c;\u8ba9\u8fd9\u4e2a\u539f\u672c\u9700\u8981\u6570\u6708\u7684\u5de5\u7a0b\u5728\u77ed\u77ed3\u5929\u5185\u6210\u4e3a\u53ef\u80fd\u3002\u5728\u6b64\u7279\u522b\u611f\u8c22 AI \u6280\u672f\u7684\u8fdb\u6b65&#xff0c;\u8ba9\u77e5\u8bc6\u5206\u4eab\u53d8\u5f97\u66f4\u52a0\u9ad8\u6548\u3002<\/p>\n<hr \/>\n<h3>\u4e3a\u4ec0\u4e48\u6211\u8981\u505a\u8fd9\u4e2a\u9879\u76ee&#xff1f;<\/h3>\n<h4>\u88ab LangChain &#034;\u8650&#034;\u8fc7\u7684\u7ecf\u5386<\/h4>\n<p>\u76f8\u4fe1\u5f88\u591a\u540c\u5b66\u548c\u6211\u4e00\u6837&#xff0c;\u521d\u5b66 LangChain \u65f6\u90fd\u88ab\u5b83\u7684\u6587\u6863&#034;\u5751&#034;\u8fc7&#xff1a;<\/p>\n<ul>\n<li>\u4e2d\u6587\u6587\u6863\u66f4\u65b0\u901f\u5ea6\u8ddf\u4e0d\u4e0a\u4ee3\u7801\u8fed\u4ee3&#xff0c;\u5f88\u591a API \u5df2\u7ecf\u53d8\u4e86&#xff0c;\u6587\u6863\u8fd8\u662f\u65e7\u7684<\/li>\n<li>\u6e90\u7801\u6ce8\u91ca\u5c11\u5f97\u53ef\u601c&#xff0c;\u7ecf\u5e38\u9700\u8981\u7ffb\u6e90\u7801\u624d\u80fd\u7406\u89e3\u4e00\u4e2a\u53c2\u6570\u7684\u4f5c\u7528<\/li>\n<li>\u4e2d\u6587\u8d44\u6599\u8981\u4e48\u592a\u6d45&#xff08;\u53ea\u4f1a\u8bb2 LLMChain&#xff09;&#xff0c;\u8981\u4e48\u592a\u6df1&#xff08;\u76f4\u63a5\u8bb2\u6e90\u7801\u67b6\u6784&#xff09;&#xff0c;\u4e2d\u95f4\u65ad\u5c42\u4e25\u91cd<\/li>\n<li>\u7248\u672c\u5dee\u5f02\u5927&#xff0c;v0.x \u548c v1.x \u7684\u5199\u6cd5\u5b8c\u5168\u4e0d\u540c&#xff0c;\u7f51\u4e0a\u641c\u5230\u7684\u4ee3\u7801\u7ecf\u5e38\u8dd1\u4e0d\u901a<\/li>\n<\/ul>\n<p>\u6211\u81ea\u5df1\u5c31\u8e29\u8fc7\u65e0\u6570\u5751\u3002\u8bb0\u5f97\u6709\u4e00\u6b21&#xff0c;\u6211\u60f3\u81ea\u5b9a\u4e49\u4e00\u4e2a OutputParser&#xff0c;\u7ffb\u904d\u4e86\u4e2d\u6587\u6587\u6863\u90fd\u6ca1\u627e\u5230\u5b8c\u6574\u7684\u793a\u4f8b&#xff0c;\u6700\u540e\u53ea\u80fd\u53bb GitHub Issues \u91cc\u7ffb\u522b\u4eba\u7684\u8ba8\u8bba&#xff0c;\u82b1\u4e86\u6574\u6574\u4e00\u4e0b\u5348\u624d\u641e\u5b9a\u3002<\/p>\n<p>\u90a3\u4e00\u523b\u6211\u5c31\u60f3&#xff1a;\u4e3a\u4ec0\u4e48\u6ca1\u6709\u4eba\u628a LangChain \u7684\u6e90\u7801\u7528\u4e2d\u6587\u8bb2\u6e05\u695a&#xff1f;<\/p>\n<h4>3\u5929\u7684&#034;\u9ad8\u6548\u95ed\u5173&#034;<\/h4>\n<p>\u8bf4\u5e72\u5c31\u5e72\u3002\u4ece3\u5929\u524d\u5f00\u59cb&#xff0c;\u6211\u5f00\u542f\u4e86\u8fd9\u6bb5&#034;\u9ad8\u6548\u95ed\u5173&#034;\u4e4b\u65c5&#xff1a;<\/p>\n<ul>\n<li>\u7b2c1\u5929&#xff1a;\u5229\u7528 Kimi-K2.5 \u7684\u4ee3\u7801\u7406\u89e3\u80fd\u529b&#xff0c;\u5feb\u901f\u901a\u8bfb langchain-core&#xff0c;\u7406\u89e3 Runnable \u63a5\u53e3\u7684\u8bbe\u8ba1\u54f2\u5b66<\/li>\n<li>\u7b2c2\u5929&#xff1a;\u501f\u52a9 Kimi-K2.5 \u7684\u6df1\u5ea6\u5206\u6790&#xff0c;\u6df1\u5165 langchain \u548c langchain_v1&#xff0c;\u68b3\u7406 Agent \u7cfb\u7edf\u7684\u6f14\u8fdb<\/li>\n<li>\u7b2c3\u5929&#xff1a;\u901a\u8fc7 Kimi-K2.5 \u7684\u9ad8\u6548\u751f\u6210\u80fd\u529b&#xff0c;\u6574\u7406 Partners \u5305&#xff0c;\u8865\u5145\u6587\u6863\u548c\u672f\u8bed\u8868<\/li>\n<\/ul>\n<p>\u8fd93\u5929\u91cc&#xff0c;\u6211\u51e0\u4e4e\u662f\u8fde\u8f74\u8f6c\u3002Kimi-K2.5 \u7684\u54cd\u5e94\u901f\u5ea6\u548c\u8d28\u91cf\u8ba9\u6211\u60ca\u53f9\u2014\u2014\u5b83\u80fd\u77ac\u95f4\u7406\u89e3\u590d\u6742\u7684\u4ee3\u7801\u903b\u8f91&#xff0c;\u5e76\u7528\u6d41\u7545\u7684\u4e2d\u6587\u751f\u6210\u4e13\u4e1a\u7684\u6ce8\u91ca\u3002\u6709\u65f6\u5019\u4e3a\u4e86\u9a8c\u8bc1\u4e00\u4e2a\u4e2d\u95f4\u4ef6\u7684\u6267\u884c\u6d41\u7a0b&#xff0c;\u6211\u4f1a\u8ba9 Kimi-K2.5 \u5e2e\u6211\u5206\u6790\u6e90\u7801\u3001\u753b\u6d41\u7a0b\u56fe&#xff0c;\u76f4\u5230\u5f7b\u5e95\u641e\u61c2\u4e3a\u6b62\u3002<\/p>\n<p>\u6700\u7ec8\u6210\u679c&#xff08;\u5728 Kimi-K2.5 \u7684\u8f85\u52a9\u4e0b&#xff0c;\u4ec5\u75283\u5929\u5b8c\u6210&#xff09;&#xff1a;<\/p>\n<ul>\n<li>6\u4e07&#043; \u884c\u4e2d\u6587\u6ce8\u91ca<\/li>\n<li>200&#043; \u4e2a\u672f\u8bed\u5bf9\u7167<\/li>\n<li>14 \u4e2a\u5408\u4f5c\u4f19\u4f34\u5305\u7684\u5b8c\u6574\u89e3\u8bfb<\/li>\n<li>50&#043; \u79cd\u5411\u91cf\u6570\u636e\u5e93\u7684\u4f7f\u7528\u6307\u5357<\/li>\n<\/ul>\n<hr \/>\n<h3>\u8fd9\u4e2a\u9879\u76ee\u80fd\u5e2e\u4f60\u4ec0\u4e48&#xff1f;<\/h3>\n<h4>1. \u6e90\u7801\u4e0e\u6ce8\u91ca\u5bf9\u7167\u5b66\u4e60<\/h4>\n<p>\u6211\u91c7\u7528\u4e86\u53cc\u76ee\u5f55\u7ed3\u6784&#xff1a;<\/p>\n<p>langchain_code_comment\/<br \/>\n\u251c\u2500\u2500 langchain_code\/     # \u539f\u59cb\u6e90\u7801&#xff08;\u4e0e\u5b98\u65b9 v1.2.7 \u540c\u6b65&#xff09;<br \/>\n\u251c\u2500\u2500 code_comment\/       # \u6211\u7684\u4e2d\u6587\u6ce8\u91ca&#xff08;\u76ee\u5f55\u7ed3\u6784\u5b8c\u5168\u4e00\u81f4&#xff09;<br \/>\n\u2514\u2500\u2500 docs\/              # \u8f85\u52a9\u6587\u6863<\/p>\n<p>\u600e\u4e48\u4f7f\u7528&#xff1f;<\/p>\n<p>\u6bd4\u5982\u4f60\u60f3\u7406\u89e3 Runnable \u63a5\u53e3&#xff0c;\u53ef\u4ee5&#xff1a;<\/p>\n<li>\u6253\u5f00 code_comment\/libs\/core\/langchain_core\/runnables\/base.md<\/li>\n<li>\u9605\u8bfb\u6211\u7684\u4e2d\u6587\u6ce8\u91ca&#xff0c;\u7406\u89e3\u8bbe\u8ba1\u601d\u8def<\/li>\n<li>\u5bf9\u7167 langchain_code\/libs\/core\/langchain_core\/runnables\/base.py \u770b\u5177\u4f53\u5b9e\u73b0<\/li>\n<p>\u8fd9\u79cd&#034;\u6ce8\u91ca&#043;\u6e90\u7801&#034;\u7684\u5bf9\u7167\u65b9\u5f0f&#xff0c;\u6bd4\u5355\u7eaf\u770b\u6587\u6863\u6216\u5355\u7eaf\u8bfb\u6e90\u7801\u90fd\u8981\u9ad8\u6548\u5f97\u591a\u3002<\/p>\n<h4>2. \u7248\u672c\u6f14\u8fdb\u4e00\u76ee\u4e86\u7136<\/h4>\n<p>LangChain \u7684\u67b6\u6784\u7ecf\u5386\u4e86\u591a\u6b21\u91cd\u5927\u91cd\u6784&#xff0c;\u6211\u5728\u6ce8\u91ca\u4e2d\u7279\u522b\u6807\u6ce8\u4e86&#xff1a;<\/p>\n<ul>\n<li>v0.x \u65f6\u4ee3\u7684\u5199\u6cd5&#xff1a;\u6bd4\u5982 LLMChain, SimpleSequentialChain<\/li>\n<li>v1.0 \u7684\u65b0\u65b9\u5f0f&#xff1a;LCEL \u8868\u8fbe\u5f0f&#xff0c;Runnable \u63a5\u53e3<\/li>\n<li>v1.0&#043; \u7684\u589e\u5f3a&#xff1a;Agent \u4e2d\u95f4\u4ef6\u67b6\u6784&#xff08;v1.0 \u9996\u6b21\u5f15\u5165&#xff0c;v1.1\/v1.2 \u6301\u7eed\u4f18\u5316&#xff09;<\/li>\n<\/ul>\n<p>\u4e3e\u4e2a\u4f8b\u5b50&#xff0c;\u540c\u6837\u662f\u5b9e\u73b0\u4e00\u4e2a\u94fe&#xff1a;<\/p>\n<p><span class=\"token comment\"># v0.x \u5199\u6cd5&#xff08;\u5df2\u5f03\u7528&#xff09;<\/span><br \/>\n<span class=\"token keyword\">from<\/span> langchain <span class=\"token keyword\">import<\/span> LLMChain<span class=\"token punctuation\">,<\/span> PromptTemplate<br \/>\nprompt <span class=\"token operator\">&#061;<\/span> PromptTemplate<span class=\"token punctuation\">(<\/span>template<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;&#8230;&#034;<\/span><span class=\"token punctuation\">)<\/span><br \/>\nchain <span class=\"token operator\">&#061;<\/span> LLMChain<span class=\"token punctuation\">(<\/span>llm<span class=\"token operator\">&#061;<\/span>llm<span class=\"token punctuation\">,<\/span> prompt<span class=\"token operator\">&#061;<\/span>prompt<span class=\"token punctuation\">)<\/span><\/p>\n<p><span class=\"token comment\"># v1.0&#043; \u5199\u6cd5&#xff08;\u63a8\u8350&#xff09;<\/span><br \/>\n<span class=\"token keyword\">from<\/span> langchain_core<span class=\"token punctuation\">.<\/span>prompts <span class=\"token keyword\">import<\/span> PromptTemplate<br \/>\nprompt <span class=\"token operator\">&#061;<\/span> PromptTemplate<span class=\"token punctuation\">.<\/span>from_template<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;&#8230;&#034;<\/span><span class=\"token punctuation\">)<\/span><br \/>\nchain <span class=\"token operator\">&#061;<\/span> prompt <span class=\"token operator\">|<\/span> llm  <span class=\"token comment\"># LCEL \u8868\u8fbe\u5f0f&#xff0c;\u7b80\u6d01\u76f4\u89c2<\/span><\/p>\n<p>\u5728\u6211\u7684\u6ce8\u91ca\u4e2d&#xff0c;\u4f60\u4f1a\u770b\u5230\u4e3a\u4ec0\u4e48\u4f1a\u6709\u8fd9\u6837\u7684\u53d8\u5316&#xff0c;\u4ee5\u53ca\u65b0\u65b9\u5f0f\u7684\u4f18\u52bf\u5728\u54ea\u91cc\u3002<\/p>\n<h4>3. 200&#043; \u672f\u8bed\u5bf9\u7167\u8868<\/h4>\n<p>\u505a\u8fd9\u4e2a\u9879\u76ee\u7684\u8fc7\u7a0b\u4e2d&#xff0c;\u6211\u53d1\u73b0\u672f\u8bed\u7ffb\u8bd1\u662f\u4e00\u4e2a\u5927\u95ee\u9898\u3002\u540c\u4e00\u4e2a\u6982\u5ff5&#xff0c;\u4e0d\u540c\u7684\u4eba\u7ffb\u8bd1\u53ef\u80fd\u5b8c\u5168\u4e0d\u540c&#xff1a;<\/p>\n<ul>\n<li>Runnable \u6709\u4eba\u53eb&#034;\u53ef\u8fd0\u884c\u5bf9\u8c61&#034;&#xff0c;\u6709\u4eba\u53eb&#034;\u53ef\u8fd0\u884c\u7ec4\u4ef6&#034;<\/li>\n<li>Retriever \u6709\u4eba\u53eb&#034;\u68c0\u7d22\u5668&#034;&#xff0c;\u6709\u4eba\u53eb&#034;\u53ec\u56de\u5668&#034;<\/li>\n<li>Embedding \u6709\u4eba\u53eb&#034;\u5d4c\u5165&#034;&#xff0c;\u6709\u4eba\u53eb&#034;\u5411\u91cf\u5316&#034;<\/li>\n<\/ul>\n<p>\u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898&#xff0c;\u6211\u6574\u7406\u4e86\u4e00\u4efd\u5b8c\u6574\u7684 TERMINOLOGY.md&#xff0c;\u5305\u542b&#xff1a;<\/p>\n<ul>\n<li>\u6838\u5fc3\u6982\u5ff5&#xff08;Chain\u3001Agent\u3001Runnable\u3001LCEL&#xff09;<\/li>\n<li>\u67b6\u6784\u8bbe\u8ba1&#xff08;Middleware\u3001Pipeline\u3001DAG&#xff09;<\/li>\n<li>\u6a21\u578b\u76f8\u5173&#xff08;Token\u3001Temperature\u3001Function Calling&#xff09;<\/li>\n<li>\u5411\u91cf\u68c0\u7d22&#xff08;Embedding\u3001Vector Store\u3001Reranking&#xff09;<\/li>\n<\/ul>\n<p>\u6bcf\u4e2a\u672f\u8bed\u90fd\u7ed9\u51fa\u4e86\u63a8\u8350\u7684\u4e2d\u6587\u7ffb\u8bd1\u548c\u8be6\u7ec6\u7684\u89e3\u91ca&#xff0c;\u786e\u4fdd\u4f60\u5728\u9605\u8bfb\u6ce8\u91ca\u65f6\u4e0d\u4f1a\u56f0\u60d1\u3002<\/p>\n<hr \/>\n<h3>\u6838\u5fc3\u6a21\u5757\u89e3\u8bfb\u793a\u4f8b<\/h3>\n<h4>LCEL&#xff1a;LangChain \u7684&#034;\u7ba1\u9053\u8bed\u6cd5&#034;<\/h4>\n<p>LCEL&#xff08;LangChain Expression Language&#xff09;\u662f v1.0 \u6700\u91cd\u8981\u7684\u521b\u65b0\u3002\u5b83\u7684\u6838\u5fc3\u601d\u60f3\u662f&#xff1a;\u6240\u6709\u7ec4\u4ef6\u90fd\u5b9e\u73b0\u7edf\u4e00\u7684 Runnable \u63a5\u53e3&#xff0c;\u901a\u8fc7 | \u64cd\u4f5c\u7b26\u8fde\u63a5\u3002<\/p>\n<p><span class=\"token keyword\">from<\/span> langchain_core<span class=\"token punctuation\">.<\/span>prompts <span class=\"token keyword\">import<\/span> PromptTemplate<br \/>\n<span class=\"token keyword\">from<\/span> langchain_core<span class=\"token punctuation\">.<\/span>runnables <span class=\"token keyword\">import<\/span> RunnableLambda<\/p>\n<p><span class=\"token comment\"># \u5b9a\u4e49\u63d0\u793a\u8bcd\u6a21\u677f<\/span><br \/>\nprompt <span class=\"token operator\">&#061;<\/span> PromptTemplate<span class=\"token punctuation\">.<\/span>from_template<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\u8bb2\u4e00\u4e2a\u5173\u4e8e {topic} \u7684\u7b11\u8bdd&#034;<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p><span class=\"token comment\"># \u5b9a\u4e49\u5904\u7406\u903b\u8f91<\/span><br \/>\nadd_prefix <span class=\"token operator\">&#061;<\/span> RunnableLambda<span class=\"token punctuation\">(<\/span><span class=\"token keyword\">lambda<\/span> x<span class=\"token punctuation\">:<\/span> <span class=\"token string-interpolation\"><span class=\"token string\">f&#034;AI \u52a9\u624b\u56de\u7b54&#xff1a;\\\\n<\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span>x<span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\">&#034;<\/span><\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p><span class=\"token comment\"># \u4f7f\u7528\u7ba1\u9053\u64cd\u4f5c\u7b26\u7ec4\u5408 &#8211; \u5c31\u50cf Linux \u7ba1\u9053\u4e00\u6837\u76f4\u89c2&#xff01;<\/span><br \/>\nchain <span class=\"token operator\">&#061;<\/span> prompt <span class=\"token operator\">|<\/span> llm <span class=\"token operator\">|<\/span> add_prefix<\/p>\n<p><span class=\"token comment\"># \u8c03\u7528<\/span><br \/>\nresult <span class=\"token operator\">&#061;<\/span> chain<span class=\"token punctuation\">.<\/span>invoke<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">{<\/span><span class=\"token string\">&#034;topic&#034;<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#034;\u7a0b\u5e8f\u5458&#034;<\/span><span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>\u4e3a\u4ec0\u4e48\u8981\u8fd9\u6837\u8bbe\u8ba1&#xff1f;<\/p>\n<p>\u6211\u5728\u6ce8\u91ca\u4e2d\u8be6\u7ec6\u5206\u6790\u4e86 LCEL \u7684\u4f18\u52bf&#xff1a;<\/p>\n<li>\u7edf\u4e00\u63a5\u53e3&#xff1a;\u6240\u6709\u7ec4\u4ef6\u90fd\u5b9e\u73b0 invoke()\u3001batch()\u3001stream() \u65b9\u6cd5&#xff0c;\u5b66\u4e60\u6210\u672c\u5927\u5e45\u964d\u4f4e<\/li>\n<li>\u81ea\u52a8\u4f18\u5316&#xff1a;\u6846\u67b6\u4f1a\u81ea\u52a8\u5e76\u884c\u6267\u884c\u72ec\u7acb\u7684\u6b65\u9aa4&#xff0c;\u81ea\u52a8\u5904\u7406\u6279\u5904\u7406\u548c\u6d41\u5f0f\u8f93\u51fa<\/li>\n<li>\u7c7b\u578b\u5b89\u5168&#xff1a;\u5b8c\u6574\u7684\u7c7b\u578b\u63d0\u793a\u652f\u6301&#xff0c;IDE \u53ef\u4ee5\u7ed9\u51fa\u51c6\u786e\u7684\u4ee3\u7801\u8865\u5168<\/li>\n<li>\u53ef\u89c2\u6d4b\u6027&#xff1a;\u5185\u7f6e\u56de\u8c03\u673a\u5236&#xff0c;\u53ef\u4ee5\u8f7b\u677e\u63a5\u5165 LangSmith \u8fdb\u884c\u76d1\u63a7<\/li>\n<h4>Agent \u4e2d\u95f4\u4ef6\u67b6\u6784<\/h4>\n<p>LangChain v1.0&#xff08;2025 \u5e74 10 \u6708 22 \u65e5\u53d1\u5e03&#xff09;\u5bf9 Agent \u7cfb\u7edf\u8fdb\u884c\u4e86\u91cd\u6784&#xff0c;\u9996\u6b21\u5f15\u5165\u4e86**\u4e2d\u95f4\u4ef6&#xff08;Middleware&#xff09;**\u6982\u5ff5\u3002\u8fd9\u5176\u5b9e\u662f\u501f\u9274\u4e86 Web \u5f00\u53d1\u4e2d\u7684\u4e2d\u95f4\u4ef6\u6a21\u5f0f&#xff1a;<\/p>\n<p><span class=\"token keyword\">from<\/span> langchain<span class=\"token punctuation\">.<\/span>agents<span class=\"token punctuation\">.<\/span>middleware <span class=\"token keyword\">import<\/span> <span class=\"token punctuation\">(<\/span><br \/>\n    ToolCallLimitMiddleware<span class=\"token punctuation\">,<\/span><br \/>\n    ToolRetryMiddleware<br \/>\n<span class=\"token punctuation\">)<\/span><\/p>\n<p><span class=\"token comment\"># \u521b\u5efa\u4e2d\u95f4\u4ef6<\/span><br \/>\nlimit_middleware <span class=\"token operator\">&#061;<\/span> ToolCallLimitMiddleware<span class=\"token punctuation\">(<\/span>max_calls<span class=\"token operator\">&#061;<\/span><span class=\"token number\">5<\/span><span class=\"token punctuation\">)<\/span>  <span class=\"token comment\"># \u9650\u5236\u6700\u591a\u8c03\u75285\u4e2a\u5de5\u5177<\/span><br \/>\nretry_middleware <span class=\"token operator\">&#061;<\/span> ToolRetryMiddleware<span class=\"token punctuation\">(<\/span>max_retries<span class=\"token operator\">&#061;<\/span><span class=\"token number\">3<\/span><span class=\"token punctuation\">)<\/span>      <span class=\"token comment\"># \u5931\u8d25\u81ea\u52a8\u91cd\u8bd53\u6b21<\/span><\/p>\n<p><span class=\"token comment\"># \u7ec4\u5408\u5230 Agent<\/span><br \/>\nagent <span class=\"token operator\">&#061;<\/span> create_openai_functions_agent<span class=\"token punctuation\">(<\/span><br \/>\n    llm<span class=\"token operator\">&#061;<\/span>llm<span class=\"token punctuation\">,<\/span><br \/>\n    tools<span class=\"token operator\">&#061;<\/span>tools<span class=\"token punctuation\">,<\/span><br \/>\n    middleware<span class=\"token operator\">&#061;<\/span><span class=\"token punctuation\">[<\/span>limit_middleware<span class=\"token punctuation\">,<\/span> retry_middleware<span class=\"token punctuation\">]<\/span>  <span class=\"token comment\"># \u6309\u987a\u5e8f\u6267\u884c<\/span><br \/>\n<span class=\"token punctuation\">)<\/span><\/p>\n<p>\u6267\u884c\u6d41\u7a0b&#xff1a;<\/p>\n<p>\u7528\u6237\u8f93\u5165<br \/>\n    \u2193<br \/>\nToolCallLimitMiddleware&#xff08;\u68c0\u67e5\u8c03\u7528\u6b21\u6570&#xff09;<br \/>\n    \u2193<br \/>\nToolRetryMiddleware&#xff08;\u5305\u88c5\u5de5\u5177\u8c03\u7528&#xff0c;\u5904\u7406\u5f02\u5e38&#xff09;<br \/>\n    \u2193<br \/>\n\u5de5\u5177\u5b9e\u9645\u6267\u884c<br \/>\n    \u2193<br \/>\n\u8fd4\u56de\u7ed3\u679c&#xff08;\u9006\u5411\u7ecf\u8fc7\u4e2d\u95f4\u4ef6&#xff09;<\/p>\n<p>\u8fd9\u79cd\u8bbe\u8ba1\u7684\u597d\u5904\u662f\u5173\u6ce8\u70b9\u5206\u79bb&#xff1a;\u6bcf\u4e2a\u4e2d\u95f4\u4ef6\u53ea\u8d1f\u8d23\u4e00\u4ef6\u4e8b&#xff0c;\u4ee3\u7801\u66f4\u6e05\u6670&#xff0c;\u4e5f\u66f4\u5bb9\u6613\u6d4b\u8bd5\u3002<\/p>\n<p>\u5728\u6211\u7684\u6ce8\u91ca\u4e2d&#xff0c;\u6211\u9010\u884c\u5206\u6790\u4e86\u4e2d\u95f4\u4ef6\u7684\u5b9e\u73b0\u539f\u7406&#xff0c;\u5305\u62ec&#xff1a;<\/p>\n<ul>\n<li>\u4e2d\u95f4\u4ef6\u7684\u6ce8\u518c\u673a\u5236<\/li>\n<li>\u8bf7\u6c42\u548c\u54cd\u5e94\u7684\u5904\u7406\u6d41\u7a0b<\/li>\n<li>\u5f02\u5e38\u5904\u7406\u7684\u6700\u4f73\u5b9e\u8df5<\/li>\n<\/ul>\n<hr \/>\n<h3>\u6211\u7684\u5b66\u4e60\u5fc3\u5f97<\/h3>\n<h4>1. \u8bfb\u6e90\u7801\u662f\u6700\u597d\u7684\u5b66\u4e60\u65b9\u5f0f<\/h4>\n<p>\u8fd93\u5929\u7684\u9ad8\u5f3a\u5ea6\u5b66\u4e60\u8ba9\u6211\u6df1\u523b\u4f53\u4f1a\u5230&#xff1a;\u8bfb\u6e90\u7801\u6bd4\u770b\u6587\u6863\u66f4\u80fd\u7406\u89e3\u4e00\u4e2a\u6846\u67b6\u3002<\/p>\n<p>\u6587\u6863\u4f1a\u544a\u8bc9\u4f60&#034;\u600e\u4e48\u7528&#034;&#xff0c;\u4f46\u6e90\u7801\u4f1a\u544a\u8bc9\u4f60&#034;\u4e3a\u4ec0\u4e48\u8fd9\u6837\u8bbe\u8ba1&#034;\u3002\u5f53\u4f60\u7406\u89e3\u4e86\u8bbe\u8ba1\u8005\u7684\u601d\u8def&#xff0c;\u4f7f\u7528\u8d77\u6765\u5c31\u4f1a\u5f97\u5fc3\u5e94\u624b\u3002<\/p>\n<h4>2. \u4e0d\u8981\u505c\u7559\u5728&#034;\u8c03\u5305\u4fa0&#034;\u9636\u6bb5<\/h4>\n<p>\u5f88\u591a\u540c\u5b66\u5b66\u4e60 LangChain \u7684\u65b9\u5f0f\u662f&#xff1a;\u590d\u5236\u4e00\u6bb5\u4ee3\u7801&#xff0c;\u6539\u6539\u53c2\u6570&#xff0c;\u8dd1\u901a\u5c31\u5b8c\u4e8b\u3002<\/p>\n<p>\u8fd9\u79cd\u65b9\u5f0f\u77ed\u671f\u5185\u53ef\u4ee5\u5feb\u901f\u51fa\u6210\u679c&#xff0c;\u4f46\u9047\u5230\u590d\u6742\u9700\u6c42\u5c31\u4f1a\u675f\u624b\u65e0\u7b56\u3002\u53ea\u6709\u6df1\u5165\u7406\u89e3\u5e95\u5c42\u539f\u7406&#xff0c;\u624d\u80fd\u7075\u6d3b\u5e94\u5bf9\u5404\u79cd\u573a\u666f\u3002<\/p>\n<h4>3. \u4e2d\u6587\u793e\u533a\u9700\u8981\u66f4\u591a\u4f18\u8d28\u5185\u5bb9<\/h4>\n<p>\u5728 Kimi-K2.5 \u8f85\u52a9\u6211\u5b8c\u6210\u8fd9\u4e2a\u9879\u76ee\u7684\u8fc7\u7a0b\u4e2d&#xff0c;\u6211\u53d1\u73b0\u4e2d\u6587\u793e\u533a\u7684 LangChain \u8d44\u6599\u786e\u5b9e\u6bd4\u8f83\u532e\u4e4f\u3002\u5927\u90e8\u5206\u6559\u7a0b\u505c\u7559\u5728\u5165\u95e8\u7ea7\u522b&#xff0c;\u6df1\u5165\u6e90\u7801\u7684\u5f88\u5c11\u3002<\/p>\n<p>\u5e0c\u671b\u6211\u548c Kimi-K2.5 \u5171\u540c\u5b8c\u6210\u7684\u8fd9\u4e2a\u9879\u76ee\u80fd\u586b\u8865\u8fd9\u4e2a\u7a7a\u767d&#xff0c;\u5e2e\u52a9\u66f4\u591a\u4e2d\u6587\u5f00\u53d1\u8005\u638c\u63e1 LangChain\u3002<\/p>\n<hr \/>\n<h3>\u5982\u4f55\u53c2\u4e0e\u8fd9\u4e2a\u9879\u76ee&#xff1f;<\/h3>\n<p>\u8fd9\u4e2a\u9879\u76ee\u662f\u5b8c\u5168\u5f00\u6e90\u7684&#xff0c;\u6b22\u8fce\u5927\u5bb6\u53c2\u4e0e&#xff1a;<\/p>\n<h4>1. \u5b8c\u5584\u6ce8\u91ca<\/h4>\n<ul>\n<li>\u6709\u4e9b\u6a21\u5757\u6211\u8fd8\u6ca1\u6765\u5f97\u53ca\u6ce8\u91ca&#xff0c;\u6b22\u8fce\u8865\u5145<\/li>\n<li>\u53d1\u73b0\u6ce8\u91ca\u6709\u9519\u8bef\u6216\u4e0d\u6e05\u6670\u7684\u5730\u65b9&#xff0c;\u6b22\u8fce\u6307\u6b63<\/li>\n<\/ul>\n<h4>2. \u5206\u4eab\u4f7f\u7528\u7ecf\u9a8c<\/h4>\n<ul>\n<li>\u4f60\u5728\u4f7f\u7528 LangChain \u65f6\u8e29\u8fc7\u4ec0\u4e48\u5751&#xff1f;<\/li>\n<li>\u6709\u4ec0\u4e48\u6700\u4f73\u5b9e\u8df5\u60f3\u5206\u4eab&#xff1f;<\/li>\n<li>\u6b22\u8fce\u5728 Issue \u4e2d\u8ba8\u8bba<\/li>\n<\/ul>\n<h4>3. \u63a8\u5e7f\u9879\u76ee<\/h4>\n<ul>\n<li>\u5982\u679c\u89c9\u5f97\u8fd9\u4e2a\u9879\u76ee\u5bf9\u4f60\u6709\u5e2e\u52a9&#xff0c;\u8bf7\u7ed9\u4e2a \u2b50<\/li>\n<li>\u5206\u4eab\u7ed9\u4f60\u7684\u670b\u53cb\u548c\u540c\u4e8b<\/li>\n<li>\u5728\u4f60\u7684\u6280\u672f\u535a\u5ba2\u6216\u516c\u4f17\u53f7\u4e2d\u63a8\u8350<\/li>\n<\/ul>\n<hr \/>\n<h3>\u5199\u5728\u6700\u540e<\/h3>\n<p>\u77ed\u77ed3\u5929\u65f6\u95f4&#xff0c;\u5728 Kimi-K2.5 \u7684\u8f85\u52a9\u4e0b\u5b8c\u6210\u4e866\u4e07\u884c\u6ce8\u91ca&#xff0c;\u8fd9\u4e2a\u6548\u7387\u5728\u4f20\u7edf\u5f00\u53d1\u6a21\u5f0f\u4e0b\u662f\u96be\u4ee5\u60f3\u8c61\u7684\u3002\u4f46\u6bcf\u5f53\u60f3\u5230\u80fd\u5e2e\u52a9\u66f4\u591a\u5f00\u53d1\u8005\u5c11\u8d70\u5f2f\u8def&#xff0c;\u6211\u5c31\u89c9\u5f97\u4e00\u5207\u90fd\u662f\u503c\u5f97\u7684\u3002<\/p>\n<p>&#x1f916; AI \u65f6\u4ee3\u7684\u77e5\u8bc6\u5206\u4eab&#xff1a;\u8fd9\u4e2a\u9879\u76ee\u7684\u8bde\u751f\u79bb\u4e0d\u5f00 Kimi-K2.5 \u7684\u5f3a\u5927\u80fd\u529b\u3002\u4f5c\u4e3a\u6708\u4e4b\u6697\u9762\u6700\u65b0\u4e00\u4ee3\u7684\u5927\u6a21\u578b&#xff0c;Kimi-K2.5 \u5728\u4ee3\u7801\u7406\u89e3\u548c\u4e2d\u6587\u8868\u8fbe\u65b9\u9762\u8868\u73b0\u51fa\u8272\u3002\u5b83\u4e0d\u4ec5\u80fd\u77ac\u95f4\u7406\u89e3\u590d\u6742\u7684\u4ee3\u7801\u903b\u8f91&#xff0c;\u8fd8\u80fd\u7528\u6d41\u7545\u3001\u4e13\u4e1a\u7684\u4e2d\u6587\u8fdb\u884c\u8868\u8fbe\u3002\u8fd9\u79cd\u4eba\u673a\u534f\u4f5c\u7684\u6a21\u5f0f&#xff0c;\u8ba9\u6211\u6df1\u523b\u4f53\u4f1a\u5230 AI \u5bf9\u5f00\u53d1\u8005\u6548\u7387\u7684\u98a0\u8986\u6027\u63d0\u5347\u3002\u539f\u672c\u9700\u8981\u6570\u6708\u7684\u5de5\u7a0b&#xff0c;\u73b0\u5728\u51e0\u5929\u5c31\u80fd\u5b8c\u6210\u3002\u6211\u76f8\u4fe1&#xff0c;\u672a\u6765\u7684\u5f00\u6e90\u793e\u533a\u4f1a\u6709\u8d8a\u6765\u8d8a\u591a\u8fd9\u6837\u7684&#034;AI \u8f85\u52a9\u9879\u76ee&#034;\u51fa\u73b0\u3002<\/p>\n<p>LangChain \u662f\u4e00\u4e2a\u5f3a\u5927\u800c\u590d\u6742\u7684\u6846\u67b6&#xff0c;\u6df1\u5165\u7406\u89e3\u5b83\u9700\u8981\u65f6\u95f4\u548c\u8010\u5fc3\u3002\u5e0c\u671b\u6211\u548c Kimi-K2.5 \u5171\u540c\u5b8c\u6210\u7684\u8fd9\u4e2a\u9879\u76ee\u80fd\u6210\u4e3a\u4f60\u5b66\u4e60\u8def\u4e0a\u7684&#034;\u52a0\u901f\u5668&#034;\u3002<\/p>\n<p>\u6700\u540e&#xff0c;\u518d\u6b21\u653e\u51fa\u9879\u76ee\u5730\u5740&#xff1a;<\/p>\n<ul>\n<li>&#x1f419; GitHub&#xff1a;https:\/\/github.com\/xt765\/LangChain-Chinese-Comment<\/li>\n<li>&#x1f534; Gitee&#xff1a;https:\/\/gitee.com\/xt765\/LangChain-Chinese-Comment&#xff08;\u56fd\u5185\u8bbf\u95ee\u66f4\u5feb&#xff09;<\/li>\n<\/ul>\n<p>\u5982\u679c\u4f60\u6709\u4efb\u4f55\u95ee\u9898\u6216\u5efa\u8bae&#xff0c;\u6b22\u8fce\u901a\u8fc7\u4ee5\u4e0b\u65b9\u5f0f\u8054\u7cfb\u6211&#xff1a;<\/p>\n<ul>\n<li>CSDN \u535a\u5ba2&#xff1a;https:\/\/blog.csdn.net\/Yunyi_Chi<\/li>\n<li>GitHub Issues<\/li>\n<\/ul>\n<p>\u8ba9\u6211\u4eec\u4e00\u8d77&#xff0c;\u628a LangChain \u7684\u4e2d\u6587\u5b66\u4e60\u751f\u6001\u505a\u5f97\u66f4\u597d&#xff01;<\/p>\n<hr \/>\n<p>\u5173\u4e8e\u6211&#xff1a;\u7384\u540c765&#xff08;xt765&#xff09;&#xff0c;AI \u5e94\u7528\u5f00\u53d1\u5de5\u7a0b\u5e08&#xff0c;\u4e13\u6ce8\u4e8e LLM \u5e94\u7528\u67b6\u6784\u8bbe\u8ba1\u3002\u70ed\u7231\u5f00\u6e90&#xff0c;\u76f8\u4fe1\u6280\u672f\u5206\u4eab\u7684\u529b\u91cf\u3002\u540c\u65f6\u4e5f\u662f Kimi-K2.5 \u7684\u91cd\u5ea6\u7528\u6237&#xff0c;\u81f4\u529b\u4e8e\u63a2\u7d22 AI \u8f85\u52a9\u5f00\u53d1\u7684\u6700\u4f73\u5b9e\u8df5\u3002<\/p>\n<p>\u672c\u6587\u9996\u53d1\u4e8e CSDN&#xff0c;\u8f6c\u8f7d\u8bf7\u6ce8\u660e\u51fa\u5904\u3002 \u7801\u6ce8\u91ca\u9879\u76ee<\/p>\n<p>\u9879\u76ee\u5730\u5740&#xff1a;<\/p>\n<ul>\n<li>GitHub&#xff1a;https:\/\/github.com\/xt765\/LangChain-Chinese-Comment<\/li>\n<li>Gitee&#xff1a;https:\/\/gitee.com\/xt765\/LangChain-Chinese-Comment<\/li>\n<\/ul>\n<h3>\u5f15\u8a00<\/h3>\n<p>\u521a\u521a\u5728\u5927\u7684\u8bed\u5929\u578b&#xff08;LLM&#xff09;\u5e94\u7528\u5f00\u53d1\u9886\u57df&#xff0c;L\u5728 AI \u52a9\u624b Kimi-K2.5 \u7684\u5e2e\u52a9\u4e0b&#xff0c;angChain \u5df2\u7ecf\u6210\u4e3a\u4e8b\u5b9e\u4e0a\u7684\u6807\u51c6\u6846\u67b6\u3002\u4ece\u6574\u7406\u51fa\u7684\u63d0\u793a\u8bcd\u6a21\u677f\u5230\u590d\u6742\u7684\u667a\u80fd\u4f53\u7cfb\u7edf&#xff0c;LangChain \u63d0\u4f9b\u4e86\u4e00\u5957\u5b8c\u6574\u7684\u5de5\u5177\u94fe\u3002\u7136\u800c&#xff0c;\u5bf9\u4e8e\u8bb8\u591a\u4e2d\u6587\u5f00\u53d1\u8005\u6765\u8bf4&#xff0c;\u6df1\u5165\u7406\u89e3\u5176\u6e90\u7801\u5374\u662f\u4e00\u9879\u8270\u5de8\u7684\u4efb\u52a1\u2014\u2014\u5b98\u65b9\u6587\u6863\u4ee5\u82f1\u6587\u4e3a\u4e3b&#xff0c;\u6e90\u7801\u6ce8\u91ca\u7a00\u758f&#xff0c;\u67b6\u6784\u8bbe\u8ba1\u590d\u6742\u3002<\/p>\n<p>\u4eca\u5929&#xff0c;\u6211\u8981\u5411\u5927\u5bb6\u4ecb\u7ecd\u4e00\u4e2a\u4e13\u4e3a\u4e2d\u6587\u5f00\u53d1\u8005\u6253\u9020\u7684\u5f00\u6e90\u9879\u76ee&#xff1a;LangChain-Chinese-Comment\u3002\u8fd9\u4e2a\u9879\u3002<\/p>\n<p>&#x1f4a1; \u5173\u4e8e\u8fd9\u4e2a\u9879\u76ee\u7684\u7279\u522b\u8bf4\u660e&#xff1a;\u672c\u9879\u76ee\u7684\u4e2d\u6587\u6ce8\u91ca\u662f\u5728 Kimi-K2.5&#xff08;\u6708\u4e4b\u6697\u9762\u6700\u65b0\u7248\u5927\u6a21\u578b&#xff09;\u7684\u8f85\u52a9\u4e0b\u5b8c\u6210\u7684\u3002Kimi-K2.5 \u5f3a\u5927\u7684\u4ee3\u7801\u7406\u89e3\u80fd\u529b\u548c\u4e2d\u6587\u8868\u8fbe\u80fd\u529b&#xff0c;\u8ba9\u8fd9\u4e2a\u539f\u672c\u9700\u8981\u6570\u6708\u7684\u5de5\u7a0b\u5728\u77ed\u77ed3\u5929\u5185\u6210\u4e3a\u53ef\u80fd\u3002\u5728\u6b64\u7279\u522b\u611f\u8c22 AI \u6280\u672f\u7684\u8fdb\u6b65&#xff0c;\u8ba9\u77e5\u8bc6\u5206\u4eab\u53d8\u5f97\u66f4\u52a0\u9ad8\u6548\u76ee\u901a\u8fc7\u7cfb\u7edf\u6027\u5730\u6574\u7406\u6838\u5fc3\u6a21\u5757\u7684\u4e2d\u6587\u6ce8\u91ca&#xff0c;\u5e2e\u52a9\u5f00\u53d1\u8005\u6df1\u5165\u7406\u89e3 LangChain \u7684\u5b9e\u73b0\u539f\u7406\u3001\u8bbe\u8ba1\u601d\u60f3\u53ca\u6700\u4f73\u5b9e\u8df5\u3002<\/p>\n<p>\u53cc\u5e73\u53f0\u8bbf\u95ee&#xff1a;<\/p>\n<ul>\n<li>&#x1f419; GitHub \u4ed3\u5e93 &#8211; \u56fd\u9645\u8bbf\u95ee<\/li>\n<li>&#x1f534; Gitee \u955c\u50cf &#8211; \u56fd\u5185\u52a0\u901f\u8bbf\u95ee<\/li>\n<\/ul>\n<h3>\u4e3a\u4ec0\u4e48\u9700\u8981\u8fd9\u4e2a\u9879\u76ee&#xff1f;<\/h3>\n<h4>1. \u6e90\u7801\u590d\u6742\u5ea6\u4e0e\u6587\u6863\u7a00\u7f3a\u6027\u7684\u77db\u76fe<\/h4>\n<p>La\u4e2d\u6587Chain \u4f5c\u4e3a\u4e00\u4e2a\u5feb\u901f\u53d1\u5c55\u7684\u5f00\u6e90\u9879\u76ee&#xff0c;\u5176\u67b6\u6784\u7ecf\u5386\u4e86\u591a\u6b21\u91cd\u5927\u91cd\u6784&#xff1a;<\/p>\n<ul>\n<li>v0.x \u65f6\u4ee3&#xff1a;\u4ee5 Chain \u4e3a\u6838\u5fc3\u6982\u5ff5&#xff0c;\u7ec4\u4ef6\u4e4b\u95f4\u8026\u5408\u5ea6\u8f83\u9ad8<\/li>\n<li>v1.0 \u65f6\u4ee3&#xff1a;\u5f15\u5165 LCEL&#xff08;LangChain Expression Language&#xff09;&#xff0c;\u4ee5 Runnable \u63a5\u53e3\u4e3a\u57fa\u7840&#xff0c;\u5b9e\u73b0\u4e86\u771f\u6b63\u7684\u6a21\u5757\u5316\u7ec4\u5408<\/li>\n<li>v1.2&#043; \u65f6\u4ee3&#xff1a;\u5f3a\u5316\u667a\u80fd\u4f53&#xff08;Agent&#xff09;\u7cfb\u7edf&#xff0c;\u5f15\u5165\u4e2d\u95f4\u4ef6\u67b6\u6784&#xff0c;\u652f\u6301\u66f4\u590d\u6742\u7684\u4e1a\u52a1\u573a\u666f \u4e00\u4e0b\u5348\u6587\u4e2d \u8fd9\u79cd\u5feb\u901f\u6f14\u8fdb\u5e26\u6765\u4e86\u9661\u5ced\u7684\u5b66\u4e60\u66f2\u7ebf\u3002\u5b98\u65b9\u6587\u6863\u867d\u7136\u8be6\u5c3d&#xff0c;\u4f46\u5f80\u5f80\u6ede\u540e\u4e8e\u4ee3\u7801\u66f4\u65b0&#xff1b;\u6e90\u7801\u6ce8\u91ca\u53c8\u76f8\u5bf9\u7a00\u758f&#xff0c;\u5f88\u591a\u8bbe\u8ba1\u610f\u56fe\u9700\u8981\u5f00\u53d1\u8005\u81ea\u884c\u63e3\u6469\u3002<\/li>\n<\/ul>\n<h4>2. \u4e2d\u6587\u5b66\u4e60\u8d44\u6e90\u7684\u532e\u4e4f<\/h4>\n<p>\u9ad8\u6548\u5929 \u5c3d\u7ba1 LangChain \u5728\u4e2d\u6587\u793e\u533a\u6709\u5f88\u9ad8\u7684\u5173\u6ce8\u5ea6&#xff0c;\u4f46\u9ad8\u8d28\u91cf\u7684\u5b66\u4e60\u8d44\u6e90\u4ecd\u7136\u7a00\u7f3a&#xff1a; \u9ad8\u6548\u542f3\u5929\u524d<\/p>\n<ul>\n<li>\u5927\u90e8\u5206\u6559\u7a0b\u505c\u7559\u5728 \u201cHello World\u201d \u5c42\u9762<\/li>\n<li>\u6df1\u5165\u6e90\u7801\u5929\u7684\u6587\u7ae0\u5229\u7528 Kimi-K2.5 \u7684\u4ee3\u7801\u7406\u89e3\u80fd\u529b&#xff0c;\u5feb\u901f\u51e4\u6bdb\u9e9f\u89d2<\/li>\n<li>\u7f3a\u4e4f\u7cfb\u7edf\u5929\u4e2d\u6587\u6ce8\u501f\u52a9 Kimi-K2.5 \u7684\u6df1\u5ea6\u5206\u6790&#xff0c;\u91ca\u9879\u76ee \u5229\u7528 Kim\u5929\u7684\u9ad8\u6548\u901a\u8fc7&#xff0c;\u751f\u6210\u80fd\u529b-K2.5 \u8fd9\u6b63\u662f LangChain-Chinese-Comment \u9879\u76ee\u8bde\u751f\u7684\u80cc\u666f\u3002 \u8fd93\u5206\u91cc\u548c \u51e0\u4e4e\u662f\u8fde\u8f74\u8f6c\u3002Kimi-K2.5 \u7684\u54cd\u5e94\u901f\u5ea6\u548c\u8d28\u91cf\u8ba9\u6211\u60ca\u53f9\u2014\u2014\u5b83\u80fd\u77ac\u95f4\u7406\u89e3\u590d\u6742\u7684\u4ee3\u7801\u903b\u8f91&#xff0c;\u5e76\u7528\u6d41\u7545\u7684\u4e2d\u6587\u751f\u6210\u4e13\u4e1a\u7684\u6211\u548c\u8ba9\u9a8c\u8bc1<\/li>\n<\/ul>\n<h3>\u9879\u76ee\u7279\u8272<\/h3>\n<p>&#xff08;\u5728 Kimi \u7684\u8f85\u52a9\u4e0b\u5b8c\u6210&#xff09;-K2.5&#xff0c;\u4ec5\u75283\u5929<\/p>\n<h4>1. \u6e90\u7801\u4e0e\u6ce8\u91ca\u5b8c\u7f8e\u5bf9\u7167<\/h4>\n<p>\u9879\u76ee\u91c7\u7528\u53cc\u76ee\u5f55\u7ed3\u6784&#xff1a;<\/p>\n<p>langchain_code_comment\/<br \/>\n\u251c\u2500\u2500 langchain_code\/     # \u539f\u59cb\u6e90\u7801&#xff08;\u4e0e\u5b98\u65b9\u540c\u6b65&#xff09;<br \/>\n\u251c\u2500\u2500 code_comment\/       # \u4e2d\u6587\u6ce8\u91ca&#xff08;\u76ee\u5f55\u7ed3\u6784\u5b8c\u5168\u4e00\u81f4&#xff09;<br \/>\n\u2514\u2500\u2500 docs\/              # \u8f85\u52a9\u6587\u6863<\/p>\n<p>\u8fd9\u79cd\u8bbe\u8ba1\u7684\u4f18\u52bf\u5728\u4e8e&#xff1a;<\/p>\n<ul>\n<li>\u5bf9\u7167\u5b66\u4e60&#xff1a;\u53ef\u4ee5\u5728\u9605\u8bfb\u6ce8\u91ca\u7684\u540c\u65f6\u67e5\u770b\u539f\u59cb\u6e90\u7801<\/li>\n<li>\u7248\u672c\u540c\u6b65&#xff1a;\u6ce8\u91ca\u4e0e\u6e90\u7801\u7248\u672c\u4fdd\u6301\u4e00\u81f4&#xff08;\u5f53\u524d\u540c\u6b65\u81f3 v1.2.7&#xff09;<\/li>\n<li>\u4fbf\u4e8e\u66f4\u65b0&#xff1a;\u5b98\u65b9\u66f4\u65b0\u540e\u53ef\u4ee5\u5feb\u901f\u540c\u6b65\u6ce8\u91ca<\/li>\n<\/ul>\n<h4>2. \u6a21\u5757\u5316\u7ec4\u7ec7&#xff0c;\u5c42\u6b21\u5206\u660e<\/h4>\n<p>\u9879\u76ee\u6309\u7167 LangChain \u5b98\u65b9\u5305\u7ed3\u6784\u7ec4\u7ec7&#xff0c;\u6db5\u76d6\u591a\u4e2a\u5c42\u9762&#xff1a;<\/p>\n<table>\n<tr>\u6a21\u5757\u8bf4\u660e\u6838\u5fc3\u5185\u5bb9<\/tr>\n<tbody>\n<tr>\n<td>langchain-core<\/td>\n<td>\u6838\u5fc3\u62bd\u8c61\u5c42<\/td>\n<td>Runnable\u3001Prompts\u3001Messages\u3001Tools\u3001Callbacks<\/td>\n<\/tr>\n<tr>\n<td>langchain<\/td>\n<td>\u7ecf\u5178\u7ec4\u4ef6<\/td>\n<td>\u4f20\u7edf Chain\u300150&#043; \u79cd VectorStore\u3001Retrievers<\/td>\n<\/tr>\n<tr>\n<td>langchain_v1<\/td>\n<td>\u4e3b\u5e94\u7528\u5c42<\/td>\n<td>Agent \u7cfb\u7edf\u3001Chat Models\u3001\u4e2d\u95f4\u4ef6\u67b6\u6784<\/td>\n<\/tr>\n<tr>\n<td>partners<\/td>\n<td>\u5408\u4f5c\u4f19\u4f34\u96c6\u6210<\/td>\n<td>OpenAI\u3001Anthropic\u3001DeepSeek\u3001Groq \u7b49 14&#043; \u5bb6<\/td>\n<\/tr>\n<tr>\n<td>text-splitters<\/td>\n<td>\u6587\u672c\u5206\u5272\u5668<\/td>\n<td>10 \u79cd\u5206\u5272\u7b56\u7565&#xff0c;\u652f\u6301\u591a\u8bed\u8a00<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>3. \u8be6\u7ec6\u7684\u672f\u8bed\u5bf9\u7167\u8868<\/h4>\n<p>\u9879\u76ee\u63d0\u4f9b\u4e86\u5b8c\u6574\u7684 TERMINOLOGY.md&#xff0c;\u5305\u542b 200&#043; \u4e2a\u672f\u8bed\u7684\u4e2d\u82f1\u6587\u5bf9\u7167&#xff1a;<\/p>\n<ul>\n<li>\u6838\u5fc3\u6982\u5ff5&#xff1a;Chain\u3001Agent\u3001Runnable\u3001LCEL<\/li>\n<li>\u67b6\u6784\u8bbe\u8ba1&#xff1a;Middleware\u3001Pipeline\u3001DAG\u3001State<\/li>\n<li>\u6a21\u578b\u76f8\u5173&#xff1a;Token\u3001Temperature\u3001Function Calling<\/li>\n<li>\u5411\u91cf\u68c0\u7d22&#xff1a;Embedding\u3001Vector Store\u3001Reranking<\/li>\n<\/ul>\n<p>\u8fd9\u786e\u4fdd\u4e86\u6587\u6863\u7ffb\u8bd1\u7684\u4e00\u81f4\u6027\u548c\u4e13\u4e1a\u6027\u3002<\/p>\n<h3>\u6838\u5fc3\u6a21\u5757\u6df1\u5ea6\u89e3\u8bfb<\/h3>\n<h4>1. LCEL&#xff1a;LangChain \u8868\u8fbe\u5f0f\u8bed\u8a00<\/h4>\n<p>LCEL \u662f LangChain v1.0 \u6700\u91cd\u8981\u7684\u521b\u65b0\u4e4b\u4e00\u3002\u5b83\u57fa\u4e8e Runnable \u63a5\u53e3&#xff0c;\u901a\u8fc7\u7ba1\u9053\u64cd\u4f5c\u7b26 | \u8fde\u63a5\u7ec4\u4ef6&#xff1a;<\/p>\n<p><span class=\"token keyword\">from<\/span> langchain_core<span class=\"token punctuation\">.<\/span>prompts <span class=\"token keyword\">import<\/span> PromptTemplate<br \/>\n<span class=\"token keyword\">from<\/span> langchain_core<span class=\"token punctuation\">.<\/span>runnables <span class=\"token keyword\">import<\/span> RunnableLambda<\/p>\n<p><span class=\"token comment\"># \u5b9a\u4e49\u63d0\u793a\u8bcd\u6a21\u677f<\/span><br \/>\nprompt <span class=\"token operator\">&#061;<\/span> PromptTemplate<span class=\"token punctuation\">.<\/span>from_template<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\u8bb2\u4e00\u4e2a\u5173\u4e8e {topic} \u7684\u7b11\u8bdd&#034;<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p><span class=\"token comment\"># \u5b9a\u4e49\u5904\u7406\u903b\u8f91<\/span><br \/>\nadd_prefix <span class=\"token operator\">&#061;<\/span> RunnableLambda<span class=\"token punctuation\">(<\/span><span class=\"token keyword\">lambda<\/span> x<span class=\"token punctuation\">:<\/span> <span class=\"token string-interpolation\"><span class=\"token string\">f&#034;AI \u52a9\u624b\u56de\u7b54&#xff1a;\\\\n<\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span>x<span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\">&#034;<\/span><\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p><span class=\"token comment\"># \u4f7f\u7528\u7ba1\u9053\u64cd\u4f5c\u7b26\u7ec4\u5408<\/span><br \/>\nchain <span class=\"token operator\">&#061;<\/span> prompt <span class=\"token operator\">|<\/span> add_prefix<\/p>\n<p><span class=\"token comment\"># \u8c03\u7528<\/span><br \/>\nresult <span class=\"token operator\">&#061;<\/span> chain<span class=\"token punctuation\">.<\/span>invoke<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">{<\/span><span class=\"token string\">&#034;topic&#034;<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#034;\u7a0b\u5e8f\u5458&#034;<\/span><span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>\u4e3a\u4ec0\u4e48 LCEL \u5982\u6b64\u91cd\u8981&#xff1f;<\/p>\n<li>\u7edf\u4e00\u63a5\u53e3&#xff1a;\u6240\u6709\u7ec4\u4ef6\u90fd\u5b9e\u73b0 invoke()\u3001batch()\u3001stream() \u65b9\u6cd5<\/li>\n<li>\u81ea\u52a8\u4f18\u5316&#xff1a;\u652f\u6301\u5e76\u884c\u6267\u884c\u3001\u6279\u5904\u7406\u3001\u6d41\u5f0f\u8f93\u51fa<\/li>\n<li>\u7c7b\u578b\u5b89\u5168&#xff1a;\u5b8c\u6574\u7684\u7c7b\u578b\u63d0\u793a\u652f\u6301<\/li>\n<li>\u53ef\u89c2\u6d4b\u6027&#xff1a;\u5185\u7f6e\u56de\u8c03\u673a\u5236&#xff0c;\u4fbf\u4e8e\u76d1\u63a7\u548c\u8c03\u8bd5<\/li>\n<p>\u5728\u9879\u76ee\u7684 code_comment\/libs\/core\/langchain_core\/runnables\/ \u76ee\u5f55\u4e0b&#xff0c;\u4f60\u53ef\u4ee5\u627e\u5230 base.py \u7684\u8be6\u7ec6\u4e2d\u6587\u6ce8\u91ca&#xff0c;\u6df1\u5165\u7406\u89e3 Runnable \u63a5\u53e3\u7684\u8bbe\u8ba1\u54f2\u5b66\u3002<\/p>\n<h4>2. Agent \u667a\u80fd\u4f53\u7cfb\u7edf<\/h4>\n<p>LangChain v1.2 \u5bf9 Agent \u7cfb\u7edf\u8fdb\u884c\u4e86\u91cd\u5927\u91cd\u6784&#xff0c;\u5f15\u5165\u4e86\u4e2d\u95f4\u4ef6\u67b6\u6784&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u4e2d\u95f4\u4ef6\u793a\u4f8b&#xff1a;\u5de5\u5177\u8c03\u7528\u9650\u5236<\/span><br \/>\n<span class=\"token keyword\">from<\/span> langchain<span class=\"token punctuation\">.<\/span>agents<span class=\"token punctuation\">.<\/span>middleware <span class=\"token keyword\">import<\/span> ToolCallLimitMiddleware<\/p>\n<p>middleware <span class=\"token operator\">&#061;<\/span> ToolCallLimitMiddleware<span class=\"token punctuation\">(<\/span>max_calls<span class=\"token operator\">&#061;<\/span><span class=\"token number\">5<\/span><span class=\"token punctuation\">)<\/span><br \/>\nagent <span class=\"token operator\">&#061;<\/span> create_openai_functions_agent<span class=\"token punctuation\">(<\/span>llm<span class=\"token punctuation\">,<\/span> tools<span class=\"token punctuation\">,<\/span> middleware<span class=\"token operator\">&#061;<\/span>middleware<span class=\"token punctuation\">)<\/span><\/p>\n<p>\u9879\u76ee\u8be6\u7ec6\u6ce8\u91ca\u4e86\u4ee5\u4e0b\u4e2d\u95f4\u4ef6&#xff1a;<\/p>\n<ul>\n<li>ToolCallLimitMiddleware&#xff1a;\u9650\u5236\u5de5\u5177\u8c03\u7528\u6b21\u6570<\/li>\n<li>ToolRetryMiddleware&#xff1a;\u5de5\u5177\u8c03\u7528\u5931\u8d25\u81ea\u52a8\u91cd\u8bd5<\/li>\n<li>ToolEmulatorMiddleware&#xff1a;\u5de5\u5177\u6a21\u62df&#xff08;\u7528\u4e8e\u6d4b\u8bd5&#xff09;<\/li>\n<\/ul>\n<p>\u5728 code_comment\/libs\/langchain_v1\/langchain\/agents\/middleware\/ \u76ee\u5f55\u4e0b&#xff0c;\u4f60\u53ef\u4ee5\u770b\u5230\u5b8c\u6574\u7684\u4e2d\u6587\u6ce8\u91ca\u3002<\/p>\n<h4>3. \u5411\u91cf\u5b58\u50a8\u4e0e\u68c0\u7d22<\/h4>\n<p>\u9879\u76ee\u6574\u7406\u4e86 50&#043; \u79cd\u5411\u91cf\u6570\u636e\u5e93\u7684\u5b9e\u73b0&#xff0c;\u5305\u62ec&#xff1a;<\/p>\n<ul>\n<li>\u5f00\u6e90\u65b9\u6848&#xff1a;Chroma\u3001Qdrant\u3001Milvus\u3001Weaviate<\/li>\n<li>\u4e91\u670d\u52a1&#xff1a;Pinecone\u3001Azure Cognitive Search<\/li>\n<li>\u4f20\u7edf\u6570\u636e\u5e93\u6269\u5c55&#xff1a;PostgreSQL (pgvector)\u3001Redis\u3001Elasticsearch<\/li>\n<\/ul>\n<p>\u6bcf\u79cd\u5b9e\u73b0\u90fd\u5305\u542b&#xff1a;<\/p>\n<ul>\n<li>\u521d\u59cb\u5316\u914d\u7f6e\u8bf4\u660e<\/li>\n<li>\u76f8\u4f3c\u5ea6\u641c\u7d22\u65b9\u6cd5<\/li>\n<li>\u5143\u6570\u636e\u8fc7\u6ee4\u793a\u4f8b<\/li>\n<li>\u6027\u80fd\u4f18\u5316\u5efa\u8bae<\/li>\n<\/ul>\n<h3>\u5b66\u4e60\u8def\u5f84\u63a8\u8350<\/h3>\n<h4>\u5165\u95e8\u9636\u6bb5&#xff08;1-2 \u5468&#xff09;<\/h4>\n<li>\u9605\u8bfb\u9879\u76ee README&#xff0c;\u4e86\u89e3\u6574\u4f53\u67b6\u6784<\/li>\n<li>\u5b66\u4e60 langchain-core&#xff1a;\n<ul>\n<li>Runnable \u63a5\u53e3\u8bbe\u8ba1<\/li>\n<li>Prompts \u6a21\u677f\u7cfb\u7edf<\/li>\n<li>Messages \u6d88\u606f\u7c7b\u578b<\/li>\n<\/ul>\n<\/li>\n<li>\u5b8c\u6210\u5feb\u901f\u5165\u95e8\u793a\u4f8b&#xff1a;\n<ul>\n<li>LCEL \u57fa\u7840\u94fe<\/li>\n<li>\u7b80\u5355 Chat Model \u8c03\u7528<\/li>\n<\/ul>\n<\/li>\n<h4>\u8fdb\u9636\u9636\u6bb5&#xff08;2-4 \u5468&#xff09;<\/h4>\n<li>\u6df1\u5165 Agents \u7cfb\u7edf&#xff1a;\n<ul>\n<li>ReAct \u6846\u67b6\u5b9e\u73b0<\/li>\n<li>\u5de5\u5177\u5b9a\u4e49\u4e0e\u8f6c\u6362<\/li>\n<li>\u4e2d\u95f4\u4ef6\u67b6\u6784<\/li>\n<\/ul>\n<\/li>\n<li>\u638c\u63e1 RAG \u6d41\u7a0b&#xff1a;\n<ul>\n<li>Document Loader<\/li>\n<li>Text Splitter<\/li>\n<li>Vector Store<\/li>\n<li>Retriever<\/li>\n<\/ul>\n<\/li>\n<li>\u5b66\u4e60 Callbacks \u548c Tracing&#xff1a;\n<ul>\n<li>\u56de\u8c03\u673a\u5236<\/li>\n<li>LangSmith \u96c6\u6210<\/li>\n<\/ul>\n<\/li>\n<h4>\u5b9e\u6218\u9636\u6bb5&#xff08;\u6301\u7eed&#xff09;<\/h4>\n<li>\u9605\u8bfb\u5408\u4f5c\u4f19\u4f34\u5305&#xff1a;\n<ul>\n<li>OpenAI\u3001Anthropic \u96c6\u6210<\/li>\n<li>\u56fd\u5185\u6a21\u578b&#xff1a;DeepSeek\u3001Qwen<\/li>\n<\/ul>\n<\/li>\n<li>\u53c2\u8003\u6700\u4f73\u5b9e\u8df5\u6587\u6863&#xff1a;\n<ul>\n<li>\u6027\u80fd\u4f18\u5316<\/li>\n<li>\u9519\u8bef\u5904\u7406<\/li>\n<li>\u751f\u4ea7\u73af\u5883\u90e8\u7f72<\/li>\n<\/ul>\n<\/li>\n<h3>\u5982\u4f55\u53c2\u4e0e\u8d21\u732e<\/h3>\n<p>\u9879\u76ee\u6b22\u8fce\u793e\u533a\u8d21\u732e&#xff01;\u4f60\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u5f0f\u53c2\u4e0e&#xff1a;<\/p>\n<h4>1. \u5b8c\u5584\u6ce8\u91ca<\/h4>\n<ul>\n<li>\u4e3a\u672a\u6ce8\u91ca\u7684\u6a21\u5757\u6dfb\u52a0\u4e2d\u6587\u8bf4\u660e<\/li>\n<li>\u4fee\u6b63\u73b0\u6709\u6ce8\u91ca\u4e2d\u7684\u9519\u8bef<\/li>\n<li>\u8865\u5145\u4ee3\u7801\u793a\u4f8b<\/li>\n<\/ul>\n<h4>2. \u672f\u8bed\u6807\u51c6\u5316<\/h4>\n<ul>\n<li>\u53c2\u8003 TERMINOLOGY.md<\/li>\n<li>\u5929\u672f\u9ad8\u5f3a\u5ea6\u5b66\u4e60\u81f4\u6027<\/li>\n<li>\u63d0\u51fa\u65b0\u7684\u672f\u8bed\u5efa\u8bae<\/li>\n<\/ul>\n<h4>3. \u5206\u4eab\u5b66\u4e60\u5fc3\u5f97<\/h4>\n<ul>\n<li>\u64b0\u5199\u6280\u672f\u535a\u5ba2<\/li>\n<li>\u5236\u4f5c\u89c6\u9891\u6559\u7a0b<\/li>\n<li>\u5728 Issue \u4e2d\u5206\u4eab\u4f7f\u7528\u7ecf\u9a8c<\/li>\n<\/ul>\n<h3>\u9879\u76ee\u8d44\u6e90<\/h3>\n<ul>\n<li>CSDN \u535a\u5ba2&#xff1a;https:\/\/blog.csdn.net\/Yunyi_Chi<\/li>\n<li>\u6b22\u8fce\u5173\u6ce8\u6211\u7684\u6280\u672f\u535a\u5ba2&#xff0c;\u83b7\u53d6\u66f4\u591a AI \u5f00\u53d1\u7ecf\u9a8c\u5206\u4eab Kimi-K2.5 \u8f85\u52a9\u6211\u5b8c\u6210<\/li>\n<\/ul>\n<h3>\u7ed3\u8bed<\/h3>\n<p>\u548c Kimi-K2.5 \u5171\u540c\u5b8c\u6210 LangChain \u662f\u4e00\u4e2a\u5f3a\u5927\u800c\u590d\u6742\u7684\u6846\u67b6&#xff0c;\u6df1\u5165\u7406\u89e3\u5b83\u9700\u8981\u65f6\u95f4\u548c\u8010\u5fc3\u3002LangChain-Chinese-Comment \u9879\u76ee\u65e8\u5728\u964d\u4f4e\u4e2d\u6587\u5f00\u53d1\u8005\u7684\u5b66\u4e60\u95e8\u69db&#xff0c;\u8ba9\u66f4\u591a\u4eba\u80fd\u591f\u638c\u63e1 LLM \u5e94\u7528\u5f00\u53d1\u7684\u6838\u5fc3\u6280\u672f\u3002<\/p>\n<p>\u65e0\u8bba\u4f60\u662f&#xff1a;<\/p>\n<ul>\n<li>\u521d\u5b66\u8005&#xff1a;\u60f3\u8981\u7cfb\u7edf\u5b66\u4e60 LangChain<\/li>\n<li>\u8fdb\u9636\u5f00\u53d1\u8005&#xff1a;\u9700\u8981\u6df1\u5165\u7406\u89e3\u6e90\u7801<\/li>\n<li>\u56e2\u961f\u8d1f\u8d23\u4eba&#xff1a;\u5e0c\u671b\u7edf\u4e00\u56e2\u961f\u672f\u8bed\u89c4\u8303<\/li>\n<\/ul>\n<p>\u8fd9\u4e2a\u9879\u76ee\u90fd\u80fd\u4e3a\u4f60\u63d0\u4f9b\u5e2e\u52a9\u3002<\/p>\n<p>Star \u9879\u76ee&#xff0c;\u5f00\u542f\u4f60\u7684 LangChain \u6df1\u5165\u5b66\u4e60\u4e4b\u65c5&#xff01; \u2b50<\/p>\n<hr \/>\n<p>\u5173\u4e8e\u4f5c\u8005&#xff1a;\u7384\u540c765&#xff0c;AI \u5e94\u7528\u5f00\u53d1\u5de5\u7a0b\u5e08&#xff0c;\u4e13\u6ce8\u4e8e LLM \u5e94\u7528\u67b6\u6784\u8bbe\u8ba1\u3002\u6b22\u8fce\u901a\u8fc7 CSDN \u535a\u5ba2\u4ea4\u6d41\u6280\u672f\u5fc3\u5f97\u3002<\/p>\n<p>\u672c\u6587\u9996\u53d1\u4e8e CSDN&#xff0c;\u8f6c\u8f7d\u8bf7\u6ce8\u660e\u51fa\u5904\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7384\u540c 765 \u5927\u8bed\u8a00\u6a21\u578b (LLM) \u5f00\u53d1\u5de5\u7a0b\u5e08 | \u4e2d\u56fd\u4f20\u5a92\u5927\u5b66 \u00b7 \u6570\u5b57\u5a92\u4f53\u6280\u672f&#xff08;\u667a\u80fd\u4ea4\u4e92\u4e0e\u6e38\u620f\u8bbe\u8ba1&#xff09; CSDN \u00b7 \u4e2a\u4eba\u4e3b\u9875 |   GitHub \u00b7 Follow   \u5173\u4e8e\u4f5c\u8005<br \/>\n\u6df1\u8015\u9886\u57df&#xff1a;\u5927\u8bed\u8a00\u6a21\u578b\u5f00\u53d1 \/ RAG \u77e5\u8bc6\u5e93 \/ AI Agent \u843d\u5730 \/ \u6a21\u578b\u5fae\u8c03\u6280\u672f\u6808&#xff1a;Python | RAG (LangChain \/ Dify  Milvus) | FastAPI  Docker\u5de5\u7a0b\u80fd\u529b&#xff1a;\u4e13\u6ce8<\/p>\n","protected":false},"author":2,"featured_media":70792,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[74,3038,997,4119,50,2983,1807],"topic":[],"class_list":["post-70793","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-agent","tag-ai-native","tag-langchain","tag-rag","tag-50","tag-2983","tag-1807"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u6211\u82b1\u4e863\u5929\uff0c\u4e3a LangChain \u5199\u4e866\u4e07\u884c\u4e2d\u6587\u6ce8\u91ca - \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\/70793.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u6211\u82b1\u4e863\u5929\uff0c\u4e3a LangChain \u5199\u4e866\u4e07\u884c\u4e2d\u6587\u6ce8\u91ca - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u7384\u540c 765 \u5927\u8bed\u8a00\u6a21\u578b (LLM) \u5f00\u53d1\u5de5\u7a0b\u5e08 | \u4e2d\u56fd\u4f20\u5a92\u5927\u5b66 \u00b7 \u6570\u5b57\u5a92\u4f53\u6280\u672f&#xff08;\u667a\u80fd\u4ea4\u4e92\u4e0e\u6e38\u620f\u8bbe\u8ba1&#xff09; CSDN \u00b7 \u4e2a\u4eba\u4e3b\u9875 |  GitHub \u00b7 Follow  \u5173\u4e8e\u4f5c\u8005 \u6df1\u8015\u9886\u57df&#xff1a;\u5927\u8bed\u8a00\u6a21\u578b\u5f00\u53d1 \/ RAG \u77e5\u8bc6\u5e93 \/ AI Agent \u843d\u5730 \/ \u6a21\u578b\u5fae\u8c03\u6280\u672f\u6808&#xff1a;Python | RAG (LangChain \/ Dify Milvus) | FastAPI Docker\u5de5\u7a0b\u80fd\u529b&#xff1a;\u4e13\u6ce8\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/70793.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-02-02T04:33:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260202043315-6980290bf186f.jpg\" \/>\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=\"6 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/70793.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/70793.html\",\"name\":\"\u6211\u82b1\u4e863\u5929\uff0c\u4e3a LangChain \u5199\u4e866\u4e07\u884c\u4e2d\u6587\u6ce8\u91ca - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-02-02T04:33:17+00:00\",\"dateModified\":\"2026-02-02T04:33:17+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/70793.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/70793.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/70793.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u6211\u82b1\u4e863\u5929\uff0c\u4e3a LangChain \u5199\u4e866\u4e07\u884c\u4e2d\u6587\u6ce8\u91ca\"}]},{\"@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":"\u6211\u82b1\u4e863\u5929\uff0c\u4e3a LangChain \u5199\u4e866\u4e07\u884c\u4e2d\u6587\u6ce8\u91ca - \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\/70793.html","og_locale":"zh_CN","og_type":"article","og_title":"\u6211\u82b1\u4e863\u5929\uff0c\u4e3a LangChain \u5199\u4e866\u4e07\u884c\u4e2d\u6587\u6ce8\u91ca - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u7384\u540c 765 \u5927\u8bed\u8a00\u6a21\u578b (LLM) \u5f00\u53d1\u5de5\u7a0b\u5e08 | \u4e2d\u56fd\u4f20\u5a92\u5927\u5b66 \u00b7 \u6570\u5b57\u5a92\u4f53\u6280\u672f&#xff08;\u667a\u80fd\u4ea4\u4e92\u4e0e\u6e38\u620f\u8bbe\u8ba1&#xff09; CSDN \u00b7 \u4e2a\u4eba\u4e3b\u9875 |  GitHub \u00b7 Follow  \u5173\u4e8e\u4f5c\u8005 \u6df1\u8015\u9886\u57df&#xff1a;\u5927\u8bed\u8a00\u6a21\u578b\u5f00\u53d1 \/ RAG \u77e5\u8bc6\u5e93 \/ AI Agent \u843d\u5730 \/ \u6a21\u578b\u5fae\u8c03\u6280\u672f\u6808&#xff1a;Python | RAG (LangChain \/ Dify Milvus) | FastAPI Docker\u5de5\u7a0b\u80fd\u529b&#xff1a;\u4e13\u6ce8","og_url":"https:\/\/www.wsisp.com\/helps\/70793.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-02-02T04:33:17+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260202043315-6980290bf186f.jpg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"6 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/70793.html","url":"https:\/\/www.wsisp.com\/helps\/70793.html","name":"\u6211\u82b1\u4e863\u5929\uff0c\u4e3a LangChain \u5199\u4e866\u4e07\u884c\u4e2d\u6587\u6ce8\u91ca - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-02-02T04:33:17+00:00","dateModified":"2026-02-02T04:33:17+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/70793.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/70793.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/70793.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u6211\u82b1\u4e863\u5929\uff0c\u4e3a LangChain \u5199\u4e866\u4e07\u884c\u4e2d\u6587\u6ce8\u91ca"}]},{"@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\/70793","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=70793"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/70793\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/70792"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=70793"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=70793"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=70793"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=70793"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}