{"id":59923,"date":"2026-01-14T18:05:29","date_gmt":"2026-01-14T10:05:29","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/59923.html"},"modified":"2026-01-14T18:05:29","modified_gmt":"2026-01-14T10:05:29","slug":"deepseek-rag-%e6%89%8b%e6%8a%8a%e6%89%8b%e5%ae%9e%e6%88%98%ef%bc%9a%e4%bb%8e-0-%e5%88%b0-1-%e6%89%93%e9%80%a0%e4%bd%a0%e7%9a%84%e4%b8%aa%e4%ba%ba%e7%9f%a5%e8%af%86%e5%ba%93%e5%8a%a9%e6%89%8b","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/59923.html","title":{"rendered":"DeepSeek + RAG \u624b\u628a\u624b\u5b9e\u6218\uff1a\u4ece 0 \u5230 1 \u6253\u9020\u4f60\u7684\u4e2a\u4eba\u77e5\u8bc6\u5e93\u52a9\u624b\uff08\u9644 Python \u6e90\u7801\uff09"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260114100528-69676a680e130.png\" alt=\"\" \/><\/p>\n<p>\u4f5c\u8005&#xff1a;\u98de\u54e5&#xff08;\u4e00\u4f4d\u559c\u6b22\u8bb2\u6545\u4e8b\u7684\u5168\u6808\u5f00\u53d1\u8005&#xff0c;\u64c5\u957f\u628a\u590d\u6742\u7684\u4ee3\u7801\u7ffb\u8bd1\u6210\u201c\u4eba\u8bdd\u201d&#xff09;<br \/>\n\u9636\u6bb5&#xff1a;GenAI \u4e0e\u5927\u6a21\u578b\u5e94\u7528<br \/>\n\u5173\u952e\u8bcd&#xff1a;RAG, Embedding, \u5411\u91cf\u6570\u636e\u5e93, \u77e5\u8bc6\u5e93\u95ee\u7b54<\/p>\n<p>\u5927\u5bb6\u597d&#xff0c;\u6211\u662f\u98de\u54e5\u3002<\/p>\n<p>\u524d\u4e24\u5468\u6211\u4eec\u5b66\u4f1a\u4e86\u8ba9 AI \u201c\u597d\u597d\u8bf4\u8bdd\u201d&#xff08;Prompt&#xff09;\u548c\u201c\u52a8\u624b\u5e72\u6d3b\u201d&#xff08;Function Calling&#xff09;\u3002<br \/>\n\u4f46\u4f60\u5728\u5b9e\u9645\u5f00\u53d1\u4e2d&#xff0c;\u4e00\u5b9a\u9047\u5230\u8fc7\u8fd9\u6837\u7684\u5c34\u5c2c\u573a\u666f&#xff1a;<\/p>\n<ul>\n<li>\u4f60\u95ee ChatGPT&#xff1a;\u201c\u8bc4\u4ef7\u4e00\u4e0b\u6211\u4eec\u516c\u53f8\u6700\u65b0\u7684 V3.0 \u67b6\u6784\u3002\u201d<\/li>\n<li>ChatGPT \u4e00\u8138\u61f5\u903c&#xff1a;\u201c\u4eb2&#xff0c;\u6211\u53ea\u77e5\u9053 2023 \u5e74\u4ee5\u524d\u7684\u4e92\u8054\u7f51\u516c\u5f00\u4fe1\u606f&#xff0c;\u6211\u4e0d\u8ba4\u8bc6\u4f60\u4eec\u516c\u53f8\u554a\u3002\u201d<\/li>\n<\/ul>\n<p>\u6216\u8005\u66f4\u60e8\u7684&#xff1a;<\/p>\n<ul>\n<li>ChatGPT \u4e3a\u4e86\u8fce\u5408\u4f60&#xff0c;\u5f00\u59cb\u4e00\u672c\u6b63\u7ecf\u5730\u80e1\u8bf4\u516b\u9053&#xff08;\u8fd9\u53eb \u5e7b\u89c9 Hallucination&#xff09;\u3002<\/li>\n<\/ul>\n<p>\u600e\u4e48\u89e3\u51b3&#xff1f;\u91cd\u65b0\u8bad\u7ec3\u4e00\u4e2a\u6a21\u578b&#xff1f;\u592a\u8d35\u592a\u6162\u4e86&#xff01;<br \/>\n\u6700\u806a\u660e\u7684\u529e\u6cd5\u662f&#xff1a;\u8003\u8bd5\u65f6\u5141\u8bb8 AI \u201c\u5f00\u5377\u201d\u67e5\u8d44\u6599\u3002<br \/>\n\u8fd9\u5c31\u662f RAG (Retrieval-Augmented Generation&#xff0c;\u68c0\u7d22\u589e\u5f3a\u751f\u6210)\u3002<\/p>\n<hr \/>\n<h3>1. \u4ec0\u4e48\u662f RAG&#xff1f;&#xff08;\u4e09\u6b65\u7406\u89e3\u6cd5&#xff09;<\/h3>\n<h4>\u7b2c\u4e00\u6b65&#xff1a;\u951a\u5b9a\u5df2\u77e5 \u2693\ufe0f<\/h4>\n<p>\u56de\u60f3\u4e00\u4e0b\u4f60\u505a \u201c\u5f00\u5377\u8003\u8bd5\u201d \u7684\u8fc7\u7a0b&#xff1a;<\/p>\n<li>\u770b\u5230\u9898\u76ee&#xff08;\u7528\u6237\u63d0\u95ee&#xff09;\u3002<\/li>\n<li>\u7ffb\u4e66&#xff0c;\u627e\u5230\u76f8\u5173\u7684\u6bb5\u843d&#xff08;\u68c0\u7d22 Retrieval&#xff09;\u3002<\/li>\n<li>\u6284&#xff08;\u6216\u8005\u603b\u7ed3&#xff09;\u5230\u8bd5\u5377\u4e0a&#xff08;\u751f\u6210 Generation&#xff09;\u3002<\/li>\n<p>RAG \u7684\u6d41\u7a0b\u4e00\u6a21\u4e00\u6837&#xff1a;\u5148\u67e5\u5e93&#xff0c;\u518d\u56de\u7b54\u3002<\/p>\n<h4>\u7b2c\u4e8c\u6b65&#xff1a;\u751f\u52a8\u7c7b\u6bd4 &#x1f4d6;<\/h4>\n<ul>\n<li>\u7eaf LLM (ChatGPT)&#xff1a;\u50cf\u4e00\u4e2a \u535a\u5b66\u4f46\u4e0e\u4e16\u9694\u7edd\u7684\u8001\u6559\u6388\u3002\u4ed6\u61c2\u5386\u53f2\u5929\u6587&#xff0c;\u4f46\u4e0d\u77e5\u9053\u4eca\u5929\u7684\u65b0\u95fb&#xff0c;\u4e5f\u4e0d\u77e5\u9053\u4f60\u516c\u53f8\u7684\u673a\u5bc6\u3002<\/li>\n<li>RAG&#xff1a;\u5c31\u662f\u7ed9\u8fd9\u4f4d\u8001\u6559\u6388\u914d\u4e86\u4e00\u4e2a \u8d85\u7ea7\u56fe\u4e66\u7ba1\u7406\u5458\u3002\n<ul>\n<li>\u5f53\u4f60\u95ee\u95ee\u9898\u65f6&#xff0c;\u56fe\u4e66\u7ba1\u7406\u5458\u5148\u53bb\u6863\u6848\u5ba4&#xff08;\u4f60\u7684\u79c1\u6709\u6570\u636e\u5e93&#xff09;\u628a\u76f8\u5173\u6587\u4ef6\u627e\u51fa\u6765&#xff0c;\u9012\u7ed9\u6559\u6388\u3002<\/li>\n<li>\u6559\u6388\u770b\u7740\u6587\u4ef6&#xff0c;\u7ed3\u5408\u81ea\u5df1\u7684\u5b66\u8bc6&#xff0c;\u7ed9\u4f60\u4e00\u4e2a\u5b8c\u7f8e\u7684\u7b54\u6848\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h4>\u7b2c\u4e09\u6b65&#xff1a;\u63d0\u70bc\u9aa8\u67b6 &#x1f9b4;<\/h4>\n<p>RAG &#061; \u68c0\u7d22 (Retrieval) &#043; \u589e\u5f3a (Augmented) &#043; \u751f\u6210 (Generation)<\/p>\n<li>\u7528\u6237\u63d0\u95ee&#xff1a;\u201c\u600e\u4e48\u914d\u7f6e Android \u6df7\u6dc6&#xff1f;\u201d<\/li>\n<li>\u68c0\u7d22&#xff1a;\u7cfb\u7edf\u53bb\u4f60\u7684\u6587\u6863\u5e93\u91cc\u627e&#xff0c;\u627e\u5230\u4e86 proguard-rules.pro \u76f8\u5173\u7684\u4e09\u4e2a\u6bb5\u843d\u3002<\/li>\n<li>\u589e\u5f3a&#xff1a;\u628a\u8fd9\u4e09\u4e2a\u6bb5\u843d\u62fc\u5728 Prompt \u91cc&#xff1a;\u201c\u8bf7\u6839\u636e\u4ee5\u4e0b\u8d44\u6599\u56de\u7b54\u7528\u6237\u95ee\u9898\u2026\u201d<\/li>\n<li>\u751f\u6210&#xff1a;AI \u8f93\u51fa\u6700\u7ec8\u7b54\u6848\u3002<\/li>\n<hr \/>\n<h3>2. \u6838\u5fc3\u6280\u672f&#xff1a;AI \u600e\u4e48\u77e5\u9053\u201c\u54ea\u6bb5\u8bdd\u201d\u662f\u76f8\u5173\u7684&#xff1f;<\/h3>\n<p>\u8fd9\u91cc\u6d89\u53ca\u5230\u4e00\u4e2a\u9b54\u6cd5\u6982\u5ff5&#xff1a;Embedding (\u5d4c\u5165\/\u5411\u91cf\u5316)\u3002<br \/>\n\u8ba1\u7b97\u673a\u4e0d\u8ba4\u8bc6\u5b57&#xff0c;\u53ea\u8ba4\u8bc6\u6570\u5b57\u3002Embedding \u5c31\u662f\u628a\u4e00\u6bb5\u6587\u5b57\u53d8\u6210 \u4e00\u4e32\u6570\u5b57\u5750\u6807\u3002<\/p>\n<h4>2.1 \u4ec0\u4e48\u662f Embedding&#xff1f;&#x1f4cd;<\/h4>\n<ul>\n<li>\u7c7b\u6bd4&#xff1a;\u56fe\u4e66\u9986\u7684 \u7d22\u4e66\u53f7\u3002\n<ul>\n<li>\u201c\u82f9\u679c\u201d\u548c\u201c\u9999\u8549\u201d\u7684\u7d22\u4e66\u53f7\u4f1a\u79bb\u5f97\u5f88\u8fd1&#xff08;\u90fd\u662f\u6c34\u679c&#xff09;\u3002<\/li>\n<li>\u201c\u82f9\u679c\u201d\u548c\u201ciPhone\u201d\u7684\u7d22\u4e66\u53f7\u4e5f\u4f1a\u79bb\u5f97\u5f88\u8fd1&#xff08;\u79d1\u6280\u8bed\u5883&#xff09;\u3002<\/li>\n<li>\u201c\u82f9\u679c\u201d\u548c\u201c\u5361\u8f66\u201d\u7684\u7d22\u4e66\u53f7\u5c31\u4f1a\u79bb\u5f97\u5f88\u8fdc\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>Embedding \u6a21\u578b\u4f1a\u628a\u6bcf\u4e00\u53e5\u8bdd\u53d8\u6210\u4e00\u4e2a\u9ad8\u7ef4\u5411\u91cf&#xff08;\u6bd4\u5982 OpenAI \u7684 text-embedding-3-small \u6a21\u578b\u751f\u6210\u7684\u5411\u91cf\u957f\u5ea6\u662f 1536&#xff09;\u3002<br \/>\n\u610f\u601d\u8d8a\u76f8\u8fd1\u7684\u8bdd&#xff0c;\u5b83\u4eec\u5728\u6570\u5b66\u7a7a\u95f4\u91cc\u7684\u8ddd\u79bb&#xff08;\u4f59\u5f26\u76f8\u4f3c\u5ea6 Cosine Similarity&#xff09;\u5c31\u8d8a\u8fd1\u3002<\/p>\n<h4>2.2 \u5173\u952e\u6b65\u9aa4&#xff1a;\u5207\u7247 (Chunking) &#x1f52a;<\/h4>\n<p>\u4f60\u53ef\u80fd\u4f1a\u95ee&#xff1a;\u201c\u4e3a\u4ec0\u4e48\u4e0d\u628a\u6574\u672c\u4e66\u76f4\u63a5\u585e\u7ed9 AI&#xff1f;\u201d<\/p>\n<li>\u7a97\u53e3\u9650\u5236 (Context Window)&#xff1a;\u5c31\u50cf\u4eba\u7684\u77ed\u671f\u8bb0\u5fc6\u6709\u9650\u3002\n<ul>\n<li>\u5927\u6a21\u578b\u4e00\u6b21\u53ea\u80fd\u5904\u7406\u4e00\u5b9a\u957f\u5ea6\u7684\u6587\u5b57&#xff08;\u79f0\u4e3a Token&#xff0c;\u6bd4\u5982 4k\u300132k \u6216 128k&#xff09;\u3002<\/li>\n<li>\u5982\u679c\u4f60\u628a\u6574\u672c\u300a\u7ea2\u697c\u68a6\u300b\u4e00\u6b21\u6027\u53d1\u7ed9\u5b83&#xff0c;\u8d85\u51fa\u7684\u90e8\u5206\u5b83\u6839\u672c\u201c\u770b\u4e0d\u89c1\u201d&#xff0c;\u6216\u8005\u4f1a\u76f4\u63a5\u62a5\u9519\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\u7cbe\u5ea6\u95ee\u9898&#xff1a;\u5373\u4f7f\u6a21\u578b\u80fd\u5403\u4e0b\u6574\u672c\u4e66&#xff0c;\u5173\u952e\u4fe1\u606f\u4e5f\u5bb9\u6613\u88ab\u6df9\u6ca1\u5728\u5927\u91cf\u7684\u201c\u5e9f\u8bdd\u201d\u4e2d&#xff08;\u5927\u6d77\u635e\u9488&#xff09;&#xff0c;\u5bfc\u81f4\u56de\u7b54\u4e0d\u51c6\u786e\u3002<\/li>\n<p>\u6240\u4ee5&#xff0c;\u6211\u4eec\u9700\u8981\u628a\u5927\u6587\u6863\u5207\u6210\u5c0f\u5757&#xff08;Chunk&#xff09;\u3002<\/p>\n<ul>\n<li>\u4e0d\u4ec5\u662f\u5207\u65ad&#xff1a;\u597d\u7684\u5207\u7247\u7b56\u7565\u4f1a\u4fdd\u7559\u4e0a\u4e0b\u6587&#xff08;\u6bd4\u5982\u53e5\u5b50\u4e0d\u80fd\u5207\u4e00\u534a&#xff0c;\u6bb5\u843d\u4e4b\u95f4\u8981\u6709\u91cd\u53e0 Overlap&#xff09;\u3002<\/li>\n<li>\u5e38\u7528\u7b56\u7565&#xff1a;\u56fa\u5b9a\u5b57\u7b26\u6570\u5207\u5206\u3001\u6309\u6bb5\u843d\u5207\u5206\u3001\u9012\u5f52\u5b57\u7b26\u5207\u5206&#xff08;Recursive&#xff09;\u3002<\/li>\n<\/ul>\n<hr \/>\n<h3>3. \u5b9e\u6218\u4f5c\u4e1a&#xff1a;\u6784\u5efa\u4f60\u7684\u7b2c\u4e00\u4e2a\u201c\u4e2a\u4eba\u77e5\u8bc6\u5e93\u201d &#x1f4da;<\/h3>\n<p>\u4efb\u52a1\u80cc\u666f&#xff1a;\u4f60\u6709\u4e00\u4efd\u672c\u5730\u7684 Android\u5f00\u53d1\u89c4\u8303.md&#xff0c;\u4f60\u5e0c\u671b\u505a\u4e00\u4e2a\u95ee\u7b54\u5de5\u5177&#xff0c;\u80fd\u56de\u7b54\u5173\u4e8e\u8fd9\u4efd\u6587\u6863\u7684\u95ee\u9898\u3002<\/p>\n<h4>3.1 \u67b6\u6784\u6d41\u7a0b\u56fe<\/h4>\n<p>#mermaid-svg-Otf6mJSDonbcSEj5{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-Otf6mJSDonbcSEj5 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-Otf6mJSDonbcSEj5 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-Otf6mJSDonbcSEj5 .error-icon{fill:#552222;}#mermaid-svg-Otf6mJSDonbcSEj5 .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-Otf6mJSDonbcSEj5 .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-Otf6mJSDonbcSEj5 .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-Otf6mJSDonbcSEj5 .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-Otf6mJSDonbcSEj5 .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-Otf6mJSDonbcSEj5 .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-Otf6mJSDonbcSEj5 .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-Otf6mJSDonbcSEj5 .marker{fill:#333333;stroke:#333333;}#mermaid-svg-Otf6mJSDonbcSEj5 .marker.cross{stroke:#333333;}#mermaid-svg-Otf6mJSDonbcSEj5 svg{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-Otf6mJSDonbcSEj5 p{margin:0;}#mermaid-svg-Otf6mJSDonbcSEj5 .label{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;color:#333;}#mermaid-svg-Otf6mJSDonbcSEj5 .cluster-label text{fill:#333;}#mermaid-svg-Otf6mJSDonbcSEj5 .cluster-label span{color:#333;}#mermaid-svg-Otf6mJSDonbcSEj5 .cluster-label span p{background-color:transparent;}#mermaid-svg-Otf6mJSDonbcSEj5 .label text,#mermaid-svg-Otf6mJSDonbcSEj5 span{fill:#333;color:#333;}#mermaid-svg-Otf6mJSDonbcSEj5 .node rect,#mermaid-svg-Otf6mJSDonbcSEj5 .node circle,#mermaid-svg-Otf6mJSDonbcSEj5 .node ellipse,#mermaid-svg-Otf6mJSDonbcSEj5 .node polygon,#mermaid-svg-Otf6mJSDonbcSEj5 .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-Otf6mJSDonbcSEj5 .rough-node .label text,#mermaid-svg-Otf6mJSDonbcSEj5 .node .label text,#mermaid-svg-Otf6mJSDonbcSEj5 .image-shape .label,#mermaid-svg-Otf6mJSDonbcSEj5 .icon-shape .label{text-anchor:middle;}#mermaid-svg-Otf6mJSDonbcSEj5 .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-Otf6mJSDonbcSEj5 .rough-node .label,#mermaid-svg-Otf6mJSDonbcSEj5 .node .label,#mermaid-svg-Otf6mJSDonbcSEj5 .image-shape .label,#mermaid-svg-Otf6mJSDonbcSEj5 .icon-shape .label{text-align:center;}#mermaid-svg-Otf6mJSDonbcSEj5 .node.clickable{cursor:pointer;}#mermaid-svg-Otf6mJSDonbcSEj5 .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-Otf6mJSDonbcSEj5 .arrowheadPath{fill:#333333;}#mermaid-svg-Otf6mJSDonbcSEj5 .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-Otf6mJSDonbcSEj5 .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-Otf6mJSDonbcSEj5 .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-Otf6mJSDonbcSEj5 .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-Otf6mJSDonbcSEj5 .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-Otf6mJSDonbcSEj5 .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-Otf6mJSDonbcSEj5 .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-Otf6mJSDonbcSEj5 .cluster text{fill:#333;}#mermaid-svg-Otf6mJSDonbcSEj5 .cluster span{color:#333;}#mermaid-svg-Otf6mJSDonbcSEj5 div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-Otf6mJSDonbcSEj5 .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-Otf6mJSDonbcSEj5 rect.text{fill:none;stroke-width:0;}#mermaid-svg-Otf6mJSDonbcSEj5 .icon-shape,#mermaid-svg-Otf6mJSDonbcSEj5 .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-Otf6mJSDonbcSEj5 .icon-shape p,#mermaid-svg-Otf6mJSDonbcSEj5 .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-Otf6mJSDonbcSEj5 .icon-shape rect,#mermaid-svg-Otf6mJSDonbcSEj5 .image-shape rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-Otf6mJSDonbcSEj5 .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-Otf6mJSDonbcSEj5 .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-Otf6mJSDonbcSEj5 :root{&#8211;mermaid-font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;}<span class=\"edgeLabel\"><\/p>\n<p>1.\u5207\u7247 Chunking<\/p>\n<p><\/span><span class=\"edgeLabel\"><\/p>\n<p>2.Embedding<\/p>\n<p><\/span><span class=\"edgeLabel\"><\/p>\n<p>3.Embedding<\/p>\n<p><\/span><span class=\"edgeLabel\"><\/p>\n<p>4.\u68c0\u7d22 Search<\/p>\n<p><\/span><span class=\"edgeLabel\"><\/p>\n<p>5.Top K \u76f8\u5173\u8d44\u6599<\/p>\n<p><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/p>\n<p>6.\u751f\u6210\u56de\u7b54<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u6587\u6863 Document<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u6587\u672c\u5757 Chunks<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u5411\u91cf\u6570\u636e\u5e93 Vector DB<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u7528\u6237\u63d0\u95ee Query<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u95ee\u9898\u5411\u91cf<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>LLM \u5927\u6a21\u578b<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u6700\u7ec8\u7b54\u6848<\/p>\n<p><\/span><\/p>\n<h4>3.2 \u6838\u5fc3\u7ec4\u4ef6\u9009\u62e9<\/h4>\n<ul>\n<li>Embedding \u6a21\u578b&#xff1a;\u63a8\u8350 OpenAI text-embedding-3-small&#xff08;\u4fbf\u5b9c\u3001\u6548\u679c\u597d&#xff09;\u6216 HuggingFace \u5f00\u6e90\u6a21\u578b&#xff08;\u5982 BGE, M3E&#xff09;\u3002<\/li>\n<li>\u5411\u91cf\u6570\u636e\u5e93&#xff1a;\n<ul>\n<li>\u5165\u95e8\/\u672c\u5730&#xff1a;ChromaDB, FAISS&#xff08;\u8f7b\u91cf\u7ea7&#xff0c;Python \u76f4\u63a5\u8c03&#xff09;\u3002<\/li>\n<li>\u751f\u4ea7\/\u4e91\u7aef&#xff1a;Pinecone, Weaviate, Milvus&#xff08;\u9ad8\u6027\u80fd&#xff0c;\u652f\u6301\u4ebf\u7ea7\u6570\u636e&#xff09;\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h4>3.3 \u6781\u7b80\u4ee3\u7801\u5b9e\u73b0 (Python)<\/h4>\n<p>\u8fd9\u662f\u4e00\u4e2a\u53ef\u4ee5\u8fd0\u884c\u7684\u6700\u5c0f\u5316 RAG Demo&#xff08;\u4e0d\u4f9d\u8d56\u590d\u6742\u7684\u5411\u91cf\u6570\u636e\u5e93&#xff0c;\u76f4\u63a5\u7528\u5185\u5b58\u6a21\u62df&#xff0c;\u65b9\u4fbf\u7406\u89e3\u539f\u7406&#xff09;\u3002<\/p>\n<p>\u524d\u7f6e\u51c6\u5907&#xff1a;pip install openai numpy<\/p>\n<p><span class=\"token keyword\">import<\/span> os<br \/>\n<span class=\"token keyword\">import<\/span> numpy <span class=\"token keyword\">as<\/span> np<br \/>\n<span class=\"token keyword\">from<\/span> openai <span class=\"token keyword\">import<\/span> OpenAI<\/p>\n<p><span class=\"token comment\"># 1. \u521d\u59cb\u5316\u5ba2\u6237\u7aef<\/span><br \/>\n<span class=\"token comment\"># \u6ce8\u610f&#xff1a;\u8fd9\u91cc\u6211\u4eec\u9700\u8981\u4e24\u4e2a\u5ba2\u6237\u7aef&#xff0c;\u56e0\u4e3a DeepSeek \u76ee\u524d\u53ea\u8d1f\u8d23\u5bf9\u8bdd&#xff0c;\u5411\u91cf\u5316\u8fd8\u5f97\u627e OpenAI (\u6216\u5176\u4ed6)<\/span><\/p>\n<p><span class=\"token comment\"># \u5ba2\u6237\u7aef A&#xff1a;\u8d1f\u8d23 Embedding (\u4f7f\u7528 OpenAI)<\/span><br \/>\n<span class=\"token comment\"># client_emb &#061; OpenAI(api_key&#061;&#034;YOUR_OPENAI_API_KEY&#034;)<\/span><\/p>\n<p><span class=\"token comment\"># \u5ba2\u6237\u7aef B&#xff1a;\u8d1f\u8d23\u5bf9\u8bdd\u751f\u6210 (\u4f7f\u7528 DeepSeek)<\/span><br \/>\nclient_llm <span class=\"token operator\">&#061;<\/span> OpenAI<span class=\"token punctuation\">(<\/span><br \/>\n    api_key<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;YOUR_DEEPSEEK_API_KEY&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    base_url<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;https:\/\/api.deepseek.com&#034;<\/span><br \/>\n<span class=\"token punctuation\">)<\/span><\/p>\n<p><span class=\"token comment\"># 2. \u6a21\u62df\u77e5\u8bc6\u5e93&#xff1a;\u516c\u53f8\u5185\u90e8\u62a5\u9500\u653f\u7b56 (\u8fd9\u662f\u5927\u6a21\u578b\u7edd\u5bf9\u4e0d\u77e5\u9053\u7684\u79c1\u6709\u77e5\u8bc6)<\/span><br \/>\nknowledge_base <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">[<\/span><br \/>\n    <span class=\"token string\">&#034;\u51fa\u5dee\u8865\u8d34\u653f\u7b56&#xff1a;\u4e00\u7ebf\u57ce\u5e02&#xff08;\u5317\u4e0a\u5e7f\u6df1&#xff09;\u6bcf\u5929\u8865\u8d34 300 \u5143&#xff0c;\u5176\u4ed6\u57ce\u5e02\u6bcf\u5929\u8865\u8d34 150 \u5143\u3002&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token string\">&#034;\u4ea4\u901a\u62a5\u9500\u89c4\u5b9a&#xff1a;\u9ad8\u94c1\u4e8c\u7b49\u5ea7\u5168\u989d\u62a5\u9500&#xff0c;\u98de\u673a\u7ecf\u6d4e\u8231\u9700\u63d0\u524d 3 \u5929\u7533\u8bf7&#xff0c;\u6253\u8f66\u4ec5\u9650\u665a 9 \u70b9\u540e\u3002&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token string\">&#034;\u9910\u996e\u62a5\u9500\u989d\u5ea6&#xff1a;\u5355\u4eba\u5355\u9910\u4e0a\u9650 50 \u5143&#xff0c;\u8d85\u8fc7\u90e8\u5206\u81ea\u7406&#xff0c;\u7981\u6b62\u62a5\u9500\u9152\u6c34\u3002&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token string\">&#034;\u4f4f\u5bbf\u6807\u51c6&#xff1a;\u4e00\u7ebf\u57ce\u5e02\u4e0a\u9650 600 \u5143\/\u665a&#xff0c;\u975e\u4e00\u7ebf\u57ce\u5e02\u4e0a\u9650 400 \u5143\/\u665a&#xff0c;\u5fc5\u987b\u63d0\u4f9b\u589e\u503c\u7a0e\u4e13\u7528\u53d1\u7968\u3002&#034;<\/span><br \/>\n<span class=\"token punctuation\">]<\/span><\/p>\n<p><span class=\"token comment\"># \u8f85\u52a9\u51fd\u6570&#xff1a;\u83b7\u53d6\u6587\u672c\u7684 Embedding \u5411\u91cf (\u672c\u5730\u6a21\u62df\u7248&#xff0c;\u65b9\u4fbf\u6559\u5b66)<\/span><br \/>\n<span class=\"token keyword\">def<\/span> <span class=\"token function\">get_embedding<\/span><span class=\"token punctuation\">(<\/span>text<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token comment\"># &#061;&#061;&#061; \u6559\u5b66\u6a21\u5f0f&#xff1a;\u672c\u5730\u6a21\u62df Embedding (\u65e0\u9700 API Key) &#061;&#061;&#061;<\/span><br \/>\n    <span class=\"token comment\"># \u539f\u7406&#xff1a;\u5173\u952e\u8bcd\u5339\u914d\u6a21\u62df\u5411\u91cf\u76f8\u4f3c\u5ea6<\/span><br \/>\n    <span class=\"token comment\"># \u5b9a\u4e49\u5411\u91cf\u7684\u7ef4\u5ea6\u610f\u4e49&#xff1a;[\u8865\u8d34\u76f8\u5173, \u4ea4\u901a\u76f8\u5173, \u9910\u996e\u76f8\u5173, \u4f4f\u5bbf\u76f8\u5173]<\/span><br \/>\n    vector <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token number\">0.0<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">0.0<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">0.0<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">0.0<\/span><span class=\"token punctuation\">]<\/span><\/p>\n<p>    <span class=\"token keyword\">if<\/span> <span class=\"token string\">&#034;\u8865\u8d34&#034;<\/span> <span class=\"token keyword\">in<\/span> text <span class=\"token keyword\">or<\/span> <span class=\"token string\">&#034;\u4e00\u7ebf\u57ce\u5e02&#034;<\/span> <span class=\"token keyword\">in<\/span> text<span class=\"token punctuation\">:<\/span><br \/>\n        vector<span class=\"token punctuation\">[<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">1.0<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token string\">&#034;\u4ea4\u901a&#034;<\/span> <span class=\"token keyword\">in<\/span> text <span class=\"token keyword\">or<\/span> <span class=\"token string\">&#034;\u9ad8\u94c1&#034;<\/span> <span class=\"token keyword\">in<\/span> text <span class=\"token keyword\">or<\/span> <span class=\"token string\">&#034;\u98de\u673a&#034;<\/span> <span class=\"token keyword\">in<\/span> text <span class=\"token keyword\">or<\/span> <span class=\"token string\">&#034;\u6253\u8f66&#034;<\/span> <span class=\"token keyword\">in<\/span> text<span class=\"token punctuation\">:<\/span><br \/>\n        vector<span class=\"token punctuation\">[<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">1.0<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token string\">&#034;\u9910\u996e&#034;<\/span> <span class=\"token keyword\">in<\/span> text <span class=\"token keyword\">or<\/span> <span class=\"token string\">&#034;\u5403&#034;<\/span> <span class=\"token keyword\">in<\/span> text <span class=\"token keyword\">or<\/span> <span class=\"token string\">&#034;\u9152\u6c34&#034;<\/span> <span class=\"token keyword\">in<\/span> text<span class=\"token punctuation\">:<\/span><br \/>\n        vector<span class=\"token punctuation\">[<\/span><span class=\"token number\">2<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">1.0<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token string\">&#034;\u4f4f\u5bbf&#034;<\/span> <span class=\"token keyword\">in<\/span> text <span class=\"token keyword\">or<\/span> <span class=\"token string\">&#034;\u9152\u5e97&#034;<\/span> <span class=\"token keyword\">in<\/span> text <span class=\"token keyword\">or<\/span> <span class=\"token string\">&#034;\u53d1\u7968&#034;<\/span> <span class=\"token keyword\">in<\/span> text<span class=\"token punctuation\">:<\/span><br \/>\n        vector<span class=\"token punctuation\">[<\/span><span class=\"token number\">3<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">1.0<\/span><\/p>\n<p>    <span class=\"token keyword\">if<\/span> <span class=\"token builtin\">sum<\/span><span class=\"token punctuation\">(<\/span>vector<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&#061;&#061;<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">:<\/span><br \/>\n        <span class=\"token keyword\">return<\/span> np<span class=\"token punctuation\">.<\/span>random<span class=\"token punctuation\">.<\/span>rand<span class=\"token punctuation\">(<\/span><span class=\"token number\">4<\/span><span class=\"token punctuation\">)<\/span> <\/p>\n<p>    <span class=\"token keyword\">return<\/span> vector<\/p>\n<p>    <span class=\"token comment\"># &#061;&#061;&#061; \u5982\u679c\u60a8\u6709 OpenAI Key&#xff0c;\u53ef\u4ee5\u4f7f\u7528\u4e0b\u9762\u7684\u771f\u5b9e\u4ee3\u7801 &#061;&#061;&#061;<\/span><br \/>\n    <span class=\"token comment\"># response &#061; client_emb.embeddings.create(<\/span><br \/>\n    <span class=\"token comment\">#     input&#061;text,<\/span><br \/>\n    <span class=\"token comment\">#     model&#061;&#034;text-embedding-3-small&#034;<\/span><br \/>\n    <span class=\"token comment\"># )<\/span><br \/>\n    <span class=\"token comment\"># return response.data[0].embedding<\/span><\/p>\n<p><span class=\"token comment\">#\u8f85\u52a9\u51fd\u6570&#xff1a;\u8ba1\u7b97\u4f59\u5f26\u76f8\u4f3c\u5ea6<\/span><br \/>\n<span class=\"token keyword\">def<\/span> <span class=\"token function\">cosine_similarity<\/span><span class=\"token punctuation\">(<\/span>v1<span class=\"token punctuation\">,<\/span> v2<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> np<span class=\"token punctuation\">.<\/span>dot<span class=\"token punctuation\">(<\/span>v1<span class=\"token punctuation\">,<\/span> v2<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">\/<\/span> <span class=\"token punctuation\">(<\/span>np<span class=\"token punctuation\">.<\/span>linalg<span class=\"token punctuation\">.<\/span>norm<span class=\"token punctuation\">(<\/span>v1<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">*<\/span> np<span class=\"token punctuation\">.<\/span>linalg<span class=\"token punctuation\">.<\/span>norm<span class=\"token punctuation\">(<\/span>v2<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p><span class=\"token keyword\">def<\/span> <span class=\"token function\">simple_chat<\/span><span class=\"token punctuation\">(<\/span>user_query<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string-interpolation\"><span class=\"token string\">f&#034;\\\\n[\u65e0 RAG] \u6b63\u5728\u76f4\u63a5\u95ee\u5927\u6a21\u578b&#xff1a;<\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span>user_query<span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\"> &#8230;&#034;<\/span><\/span><span class=\"token punctuation\">)<\/span><br \/>\n    response <span class=\"token operator\">&#061;<\/span> client_llm<span class=\"token punctuation\">.<\/span>chat<span class=\"token punctuation\">.<\/span>completions<span class=\"token punctuation\">.<\/span>create<span class=\"token punctuation\">(<\/span><br \/>\n        model<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;deepseek-chat&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n        messages<span class=\"token operator\">&#061;<\/span><span class=\"token punctuation\">[<\/span><br \/>\n            <span class=\"token punctuation\">{<\/span><span class=\"token string\">&#034;role&#034;<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#034;system&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;content&#034;<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#034;\u4f60\u662f\u4e00\u4e2a\u6709\u7528\u7684\u52a9\u624b\u3002&#034;<\/span><span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">,<\/span><br \/>\n            <span class=\"token punctuation\">{<\/span><span class=\"token string\">&#034;role&#034;<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#034;user&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;content&#034;<\/span><span class=\"token punctuation\">:<\/span> user_query<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">,<\/span><br \/>\n        <span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">,<\/span><br \/>\n        temperature<span class=\"token operator\">&#061;<\/span><span class=\"token number\">0.7<\/span><span class=\"token punctuation\">,<\/span>  <span class=\"token comment\"># \u95f2\u804a\u6a21\u5f0f\u53ef\u4ee5\u7a0d\u5fae\u9ad8\u4e00\u70b9&#xff0c;\u66f4\u6709\u521b\u9020\u6027<\/span><br \/>\n    <span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> response<span class=\"token punctuation\">.<\/span>choices<span class=\"token punctuation\">[<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">.<\/span>message<span class=\"token punctuation\">.<\/span>content<\/p>\n<p><span class=\"token keyword\">def<\/span> <span class=\"token function\">rag_chat<\/span><span class=\"token punctuation\">(<\/span>user_query<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string-interpolation\"><span class=\"token string\">f&#034;\\\\n[\u6709 RAG] \u6b63\u5728\u601d\u8003\u95ee\u9898&#xff1a;<\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span>user_query<span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\"> &#8230;&#034;<\/span><\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>    <span class=\"token comment\"># &#061;&#061;&#061; \u6b65\u9aa4 1&#xff1a;\u68c0\u7d22 (Retrieval) &#061;&#061;&#061;<\/span><\/p>\n<p>    <span class=\"token comment\"># 1.1 \u628a\u7528\u6237\u95ee\u9898\u53d8\u6210\u5411\u91cf<\/span><br \/>\n    query_vector <span class=\"token operator\">&#061;<\/span> get_embedding<span class=\"token punctuation\">(<\/span>user_query<span class=\"token punctuation\">)<\/span><\/p>\n<p>    <span class=\"token comment\"># 1.2 \u904d\u5386\u77e5\u8bc6\u5e93&#xff0c;\u8ba1\u7b97\u76f8\u4f3c\u5ea6<\/span><br \/>\n    similarities <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">]<\/span><br \/>\n    <span class=\"token keyword\">for<\/span> doc <span class=\"token keyword\">in<\/span> knowledge_base<span class=\"token punctuation\">:<\/span><br \/>\n        doc_vector <span class=\"token operator\">&#061;<\/span> get_embedding<span class=\"token punctuation\">(<\/span>doc<span class=\"token punctuation\">)<\/span><br \/>\n        score <span class=\"token operator\">&#061;<\/span> cosine_similarity<span class=\"token punctuation\">(<\/span>query_vector<span class=\"token punctuation\">,<\/span> doc_vector<span class=\"token punctuation\">)<\/span><br \/>\n        similarities<span class=\"token punctuation\">.<\/span>append<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">(<\/span>score<span class=\"token punctuation\">,<\/span> doc<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>    <span class=\"token comment\"># 1.3 \u627e\u51fa\u6700\u76f8\u4f3c\u7684 Top 1<\/span><br \/>\n    similarities<span class=\"token punctuation\">.<\/span>sort<span class=\"token punctuation\">(<\/span>key<span class=\"token operator\">&#061;<\/span><span class=\"token keyword\">lambda<\/span> x<span class=\"token punctuation\">:<\/span> x<span class=\"token punctuation\">[<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">,<\/span> reverse<span class=\"token operator\">&#061;<\/span><span class=\"token boolean\">True<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    best_doc <span class=\"token operator\">&#061;<\/span> similarities<span class=\"token punctuation\">[<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">[<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">]<\/span><br \/>\n    <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string-interpolation\"><span class=\"token string\">f&#034;\u2705 \u627e\u5230\u6700\u76f8\u5173\u8d44\u6599 (\u76f8\u4f3c\u5ea6 <\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span>similarities<span class=\"token punctuation\">[<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">[<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">:<\/span><span class=\"token format-spec\">.4f<\/span><span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\">):\\\\n   -&gt; <\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span>best_doc<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\"># &#061;&#061;&#061; \u6b65\u9aa4 2&#xff1a;\u751f\u6210 (Generation) &#061;&#061;&#061;<\/span><\/p>\n<p>    <span class=\"token comment\"># 2.1 \u7ec4\u88c5 Prompt<\/span><br \/>\n    prompt <span class=\"token operator\">&#061;<\/span> <span class=\"token string-interpolation\"><span class=\"token string\">f&#034;&#034;&#034;<br \/>\n    \u4f60\u662f\u4e00\u4e2a\u516c\u53f8\u7684\u884c\u653f\u52a9\u624b\u3002\u8bf7\u57fa\u4e8e\u4ee5\u4e0b\u3010\u516c\u53f8\u5185\u90e8\u653f\u7b56\u3011\u56de\u7b54\u5458\u5de5\u95ee\u9898\u3002<br \/>\n    \u26a0\ufe0f \u4e25\u683c\u57fa\u4e8e\u53c2\u8003\u8d44\u6599\u56de\u7b54&#xff0c;\u4e0d\u8981\u7f16\u9020\u3002<\/p>\n<p>    \u53c2\u8003\u8d44\u6599&#xff1a;<br \/>\n    <\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span>best_doc<span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\"><\/p>\n<p>    \u5458\u5de5\u95ee\u9898&#xff1a;<br \/>\n    <\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span>user_query<span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\"><br \/>\n    &#034;&#034;&#034;<\/span><\/span><\/p>\n<p>    <span class=\"token comment\"># 2.2 \u8c03\u7528 LLM<\/span><br \/>\n    response <span class=\"token operator\">&#061;<\/span> client_llm<span class=\"token punctuation\">.<\/span>chat<span class=\"token punctuation\">.<\/span>completions<span class=\"token punctuation\">.<\/span>create<span class=\"token punctuation\">(<\/span><br \/>\n        model<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;deepseek-chat&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n        messages<span class=\"token operator\">&#061;<\/span><span class=\"token punctuation\">[<\/span><br \/>\n            <span class=\"token punctuation\">{<\/span><span class=\"token string\">&#034;role&#034;<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#034;system&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;content&#034;<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#034;\u4f60\u662f\u4e00\u4e2a\u6709\u7528\u7684\u52a9\u624b\u3002&#034;<\/span><span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">,<\/span><br \/>\n            <span class=\"token punctuation\">{<\/span><span class=\"token string\">&#034;role&#034;<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#034;user&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;content&#034;<\/span><span class=\"token punctuation\">:<\/span> prompt<span class=\"token punctuation\">}<\/span><br \/>\n        <span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">,<\/span><br \/>\n        temperature<span class=\"token operator\">&#061;<\/span><span class=\"token number\">0.1<\/span>  <span class=\"token comment\"># \u5173\u952e\u8bbe\u7f6e&#xff1a;RAG \u4efb\u52a1\u5efa\u8bae\u8bbe\u4f4e\u6e29\u5ea6&#xff0c;\u8ba9\u56de\u7b54\u66f4\u4e25\u8c28&#xff0c;\u51cf\u5c11\u5e7b\u89c9<\/span><br \/>\n    <span class=\"token punctuation\">)<\/span><\/p>\n<p>    <span class=\"token keyword\">return<\/span> response<span class=\"token punctuation\">.<\/span>choices<span class=\"token punctuation\">[<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">.<\/span>message<span class=\"token punctuation\">.<\/span>content<\/p>\n<p><span class=\"token comment\"># Main \u8fd0\u884c<\/span><br \/>\n<span class=\"token keyword\">if<\/span> __name__ <span class=\"token operator\">&#061;&#061;<\/span> <span class=\"token string\">&#034;__main__&#034;<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    test_query <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#034;\u6211\u53bb\u4e0a\u6d77\u51fa\u5dee&#xff0c;\u6bcf\u5929\u8865\u8d34\u591a\u5c11\u94b1&#xff1f;&#034;<\/span><\/p>\n<p>    <span class=\"token comment\"># 1. \u5bf9\u6bd4&#xff1a;\u65e0 RAG (\u76f4\u63a5\u95ee)<\/span><br \/>\n    answer_no_rag <span class=\"token operator\">&#061;<\/span> simple_chat<span class=\"token punctuation\">(<\/span>test_query<span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string-interpolation\"><span class=\"token string\">f&#034;\\\\n\u274c [\u65e0 RAG] AI \u56de\u7b54&#xff1a;\\\\n<\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span>answer_no_rag<span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\">\\\\n&#034;<\/span><\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;-&#034;<\/span> <span class=\"token operator\">*<\/span> <span class=\"token number\">50<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>    <span class=\"token comment\"># 2. \u5bf9\u6bd4&#xff1a;\u6709 RAG (\u67e5\u8d44\u6599\u540e\u518d\u95ee)<\/span><br \/>\n    answer_rag <span class=\"token operator\">&#061;<\/span> rag_chat<span class=\"token punctuation\">(<\/span>test_query<span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string-interpolation\"><span class=\"token string\">f&#034;\\\\n\u2705 [\u6709 RAG] AI \u56de\u7b54&#xff1a;\\\\n<\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span>answer_rag<span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\">&#034;<\/span><\/span><span class=\"token punctuation\">)<\/span><\/p>\n<hr \/>\n<h3>4. \u603b\u7ed3<\/h3>\n<li>RAG \u662f\u4f01\u4e1a\u7ea7 AI \u5e94\u7528\u7684\u57fa\u77f3\u3002\u5b83\u89e3\u51b3\u4e86 AI \u77e5\u8bc6\u8fc7\u65f6 \u548c \u6570\u636e\u9690\u79c1 \u4e24\u5927\u75db\u70b9\u3002<\/li>\n<li>Embedding \u662f RAG \u7684\u6838\u5fc3&#xff0c;\u5b83\u5b9e\u73b0\u4e86\u201c\u8bed\u4e49\u641c\u7d22\u201d&#xff08;\u641c\u610f\u601d&#xff0c;\u800c\u4e0d\u662f\u641c\u5173\u952e\u8bcd&#xff09;\u3002<\/li>\n<p>\u4e0b\u4e00\u7bc7\u9884\u544a&#xff1a;<br \/>\n\u57fa\u672c\u7684 RAG \u505a\u51fa\u6765\u4e86&#xff0c;\u4f46\u4f60\u4f1a\u53d1\u73b0\u6548\u679c\u6709\u65f6\u5019\u5e76\u4e0d\u597d&#xff1a;<\/p>\n<ul>\n<li>\u5207\u7247\u5207\u65ad\u4e86\u4e0a\u4e0b\u6587\u600e\u4e48\u529e&#xff1f;<\/li>\n<li>\u641c\u51fa\u6765\u7684\u8d44\u6599\u4e0d\u51c6\u600e\u4e48\u529e&#xff1f;<br \/>\n\u4e0b\u4e00\u7bc7&#xff0c;\u6211\u4eec\u5c06\u5b66\u4e60 RAG \u8fdb\u9636\u4e0e\u8bc4\u4f30&#xff0c;\u5f15\u5165 Rerank (\u91cd\u6392\u5e8f) \u548c \u6df7\u5408\u68c0\u7d22&#xff0c;\u6253\u9020\u751f\u4ea7\u7ea7\u522b\u7684 RAG \u7cfb\u7edf&#xff01;<\/li>\n<\/ul>\n<hr \/>\n<h4>&#x1f4e2; \u5173\u6ce8\u201c\u98de\u54e5\u201d<\/h4>\n<p>\u770b\u5f97\u61c2\u3001\u5b66\u5f97\u4f1a\u3001\u7528\u5f97\u4e0a&#xff0c;\u6211\u662f\u98de\u54e5&#xff0c;\u4e00\u4e2a\u62e5\u6709 10 \u5e74\u7ecf\u9a8c\u7684\u5168\u6808 AI \u5f00\u53d1\u8005\u3002<\/p>\n<ul>\n<li>&#x1f44d; \u70b9\u8d5e\/\u6536\u85cf&#xff1a;\u65b9\u4fbf\u65e5\u540e\u590d\u4e60&#xff0c;\u4e5f\u9632\u6b62\u8d70\u4e22\u3002<\/li>\n<li>&#x1f5e3;\ufe0f \u4ea4\u6d41\u8ba8\u8bba&#xff1a;\u5728\u8bc4\u8bba\u533a\u7559\u4e0b\u4f60\u7684\u95ee\u9898&#xff0c;\u98de\u54e5\u770b\u5230\u5fc5\u56de&#xff01;<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u4f5c\u8005&#xff1a;\u98de\u54e5&#xff08;\u4e00\u4f4d\u559c\u6b22\u8bb2\u6545\u4e8b\u7684\u5168\u6808\u5f00\u53d1\u8005&#xff0c;\u64c5\u957f\u628a\u590d\u6742\u7684\u4ee3\u7801\u7ffb\u8bd1\u6210\u201c\u4eba\u8bdd\u201d&#xff09;<br \/>\n\u9636\u6bb5&#xff1a;GenAI \u4e0e\u5927\u6a21\u578b\u5e94\u7528<br \/>\n\u5173\u952e\u8bcd&#xff1a;RAG, Embedding, \u5411\u91cf\u6570\u636e\u5e93, \u77e5\u8bc6\u5e93\u95ee\u7b54\u5927\u5bb6\u597d&#xff0c;\u6211\u662f\u98de\u54e5\u3002<br \/>\n\u524d\u4e24\u5468\u6211\u4eec\u5b66\u4f1a\u4e86\u8ba9 AI \u201c\u597d\u597d\u8bf4\u8bdd\u201d&#xff08;Prompt&#xff09;\u548c\u201c\u52a8\u624b\u5e72\u6d3b\u201d&#xff08;Function Calling&#xff09;\u3002<br \/>\n\u4f46\u4f60\u5728\u5b9e\u9645\u5f00\u53d1\u4e2d&amp;#xff0<\/p>\n","protected":false},"author":2,"featured_media":59922,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[6327,6328,346,81,2871,190],"topic":[],"class_list":["post-59923","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-eag","tag-6328","tag-embedding","tag-python","tag-2871","tag-190"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>DeepSeek + RAG \u624b\u628a\u624b\u5b9e\u6218\uff1a\u4ece 0 \u5230 1 \u6253\u9020\u4f60\u7684\u4e2a\u4eba\u77e5\u8bc6\u5e93\u52a9\u624b\uff08\u9644 Python \u6e90\u7801\uff09 - \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\/59923.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"DeepSeek + RAG \u624b\u628a\u624b\u5b9e\u6218\uff1a\u4ece 0 \u5230 1 \u6253\u9020\u4f60\u7684\u4e2a\u4eba\u77e5\u8bc6\u5e93\u52a9\u624b\uff08\u9644 Python \u6e90\u7801\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u4f5c\u8005&#xff1a;\u98de\u54e5&#xff08;\u4e00\u4f4d\u559c\u6b22\u8bb2\u6545\u4e8b\u7684\u5168\u6808\u5f00\u53d1\u8005&#xff0c;\u64c5\u957f\u628a\u590d\u6742\u7684\u4ee3\u7801\u7ffb\u8bd1\u6210\u201c\u4eba\u8bdd\u201d&#xff09; \u9636\u6bb5&#xff1a;GenAI \u4e0e\u5927\u6a21\u578b\u5e94\u7528 \u5173\u952e\u8bcd&#xff1a;RAG, Embedding, \u5411\u91cf\u6570\u636e\u5e93, \u77e5\u8bc6\u5e93\u95ee\u7b54\u5927\u5bb6\u597d&#xff0c;\u6211\u662f\u98de\u54e5\u3002 \u524d\u4e24\u5468\u6211\u4eec\u5b66\u4f1a\u4e86\u8ba9 AI \u201c\u597d\u597d\u8bf4\u8bdd\u201d&#xff08;Prompt&#xff09;\u548c\u201c\u52a8\u624b\u5e72\u6d3b\u201d&#xff08;Function Calling&#xff09;\u3002 \u4f46\u4f60\u5728\u5b9e\u9645\u5f00\u53d1\u4e2d&amp;#xff0\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/59923.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-01-14T10:05:29+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260114100528-69676a680e130.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"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\/59923.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/59923.html\",\"name\":\"DeepSeek + RAG \u624b\u628a\u624b\u5b9e\u6218\uff1a\u4ece 0 \u5230 1 \u6253\u9020\u4f60\u7684\u4e2a\u4eba\u77e5\u8bc6\u5e93\u52a9\u624b\uff08\u9644 Python \u6e90\u7801\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-01-14T10:05:29+00:00\",\"dateModified\":\"2026-01-14T10:05:29+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/59923.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/59923.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/59923.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"DeepSeek + RAG \u624b\u628a\u624b\u5b9e\u6218\uff1a\u4ece 0 \u5230 1 \u6253\u9020\u4f60\u7684\u4e2a\u4eba\u77e5\u8bc6\u5e93\u52a9\u624b\uff08\u9644 Python \u6e90\u7801\uff09\"}]},{\"@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":"DeepSeek + RAG \u624b\u628a\u624b\u5b9e\u6218\uff1a\u4ece 0 \u5230 1 \u6253\u9020\u4f60\u7684\u4e2a\u4eba\u77e5\u8bc6\u5e93\u52a9\u624b\uff08\u9644 Python \u6e90\u7801\uff09 - \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\/59923.html","og_locale":"zh_CN","og_type":"article","og_title":"DeepSeek + RAG \u624b\u628a\u624b\u5b9e\u6218\uff1a\u4ece 0 \u5230 1 \u6253\u9020\u4f60\u7684\u4e2a\u4eba\u77e5\u8bc6\u5e93\u52a9\u624b\uff08\u9644 Python \u6e90\u7801\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u4f5c\u8005&#xff1a;\u98de\u54e5&#xff08;\u4e00\u4f4d\u559c\u6b22\u8bb2\u6545\u4e8b\u7684\u5168\u6808\u5f00\u53d1\u8005&#xff0c;\u64c5\u957f\u628a\u590d\u6742\u7684\u4ee3\u7801\u7ffb\u8bd1\u6210\u201c\u4eba\u8bdd\u201d&#xff09; \u9636\u6bb5&#xff1a;GenAI \u4e0e\u5927\u6a21\u578b\u5e94\u7528 \u5173\u952e\u8bcd&#xff1a;RAG, Embedding, \u5411\u91cf\u6570\u636e\u5e93, \u77e5\u8bc6\u5e93\u95ee\u7b54\u5927\u5bb6\u597d&#xff0c;\u6211\u662f\u98de\u54e5\u3002 \u524d\u4e24\u5468\u6211\u4eec\u5b66\u4f1a\u4e86\u8ba9 AI \u201c\u597d\u597d\u8bf4\u8bdd\u201d&#xff08;Prompt&#xff09;\u548c\u201c\u52a8\u624b\u5e72\u6d3b\u201d&#xff08;Function Calling&#xff09;\u3002 \u4f46\u4f60\u5728\u5b9e\u9645\u5f00\u53d1\u4e2d&amp;#xff0","og_url":"https:\/\/www.wsisp.com\/helps\/59923.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-01-14T10:05:29+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260114100528-69676a680e130.png"}],"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\/59923.html","url":"https:\/\/www.wsisp.com\/helps\/59923.html","name":"DeepSeek + RAG \u624b\u628a\u624b\u5b9e\u6218\uff1a\u4ece 0 \u5230 1 \u6253\u9020\u4f60\u7684\u4e2a\u4eba\u77e5\u8bc6\u5e93\u52a9\u624b\uff08\u9644 Python \u6e90\u7801\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-01-14T10:05:29+00:00","dateModified":"2026-01-14T10:05:29+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/59923.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/59923.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/59923.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"DeepSeek + RAG \u624b\u628a\u624b\u5b9e\u6218\uff1a\u4ece 0 \u5230 1 \u6253\u9020\u4f60\u7684\u4e2a\u4eba\u77e5\u8bc6\u5e93\u52a9\u624b\uff08\u9644 Python \u6e90\u7801\uff09"}]},{"@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\/59923","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=59923"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/59923\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/59922"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=59923"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=59923"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=59923"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=59923"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}