{"id":108493,"date":"2026-09-21T22:24:42","date_gmt":"2026-09-21T14:24:42","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/108493.html"},"modified":"2026-09-21T22:24:42","modified_gmt":"2026-09-21T14:24:42","slug":"llm%e4%b9%8bagent%ef%bc%88%e5%85%ab%e5%8d%81%e4%b9%9d%ef%bc%89%ef%bd%9cpi%ef%bc%88%e4%ba%8c%e5%8d%81%e5%85%ab%ef%bc%89%e6%b5%8b%e8%af%95%e7%ad%96%e7%95%a5%ef%bc%9afaux-provider-%e4%b8%8e-evals","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/108493.html","title":{"rendered":"LLM\u4e4bAgent\uff08\u516b\u5341\u4e5d\uff09\uff5cPI\uff08\u4e8c\u5341\u516b\uff09\u6d4b\u8bd5\u7b56\u7565\uff1aFaux Provider \u4e0e Evals"},"content":{"rendered":"<p>                    pi \u7684\u6d4b\u8bd5\u4f53\u7cfb\u5206\u4e09\u5c42&#xff1a;\u4e0d\u4f9d\u8d56\u6a21\u578b\u7684\u786e\u5b9a\u6027\u5355\u5143\/\u96c6\u6210\u6d4b\u8bd5\u3001\u9700\u8981\u771f\u5b9e\u5bc6\u94a5\u624d\u4f1a\u6fc0\u6d3b\u7684 e2e \u6d4b\u8bd5&#xff0c;\u4ee5\u53ca\u4e13\u95e8\u8bc4\u6d4b Agent \u5728\u771f\u5b9e\u4efb\u52a1\u4e0a\u8868\u73b0\u8d28\u91cf\u7684 evals \u4f53\u7cfb&#xff1b;\u7528\u4e00\u4e2a&#034;\u5047\u7684&#034;\u6a21\u578b provider&#xff08;faux provider&#xff09;\u628a Agent \u903b\u8f91\u6d4b\u8bd5\u548c\u771f\u5b9e API \u5f7b\u5e95\u89e3\u8026&#xff0c;\u662f\u8d2f\u7a7f\u6574\u4e2a\u6d4b\u8bd5\u7b56\u7565\u7684\u6838\u5fc3\u8bbe\u8ba1\u3002<\/p>\n<h3>\u5b66\u4e60\u76ee\u6807<\/h3>\n<ul>\n<li>\u7406\u89e3 pi \u4ed3\u5e93\u91cc\u5355\u5143\/\u96c6\u6210\u6d4b\u8bd5\u3001e2e \u6d4b\u8bd5\u3001evals \u4e09\u8005\u7684\u5b9a\u4f4d\u5dee\u5f02&#xff0c;\u4ee5\u53ca\u4e3a\u4ec0\u4e48\u5b83\u4eec\u4e0d\u80fd\u4e92\u76f8\u66ff\u4ee3\u3002<\/li>\n<li>\u77e5\u9053 .\/test.sh \u5177\u4f53\u505a\u4e86\u4ec0\u4e48\u3001\u4e3a\u4ec0\u4e48\u4e0d\u80fd\u76f4\u63a5\u8dd1\u5b8c\u6574\u7684 vitest \u5957\u4ef6&#xff0c;\u4ee5\u53ca\u5982\u4f55\u9488\u5bf9\u5355\u4e2a\u6d4b\u8bd5\u6587\u4ef6\u8dd1\u6d4b\u8bd5&#xff08;vitest \u5305\u4e0e packages\/tui \u7684\u547d\u4ee4\u662f\u4e0d\u540c\u7684&#xff09;\u3002<\/li>\n<li>\u8bfb\u61c2 packages\/coding-agent\/test\/suite\/harness.ts \u5982\u4f55\u7528 faux provider \u642d\u5efa\u4e00\u4e2a\u53ef\u7f16\u6392\u5bf9\u8bdd\u811a\u672c\u7684\u6d4b\u8bd5\u6c99\u76d2\u3002<\/li>\n<li>\u7406\u89e3 packages\/evals\/ \u7684\u5b9a\u4f4d&#xff1a;\u5b83\u8bc4\u6d4b\u7684\u662f Agent \u5728\u771f\u5b9e\u6a21\u578b\u9a71\u52a8\u4e0b\u5b8c\u6210\u4efb\u52a1\u7684\u8d28\u91cf&#xff0c;\u800c\u4e0d\u662f&#034;\u8fd9\u884c\u4ee3\u7801\u5bf9\u4e0d\u5bf9&#034;\u3002<\/li>\n<li>\u638c\u63e1\u56de\u5f52\u6d4b\u8bd5&#xff08;regression test&#xff09;\u7684\u76ee\u5f55\u7ec4\u7ec7\u7ea6\u5b9a&#xff0c;\u80fd\u591f\u6309\u89c4\u8303\u65b0\u589e\u4e00\u4e2a\u56de\u5f52\u6d4b\u8bd5\u6587\u4ef6\u3002<\/li>\n<\/ul>\n<h3>\u4e00\u3001\u4e09\u5c42\u6d4b\u8bd5\u4f53\u7cfb\u603b\u89c8<\/h3>\n<p>pi \u7684\u6d4b\u8bd5\u5e76\u4e0d\u662f&#034;\u4e00\u4e2a vitest \u547d\u4ee4\u8dd1\u5230\u5e95&#034;&#xff0c;\u800c\u662f\u6309\u7167\u662f\u5426\u9700\u8981\u771f\u5b9e\u6a21\u578b\u3001\u662f\u5426\u9700\u8981\u771f\u5b9e\u5bc6\u94a5&#xff0c;\u62c6\u6210\u4e86\u4e09\u4e2a\u6027\u8d28\u4e0d\u540c\u7684\u5c42\u6b21&#xff1a;<\/p>\n<table>\n<tbody>\n<tr>\u5c42\u6b21\u4f4d\u7f6e\u662f\u5426\u9700\u8981\u771f\u5b9e API\/\u5bc6\u94a5\u76ee\u7684<\/tr>\n<tr>\n<td>\u5355\u5143\/\u96c6\u6210\u6d4b\u8bd5<\/td>\n<td>\u5404\u5305 test\/&#xff08;vitest&#xff09;&#xff0c;packages\/tui \u7528 node:test<\/td>\n<td>\u4e0d\u9700\u8981&#xff08;\u7528 faux provider \u6216\u7eaf\u903b\u8f91\u65ad\u8a00&#xff09;<\/td>\n<td>\u9a8c\u8bc1\u4ee3\u7801\u903b\u8f91\u6b63\u786e\u6027&#xff0c;CI \u5e38\u6001\u5316\u8fd0\u884c<\/td>\n<\/tr>\n<tr>\n<td>e2e \u6d4b\u8bd5<\/td>\n<td>\u4e0e\u5355\u5143\u6d4b\u8bd5\u6df7\u5728\u540c\u4e00\u6279\u6587\u4ef6\u91cc&#xff0c;\u9760 describe.skipIf \u5224\u65ad\u73af\u5883\u53d8\u91cf<\/td>\n<td>\u9700\u8981\u771f\u5b9e provider \u7684\u5bc6\u94a5<\/td>\n<td>\u9a8c\u8bc1\u4e0e\u771f\u5b9e\u5382\u5546 API \u7684\u5bf9\u63a5\u7ec6\u8282&#xff08;\u5982\u6d41\u5f0f\u534f\u8bae\u3001\u8ba4\u8bc1\u65b9\u5f0f\u7684\u8fb9\u754c\u60c5\u51b5&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>Evals<\/td>\n<td>packages\/evals\/<\/td>\n<td>\u9700\u8981\u771f\u5b9e provider \u7684\u5bc6\u94a5&#xff08;\u901a\u8fc7 &#8211;provider\/&#8211;model \u6216\u73af\u5883\u53d8\u91cf\u6307\u5b9a&#xff09;<\/td>\n<td>\u8bc4\u6d4b Agent \u5728\u771f\u5b9e\u4efb\u52a1\u4e0a\u7684\u884c\u4e3a\u8d28\u91cf&#xff0c;\u800c\u975e\u65ad\u8a00\u5f0f\u5bf9\u9519<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u8fd9\u4e09\u5c42\u7684\u5173\u7cfb\u662f\u4e92\u8865\u800c\u975e\u66ff\u4ee3&#xff1a;\u5355\u5143\u6d4b\u8bd5\u4fdd\u8bc1&#034;\u903b\u8f91\u6ca1\u5199\u9519&#034;&#xff0c;e2e \u6d4b\u8bd5\u4fdd\u8bc1&#034;\u548c\u771f\u5b9e\u5382\u5546 API \u5bf9\u63a5\u6ca1\u95ee\u9898&#034;&#xff0c;evals \u4fdd\u8bc1&#034;\u6a21\u578b &#043; \u5de5\u5177 &#043; \u63d0\u793a\u8bcd\u7ec4\u5408\u51fa\u6765\u7684\u6574\u4f53\u884c\u4e3a\u662f\u597d\u7684&#034;\u3002\u4e09\u8005\u6df7\u7528\u540c\u4e00\u5957 vitest&#xff0c;\u4f46\u89e6\u53d1\u6761\u4ef6\u548c\u8fd0\u884c\u6210\u672c\u5b8c\u5168\u4e0d\u540c&#xff0c;\u8fd9\u4e5f\u662f\u4e3a\u4ec0\u4e48\u4ed3\u5e93\u8981\u4e13\u95e8\u5199\u811a\u672c\u628a\u5b83\u4eec\u5206\u5f00\u7ba1\u7406\u3002<\/p>\n<h4>e2e \u6d4b\u8bd5\u7684\u8bc6\u522b\u65b9\u5f0f&#xff1a;describe.skipIf<\/h4>\n<p>pi \u6ca1\u6709\u628a e2e \u6d4b\u8bd5\u653e\u8fdb\u5355\u72ec\u76ee\u5f55&#xff0c;\u800c\u662f\u8ba9\u5b83\u4eec\u548c\u666e\u901a\u5355\u5143\u6d4b\u8bd5\u6587\u4ef6\u6df7\u5728\u4e00\u8d77&#xff0c;\u901a\u8fc7 describe.skipIf(!process.env.XXX_API_KEY) \u5728\u6ca1\u6709\u5bc6\u94a5\u65f6\u81ea\u52a8\u8df3\u8fc7\u3002\u4f8b\u5982 packages\/ai\/test\/anthropic-opus-4-8-smoke.test.ts&#xff1a;<\/p>\n<p>describe.skipIf(!process.env.ANTHROPIC_API_KEY)(&#034;Anthropic Opus 4.8 smoke&#034;, () &#061;&gt; {<br \/>\n    &#8230;<br \/>\n});<\/p>\n<p>packages\/ai\/test\/openai-responses-reasoning-replay-e2e.test.ts \u751a\u81f3\u9700\u8981\u4e24\u4e2a\u5bc6\u94a5\u540c\u65f6\u5b58\u5728\u624d\u4f1a\u8fd0\u884c&#xff1a;<\/p>\n<p>describe.skipIf(!process.env.OPENAI_API_KEY || !process.env.ANTHROPIC_API_KEY)(<br \/>\n    &#034;OpenAI Responses reasoning replay e2e&#034;,<br \/>\n    () &#061;&gt; {<br \/>\n        &#8230;<br \/>\n    },<br \/>\n);<\/p>\n<p>\u8fd9\u6b63\u662f\u6839\u76ee\u5f55 AGENTS.md \u91cc\u90a3\u53e5\u8bdd\u7684\u4f9d\u636e&#xff1a;<\/p>\n<p>Never run the full vitest suite directly: it includes e2e tests that activate when endpoint\/auth env vars are present.<\/p>\n<p>\u4e5f\u5c31\u662f\u8bf4&#xff0c;\u5982\u679c\u4f60\u5728\u672c\u5730\u5df2\u7ecf\u914d\u7f6e\u4e86\u67d0\u4e2a provider \u7684\u5bc6\u94a5&#xff08;\u6bd4\u5982\u4e3a\u4e86\u6b63\u5e38\u4f7f\u7528 pi&#xff09;&#xff0c;\u76f4\u63a5\u8dd1\u5b8c\u6574 vitest \u5957\u4ef6\u4f1a\u628a\u8fd9\u4e9b e2e \u6d4b\u8bd5\u4e5f\u6fc0\u6d3b&#xff0c;\u4ea7\u751f\u771f\u5b9e\u7684\u7f51\u7edc\u8bf7\u6c42\u548c\u771f\u5b9e\u7684 token \u6d88\u8017\u2014\u2014\u8fd9\u65e2\u4e0d\u786e\u5b9a&#xff08;\u4f9d\u8d56\u5916\u90e8\u670d\u52a1\u53ef\u7528\u6027&#xff09;&#xff0c;\u4e5f\u4e0d\u4fbf\u5b9c&#xff08;\u6d88\u8017\u771f\u5b9e\u914d\u989d&#xff09;&#xff0c;\u56e0\u6b64\u4ed3\u5e93\u660e\u786e\u7981\u6b62\u3002<\/p>\n<h3>\u4e8c\u3001.\/test.sh&#xff1a;\u5982\u4f55\u5728&#034;\u5e72\u51c0\u623f\u95f4&#034;\u91cc\u8dd1\u6d4b\u8bd5<\/h3>\n<p>\u6839\u76ee\u5f55\u7684 test.sh&#xff08;\u5b8c\u6574\u5185\u5bb9\u89c1\u4ed3\u5e93\u6839\u76ee\u5f55&#xff09;\u4e0d\u662f\u7b80\u5355\u5730\u8c03\u7528 npm test&#xff0c;\u800c\u662f\u5148\u6784\u9020\u4e00\u4e2a\u9694\u79bb\u7684\u6267\u884c\u73af\u5883&#xff0c;\u518d\u628a\u73af\u5883\u53d8\u91cf\u6e05\u7a7a\u5230\u53ea\u4fdd\u7559\u5fc5\u9700\u9879&#xff0c;\u7136\u540e\u624d\u6267\u884c npm test\u3002\u5173\u952e\u903b\u8f91&#xff1a;<\/p>\n<p>temp_parent&#061;&#034;${TMPDIR:-\/tmp}&#034;<br \/>\ntest_root&#061;&#034;$(mktemp -d &#034;$temp_parent\/pi-test.XXXXXX&#034;)&#034;<br \/>\n&#8230;<br \/>\ntest_env&#061;(<br \/>\n    &#034;PATH&#061;$PATH&#034; &#034;PWD&#061;$PWD&#034;<br \/>\n    &#034;HOME&#061;$test_root\/home&#034; &#034;TMPDIR&#061;$test_root\/tmp&#034;<br \/>\n    &#034;XDG_CONFIG_HOME&#061;$test_root\/home\/.config&#034; &#034;XDG_CACHE_HOME&#061;$test_root\/cache&#034;<br \/>\n    &#034;LANG&#061;C&#034; &#034;LC_ALL&#061;C&#034; &#034;TZ&#061;UTC&#034;<br \/>\n    &#034;GIT_CONFIG_NOSYSTEM&#061;1&#034; &#034;GIT_CONFIG_GLOBAL&#061;\/dev\/null&#034;<br \/>\n    &#8230;<br \/>\n    &#034;PI_NO_LOCAL_LLM&#061;1&#034;<br \/>\n    &#8230;<br \/>\n)<br \/>\necho &#034;Running tests without API keys in isolated home: $test_root\/home&#034;<br \/>\nenv -i &#034;${test_env[&#064;]}&#034; npm test<\/p>\n<p>\u8fd9\u6bb5\u811a\u672c\u505a\u4e86\u4e24\u4ef6\u4e8b&#xff1a;\u628a HOME\u3001TMPDIR\u3001npm \u914d\u7f6e\u3001git \u914d\u7f6e\u5168\u90e8\u91cd\u5b9a\u5411\u5230\u4e00\u4e2a\u521a\u521b\u5efa\u7684\u4e34\u65f6\u76ee\u5f55&#xff0c;\u907f\u514d\u6d4b\u8bd5\u8bfb\u53d6\u6216\u6c61\u67d3\u5f00\u53d1\u8005\u672c\u673a\u7684\u771f\u5b9e\u914d\u7f6e&#xff08;\u4f8b\u5982 ~\/.pi\u3001~\/.gitconfig\u3001\u5168\u5c40 npm \u7f13\u5b58&#xff09;&#xff1b;\u7528 env -i \u4e22\u5f03\u5f53\u524d shell \u7684\u6240\u6709\u73af\u5883\u53d8\u91cf&#xff08;\u5305\u62ec\u4efb\u4f55\u5df2\u7ecf\u8bbe\u7f6e\u7684 ANTHROPIC_API_KEY\u3001OPENAI_API_KEY \u7b49&#xff09;&#xff0c;\u53ea\u4fdd\u7559\u811a\u672c\u663e\u5f0f\u5217\u51fa\u7684\u767d\u540d\u5355\u3002\u8fd9\u6837\u4e00\u6765&#xff0c;\u5373\u4f7f\u5f00\u53d1\u8005\u672c\u673a\u914d\u7f6e\u4e86\u771f\u5b9e\u5bc6\u94a5&#xff0c;test.sh \u8dd1\u8d77\u6765\u7684\u8fdb\u7a0b\u91cc\u4e5f\u770b\u4e0d\u5230\u8fd9\u4e9b\u5bc6\u94a5&#xff0c;describe.skipIf \u81ea\u7136\u4f1a\u8df3\u8fc7\u6240\u6709 e2e \u6d4b\u8bd5\u3002\u811a\u672c\u7ed3\u675f\u65f6\u7528 trap cleanup EXIT \u6e05\u7406\u4e34\u65f6\u76ee\u5f55&#xff0c;\u5e76\u4e14\u505a\u4e86\u5f52\u5c5e\u6821\u9a8c&#xff08;\u68c0\u67e5 .pi-test-owned \u6807\u8bb0\u6587\u4ef6&#xff09;\u540e\u624d\u5141\u8bb8 rm -rf&#xff0c;\u907f\u514d\u8bef\u5220\u975e\u9884\u671f\u8def\u5f84\u3002<\/p>\n<p>npm test \u672c\u8eab\u5728\u6839 package.json \u4e2d\u5b9a\u4e49\u4e3a&#xff1a;<\/p>\n<p>&#034;test&#034;: &#034;npm run test:scripts &amp;&amp; npm run test &#8211;workspaces &#8211;if-present&#034;<\/p>\n<p>\u5373\u5148\u8dd1 scripts\/*.test.mjs&#xff08;\u7528 node &#8211;test&#xff09;&#xff0c;\u518d\u5bf9\u6bcf\u4e2a workspace \u6267\u884c\u5404\u81ea\u7684 test \u811a\u672c&#xff08;\u5b58\u5728\u624d\u8dd1&#xff09;\u3002\u5404\u5305\u7684 test \u811a\u672c\u5e76\u4e0d\u7edf\u4e00&#xff1a;<\/p>\n<ul>\n<li>packages\/ai\u3001packages\/agent\u3001packages\/coding-agent&#xff1a;&#034;test&#034;: &#034;vitest &#8211;run&#034;<\/li>\n<li>packages\/tui&#xff1a;&#034;test&#034;: &#034;node &#8211;test &#8211;test-reporter&#061;dot &#8211;test-reporter-destination&#061;stdout test\/*.test.ts&#034;&#xff08;\u4e0d\u7528 vitest&#xff0c;\u76f4\u63a5\u7528 Node \u5185\u5efa\u7684 node:test&#xff09;<\/li>\n<li>packages\/evals&#xff1a;&#034;test&#034;: &#034;vitest run &#8211;config vitest.test.config.ts&#034;&#xff08;\u6ce8\u610f\u8fd9\u662f evals \u5305\u81ea\u8eab\u57fa\u7840\u8bbe\u65bd\u7684\u5355\u5143\u6d4b\u8bd5&#xff0c;\u4e0d\u662f\u8fd0\u884c eval \u4efb\u52a1&#xff09;<\/li>\n<\/ul>\n<h4>\u8dd1\u5355\u4e2a\u6d4b\u8bd5\u6587\u4ef6<\/h4>\n<p>AGENTS.md \u7ed9\u51fa\u7684\u51c6\u786e\u547d\u4ee4&#xff08;\u6309\u5305\u7c7b\u578b\u533a\u5206&#xff09;&#xff1a;<\/p>\n<p>\u5bf9\u4f7f\u7528 vitest \u7684\u5305&#xff08;\u4f8b\u5982 packages\/coding-agent\u3001packages\/ai\u3001packages\/agent&#xff09;&#xff0c;\u4ece\u5305\u6839\u76ee\u5f55\u6267\u884c&#xff1a;<\/p>\n<p>node &#034;$(git rev-parse &#8211;show-toplevel)\/node_modules\/vitest\/dist\/cli.js&#034; &#8211;run test\/specific.test.ts<\/p>\n<p>\u4e4b\u6240\u4ee5\u4e0d\u76f4\u63a5\u5199 npx vitest &#8211;run test\/specific.test.ts&#xff0c;\u662f\u4e3a\u4e86\u660e\u786e\u6307\u5411\u4ed3\u5e93\u6839 node_modules \u91cc\u7684 vitest \u53ef\u6267\u884c\u6587\u4ef6&#xff08;monorepo \u573a\u666f\u4e0b npx \u6709\u65f6\u4f1a\u89e3\u6790\u5230\u9519\u8bef\u7684\u7248\u672c\u6216\u63d0\u793a\u4ea4\u4e92\u5f0f\u5b89\u88c5&#xff09;\u3002<\/p>\n<p>\u5bf9 packages\/tui&#xff08;\u7528 node:test&#xff0c;\u4e0d\u662f vitest&#xff09;&#xff0c;\u4ece packages\/tui \u76ee\u5f55\u6267\u884c&#xff1a;<\/p>\n<p>node &#8211;test test\/specific.test.ts<\/p>\n<p>\u4e24\u8005\u547d\u4ee4\u5f62\u6001\u5b8c\u5168\u4e0d\u540c&#xff0c;\u6df7\u7528\u4f1a\u76f4\u63a5\u62a5\u9519\u2014\u2014\u8fd9\u4e5f\u662f\u4e3a\u4ec0\u4e48\u8fd9\u6761\u89c4\u5219\u5728 AGENTS.md \u91cc\u88ab\u5355\u72ec\u5217\u51fa\u6765\u3002<\/p>\n<h3>\u4e09\u3001Faux Provider&#xff1a;\u4e0d\u6d88\u8017\u771f\u5b9e\u914d\u989d\u7684\u5047\u6a21\u578b<\/h3>\n<p>packages\/coding-agent\/test\/suite\/ \u662f\u4ed3\u5e93\u91cc&#034;\u65b0\u4e00\u4ee3&#034;\u7684 Agent \u6d4b\u8bd5\u76ee\u5f55&#xff0c;test\/suite\/README.md \u660e\u786e\u5199\u4e86\u89c4\u5219&#xff1a;<\/p>\n<p>Use &#096;test\/suite\/&#096; for the new harness-based test suite around &#096;AgentSession&#096; and &#096;AgentSessionRuntime&#096;.<\/p>\n<p>Rules:<br \/>\n&#8211; Use &#096;test\/suite\/harness.ts&#096;<br \/>\n&#8211; Use the faux provider from &#096;packages\/ai\/src\/providers\/faux.ts&#096;<br \/>\n&#8211; Do not use real provider APIs, real API keys, network calls, or paid tokens<br \/>\n&#8211; Keep these tests CI-safe and deterministic<br \/>\n&#8211; Do not use or extend the legacy &#096;test\/test-harness.ts&#096; path unless a missing capability forces it<\/p>\n<p>\u6700\u540e\u4e00\u6761\u662f\u540e\u6765\u8865\u7684&#xff1a;\u4ed3\u5e93\u91cc\u8fd8\u7559\u7740\u4e00\u6761\u66f4\u8001\u7684\u6d4b\u8bd5\u811a\u624b\u67b6\u8def\u5f84 test\/test-harness.ts&#xff0c;\u660e\u786e\u8981\u6c42\u65b0\u6d4b\u8bd5\u4e0d\u8981\u518d\u7528\u5b83\u3001\u4e5f\u4e0d\u8981\u7ee7\u7eed\u6269\u5c55\u5b83&#xff0c;\u9664\u975e test\/suite\/harness.ts \u786e\u5b9e\u7f3a\u4e86\u67d0\u4e2a\u80fd\u529b\u2014\u2014\u8fd9\u662f\u4e00\u6761\u5178\u578b\u7684&#034;\u53ea\u7559\u9000\u8def\u3001\u4e0d\u9f13\u52b1\u4f7f\u7528&#034;\u5f0f\u8fc1\u79fb\u63d0\u793a&#xff0c;\u8bf4\u660e test\/suite\/ \u8fd9\u5957\u57fa\u4e8e faux provider \u7684\u811a\u624b\u67b6\u662f\u5f53\u524d\u552f\u4e00\u88ab\u5b98\u65b9\u63a8\u8350\u7684\u5199\u6cd5\u3002<\/p>\n<p>\u4e5f\u5c31\u662f\u8bf4&#xff0c;\u4efb\u4f55\u8981\u6d4b\u8bd5 AgentSession&#xff08;\u5bf9\u8bdd\u751f\u547d\u5468\u671f\u3001\u5de5\u5177\u8c03\u7528\u3001\u538b\u7f29\u3001\u6269\u5c55\u7b49&#xff09;\u884c\u4e3a\u7684\u65b0\u6d4b\u8bd5&#xff0c;\u4e00\u5f8b\u4e0d\u5141\u8bb8\u63a5\u89e6\u771f\u5b9e\u7684\u6a21\u578b API&#xff0c;\u800c\u8981\u7528 faux provider \u6a21\u62df\u4e00\u4e2a&#034;\u542c\u8bdd\u7684\u5047\u6a21\u578b&#034;\u3002<\/p>\n<h4>faux provider \u7684\u6838\u5fc3\u601d\u8def<\/h4>\n<p>packages\/ai\/src\/providers\/faux.ts&#xff08;708 \u884c&#xff09;\u5b9e\u73b0\u4e86\u4e00\u4e2a\u5b8c\u6574\u7684\u3001\u9075\u5faa pi \u5185\u90e8 provider \u63a5\u53e3\u7684\u5047 provider\u3002\u5b83\u4e0d\u4f1a\u771f\u7684\u53d1\u7f51\u7edc\u8bf7\u6c42&#xff0c;\u800c\u662f\u4ece\u4e00\u4e2a\u9884\u5148\u8bbe\u7f6e\u597d\u7684&#034;\u54cd\u5e94\u811a\u672c&#034;\u961f\u5217\u91cc\u6309\u987a\u5e8f\u53d6\u51fa\u7ed3\u679c\u8fd4\u56de\u7ed9\u8c03\u7528\u65b9&#xff0c;\u5e76\u4e14\u5b8c\u6574\u6a21\u62df\u4e86\u6d41\u5f0f\u589e\u91cf&#xff08;text_start\/text_delta\/text_end \u7b49\u4e8b\u4ef6&#xff09;\u3001\u601d\u8003\u5185\u5bb9&#xff08;thinking&#xff09;\u3001\u5de5\u5177\u8c03\u7528\u3001usage \u4f30\u7b97\u3001\u751a\u81f3 deferred&#xff08;\u5f02\u6b65\u8f6e\u8be2&#xff09;\u548c abort&#xff08;\u4e2d\u65ad&#xff09;\u7b49\u771f\u5b9e provider \u624d\u6709\u7684\u590d\u6742\u884c\u4e3a\u3002<\/p>\n<p>\u51e0\u4e2a\u5173\u952e\u7684\u6784\u5efa\u5757&#xff1a;<\/p>\n<p>export function fauxToolCall(name: string, arguments_: ToolCall[&#034;arguments&#034;], options: { id?: string } &#061; {}): ToolCall {<br \/>\n    return { type: &#034;toolCall&#034;, id: options.id ?? randomId(&#034;tool&#034;), name, arguments: arguments_ };<br \/>\n}<\/p>\n<p>export function fauxAssistantMessage(<br \/>\n    content: string | FauxContentBlock | FauxContentBlock[],<br \/>\n    options: { stopReason?: AssistantMessage[&#034;stopReason&#034;]; &#8230; } &#061; {},<br \/>\n): AssistantMessage { &#8230; }<\/p>\n<p>export type FauxResponseFactory &#061; (<br \/>\n    context: Context,<br \/>\n    options: SimpleStreamOptions | undefined,<br \/>\n    state: FauxProviderState,<br \/>\n    model: Model&lt;string&gt;,<br \/>\n) &#061;&gt; AssistantMessage | Promise&lt;AssistantMessage&gt;;<\/p>\n<p>export type FauxResponseStep &#061; AssistantMessage | FauxResponseFactory;<\/p>\n<p>fauxAssistantMessage &#043; fauxToolCall \u7ec4\u5408\u8d77\u6765&#xff0c;\u5c31\u80fd\u50cf\u7f16\u6392\u5267\u672c\u4e00\u6837&#xff0c;\u58f0\u660e&#034;\u6a21\u578b\u7b2c\u4e00\u8f6e\u8981\u8c03\u7528\u54ea\u4e2a\u5de5\u5177\u3001\u7b2c\u4e8c\u8f6e\u8bf4\u4ec0\u4e48\u8bdd&#034;\u3002\u54cd\u5e94\u4e5f\u652f\u6301\u4f20\u5165\u4e00\u4e2a\u51fd\u6570&#xff08;FauxResponseFactory&#xff09;&#xff0c;\u6839\u636e\u5f53\u524d\u4e0a\u4e0b\u6587\u52a8\u6001\u751f\u6210\u56de\u590d&#xff0c;\u7528\u4e8e\u6d4b\u8bd5\u9700\u8981&#034;\u770b\u5230\u7528\u6237\u8bf4\u4e86\u4ec0\u4e48\u518d\u51b3\u5b9a\u600e\u4e48\u56de&#034;\u7684\u573a\u666f\u3002\u6d41\u5f0f\u56de\u590d\u662f\u9010 token \u6a21\u62df\u51fa\u6765\u7684&#xff0c;\u771f\u5b9e\u8fd8\u539f\u4e86\u6253\u5b57\u673a\u5f0f\u7684\u589e\u91cf\u63a8\u9001&#xff08;streamWithDeltas \u5185\u90e8\u6309 splitStringByTokenSize \u628a\u6587\u672c\u5207\u6210\u82e5\u5e72&#034;\u5047 token&#034;&#xff0c;\u9010\u5757 push \u5230\u4e8b\u4ef6\u6d41\u91cc&#xff09;&#xff0c;\u8fd9\u8ba9\u4f9d\u8d56\u6d41\u5f0f\u4e8b\u4ef6\u7684 UI\/\u65e5\u5fd7\u903b\u8f91\u4e5f\u80fd\u88ab\u8986\u76d6\u5230&#xff0c;\u800c\u4e0d\u53ea\u662f\u6d4b\u8bd5&#034;\u6700\u7ec8\u7ed3\u679c\u5bf9\u4e0d\u5bf9&#034;\u3002<\/p>\n<h4>test\/suite\/harness.ts&#xff1a;\u628a faux provider \u63a5\u5230\u771f\u5b9e\u7684 AgentSession \u4e0a<\/h4>\n<p>harness.ts \u91cc\u7684 createHarness() \u505a\u7684\u4e8b\u60c5&#xff0c;\u662f\u642d\u4e00\u4e2a&#034;\u4e94\u810f\u4ff1\u5168\u4f46\u5b8c\u5168\u5185\u5b58\u5316&#034;\u7684\u6d4b\u8bd5\u73af\u5883&#xff1a;\u6ce8\u518c faux provider\u3001\u4f2a\u9020\u4e00\u4e2a provider \u7684 API Key&#xff08;&#034;faux-key&#034;&#xff09;\u3001\u7528\u5185\u5b58\u7248\u7684 SessionManager\/SettingsManager\/AuthStorage&#xff0c;\u6700\u540e\u5b9e\u4f8b\u5316\u4e00\u4e2a\u771f\u5b9e\u7684 AgentSession&#xff1a;<\/p>\n<p>export async function createHarness(options: HarnessOptions &#061; {}): Promise&lt;Harness&gt; {<br \/>\n    const tempDir &#061; createTempDir();<br \/>\n    const fauxProvider: FauxProviderRegistration &#061; registerFauxProvider({ models: options.models });<br \/>\n    fauxProvider.setResponses([]);<br \/>\n    const model &#061; fauxProvider.getModel();<br \/>\n    const sessionManager &#061; SessionManager.inMemory();<br \/>\n    const settingsManager &#061; SettingsManager.inMemory(options.settings);<br \/>\n    const authStorage &#061; AuthStorage.inMemory();<br \/>\n    if (withConfiguredAuth) {<br \/>\n        await authStorage.modify(model.provider, async () &#061;&gt; ({ type: &#034;api_key&#034;, key: &#034;faux-key&#034; }));<br \/>\n    }<br \/>\n    const agent &#061; new Agent({<br \/>\n        getApiKey: () &#061;&gt; (withConfiguredAuth ? &#034;faux-key&#034; : undefined),<br \/>\n        streamFn: streamSimple,<br \/>\n        initialState: { model, systemPrompt: options.systemPrompt ?? &#034;You are a test assistant.&#034;, tools: [] },<br \/>\n        &#8230;<br \/>\n    });<br \/>\n    const session &#061; new AgentSession({ agent, sessionManager, settingsManager, cwd: tempDir, &#8230; });<br \/>\n    return {<br \/>\n        session, sessionManager, settingsManager, authStorage,<br \/>\n        faux: fauxProvider, setResponses: fauxProvider.setResponses, events, eventsOfType, tempDir,<br \/>\n        cleanup() {<br \/>\n            session.dispose();<br \/>\n            fauxProvider.unregister();<br \/>\n            if (existsSync(tempDir)) rmSync(tempDir, { recursive: true });<br \/>\n        },<br \/>\n    };<br \/>\n}<\/p>\n<p>\u6d4b\u8bd5\u6587\u4ef6\u62ff\u5230 Harness \u4e4b\u540e&#xff0c;\u5178\u578b\u7528\u6cd5\u662f&#xff1a;\u5148\u7528 harness.setResponses([&#8230;]) \u7f16\u6392\u597d&#034;\u6a21\u578b\u63a5\u4e0b\u6765\u8981\u8bf4\u4ec0\u4e48\/\u8c03\u7528\u54ea\u4e2a\u5de5\u5177&#034;&#xff0c;\u518d\u8c03\u7528 harness.session.prompt(&#8230;) \u89e6\u53d1\u771f\u5b9e\u7684 Agent \u4e3b\u5faa\u73af&#xff0c;\u6700\u540e\u7528 harness.events&#xff08;\u8ba2\u9605 AgentSession \u629b\u51fa\u7684\u4e8b\u4ef6&#xff09;\u6216 getAssistantTexts(harness)\/getUserTexts(harness) \u4e4b\u7c7b\u7684\u8f85\u52a9\u51fd\u6570\u65ad\u8a00\u7ed3\u679c\u3002packages\/coding-agent\/test\/suite\/regressions\/2023-queued-slash-command-followup.test.ts \u662f\u4e00\u4e2a\u5f88\u5178\u578b\u7684\u4f8b\u5b50&#xff1a;<\/p>\n<p>harness.setResponses([<br \/>\n    fauxAssistantMessage(fauxToolCall(&#034;wait&#034;, {}), { stopReason: &#034;toolUse&#034; }),<br \/>\n    fauxAssistantMessage(&#034;first turn complete&#034;),<br \/>\n    fauxAssistantMessage(&#034;queued follow-up handled by model&#034;),<br \/>\n]);<\/p>\n<p>const promptPromise &#061; harness.session.prompt(&#034;start&#034;);<br \/>\nawait sawToolStart;<br \/>\nextensionApi?.sendUserMessage(&#034;\/testcmd queued&#034;, { deliverAs: &#034;followUp&#034; });<br \/>\nreleaseToolExecution?.();<br \/>\nawait promptPromise;<\/p>\n<p>expect(commandRuns).toEqual([]);<br \/>\nexpect(getAssistantTexts(harness)).toContain(&#034;queued follow-up handled by model&#034;);<\/p>\n<p>\u8fd9\u4e2a\u6d4b\u8bd5\u5b8c\u5168\u6ca1\u6709\u8054\u7f51&#xff0c;\u4e5f\u6ca1\u6709\u7528\u5230\u4efb\u4f55\u771f\u5b9e\u5bc6\u94a5&#xff0c;\u5374\u5b8c\u6574\u8dd1\u901a\u4e86&#034;\u7528\u6237\u8f93\u5165 \u2192 \u6a21\u578b\u51b3\u5b9a\u8c03\u7528\u5de5\u5177 \u2192 \u5de5\u5177\u6267\u884c\u4e2d\u6392\u961f\u4e00\u6761 slash \u547d\u4ee4 \u2192 \u5de5\u5177\u6267\u884c\u5b8c\u6bd5 \u2192 \u6a21\u578b\u7ee7\u7eed\u56de\u590d&#034;\u8fd9\u6837\u4e00\u6761\u771f\u5b9e\u7684\u3001\u6709\u65f6\u5e8f\u7ade\u4e89\u7684\u4e1a\u52a1\u94fe\u8def\u3002\u8fd9\u6b63\u662f faux provider \u6a21\u5f0f\u7684\u4ef7\u503c\u6240\u5728&#xff1a;\u628a&#034;\u6a21\u578b\u4f1a\u600e\u4e48\u56de\u590d&#034;\u53d8\u6210\u4e00\u4e2a\u53ef\u4ee5\u7531\u6d4b\u8bd5\u4ee3\u7801\u5b8c\u5168\u638c\u63a7\u7684\u786e\u5b9a\u6027\u8f93\u5165&#xff0c;\u4ece\u800c\u8ba9\u539f\u672c\u9ad8\u5ea6\u4f9d\u8d56\u5916\u90e8\u4e0d\u786e\u5b9a\u6027&#xff08;\u771f\u5b9e\u6a21\u578b\u7684\u8f93\u51fa&#xff09;\u7684 Agent \u903b\u8f91&#xff0c;\u53d8\u6210\u53ef\u4ee5\u7528\u4f20\u7edf\u5355\u5143\u6d4b\u8bd5\u624b\u6cd5\u8986\u76d6\u7684\u786e\u5b9a\u6027\u4ee3\u7801\u3002<\/p>\n<h3>\u56db\u3001Evals&#xff1a;\u8bc4\u6d4b\u884c\u4e3a\u8d28\u91cf&#xff0c;\u800c\u4e0d\u662f\u65ad\u8a00\u5bf9\u9519<\/h3>\n<p>packages\/evals\/ \u662f\u4e00\u4e2a\u72ec\u7acb\u7684\u5305&#xff0c;packages\/evals\/README.md \u5f00\u7bc7\u5c31\u628a\u5b83\u548c\u666e\u901a\u6d4b\u8bd5\u533a\u5206\u5f00&#xff1a;<\/p>\n<p>Pi evals are behavioral, model-backed checks for Pi workflows. They adapt a real AgentSession to vitest-evals, run it in isolated temporary project and agent directories, and attach native Pi session artifacts. Use them to measure end-to-end behavior and compare prompts, tools, skills, models, or other harness configurations.<\/p>\n<p>\u5173\u952e\u533a\u522b\u5728\u4e8e&#xff1a;faux provider \u6d4b\u8bd5\u7528\u5047\u6a21\u578b\u9a8c\u8bc1&#034;\u4ee3\u7801\u903b\u8f91\u5bf9\u4e0d\u5bf9&#034;&#xff0c;\u800c evals \u7528\u771f\u5b9e\u6a21\u578b\u9a8c\u8bc1&#034;\u7ed9\u5b9a\u8fd9\u5957\u63d0\u793a\u8bcd\u3001\u5de5\u5177\u3001\u6a21\u578b\u7ec4\u5408&#xff0c;Agent \u5b8c\u6210\u771f\u5b9e\u4efb\u52a1\u7684\u6548\u679c\u597d\u4e0d\u597d&#034;\u3002\u8fd9\u662f\u4e24\u4e2a\u5b8c\u5168\u4e0d\u540c\u7ef4\u5ea6\u7684\u95ee\u9898\u2014\u2014\u4ee3\u7801\u903b\u8f91\u6b63\u786e\u4e0d\u4ee3\u8868\u63d0\u793a\u8bcd\u5199\u5f97\u597d&#xff0c;\u53cd\u4e4b\u4ea6\u7136\u3002<\/p>\n<h4>pi-harness.ts&#xff1a;\u628a\u771f\u5b9e AgentSession \u63a5\u5165 vitest-evals<\/h4>\n<p>packages\/evals\/src\/pi-harness.ts \u63d0\u4f9b\u7684 createPiCodingAgentHarness(&#8230;) \u662f evals \u7684\u6838\u5fc3\u811a\u624b\u67b6\u3002\u5b83\u5728\u4e34\u65f6\u76ee\u5f55\u91cc\u521b\u5efa\u4e00\u4e2a\u771f\u5b9e\u7684\u5de5\u4f5c\u533a\u548c agent \u76ee\u5f55&#xff0c;\u7528\u771f\u5b9e\u7684 ModelRuntime \u89e3\u6790\u51fa\u771f\u5b9e\u7684\u6a21\u578b&#xff08;provider &#043; model id \u6765\u81ea CLI \u53c2\u6570\u6216\u73af\u5883\u53d8\u91cf PI_PROVIDER\/PI_MODEL&#xff09;&#xff0c;\u5b9e\u4f8b\u5316\u4e00\u4e2a\u771f\u5b9e\u7684 AgentSession \u5e76\u5bf9\u5176\u4e0b\u8fbe prompt&#xff1a;<\/p>\n<p>export function resolveModelSelection(<br \/>\n    explicitModel: PiCodingAgentModelSelection | undefined,<br \/>\n    environment: { PI_PROVIDER?: string; PI_MODEL?: string } &#061; process.env,<br \/>\n): PiCodingAgentModelSelection {<br \/>\n    const provider &#061; (explicitModel?.provider ?? environment.PI_PROVIDER)?.trim();<br \/>\n    const id &#061; (explicitModel?.id ?? environment.PI_MODEL)?.trim();<br \/>\n    if (!provider || !id) {<br \/>\n        throw new Error(&#034;Select a harness model explicitly or set both PI_PROVIDER and PI_MODEL as defaults.&#034;);<br \/>\n    }<br \/>\n    return { provider, id };<br \/>\n}<\/p>\n<p>\u8fd0\u884c\u65f6\u901a\u8fc7&#xff1a;<\/p>\n<p>npm run eval &#8212; &#8211;provider openai &#8211;model gpt-5.6-sol<br \/>\n# \u7b49\u4ef7\u4e8e<br \/>\nPI_PROVIDER&#061;openai PI_MODEL&#061;gpt-5.6-sol npm run eval<\/p>\n<p>\u4e5f\u5c31\u662f\u8bf4&#xff0c;\u8fd0\u884c evals \u5fc5\u987b\u63d0\u4f9b\u4e00\u4e2a\u771f\u5b9e\u53ef\u7528\u7684 provider \u548c\u6a21\u578b&#xff08;\u4ee5\u53ca\u5bf9\u5e94\u7684\u8ba4\u8bc1\u4fe1\u606f&#xff0c;\u8d70 pi \u6b63\u5e38\u7684 ModelRuntime \u903b\u8f91&#xff0c;\u53ef\u4ee5\u662f\u8ba2\u9605\u51ed\u8bc1\u4e5f\u53ef\u4ee5\u662f API Key \u73af\u5883\u53d8\u91cf&#xff09;\u3002\u8fd9\u4e0e\u524d\u9762\u5355\u5143\u6d4b\u8bd5&#034;\u7edd\u4e0d\u4f7f\u7528\u771f\u5b9e\u5bc6\u94a5&#034;\u7684\u539f\u5219\u5f62\u6210\u4e86\u9c9c\u660e\u5bf9\u6bd4\u2014\u2014evals \u5b58\u5728\u7684\u610f\u4e49\u5c31\u662f\u89c2\u5bdf\u771f\u5b9e\u6a21\u578b\u7684\u771f\u5b9e\u884c\u4e3a\u3002<\/p>\n<p>\u6bcf\u6b21\u8fd0\u884c\u4f1a\u5728 packages\/evals\/.eval\/ \u4e0b\u751f\u6210\u4e00\u4e2a\u5e26\u65f6\u95f4\u6233\u7684 artifact \u76ee\u5f55&#xff0c;runs.jsonl \u8bb0\u5f55\u6bcf\u6b21 harness \u8fd0\u884c&#xff0c;\u5e76\u628a\u539f\u751f\u7684 pi \u4f1a\u8bdd JSONL \u9644\u52a0\u5728 sessions\/ \u4e0b\u2014\u2014\u8fd9\u610f\u5473\u7740 eval \u4ea7\u7269\u91cc\u53ef\u80fd\u5305\u542b\u771f\u5b9e\u7684 prompt\u3001\u6a21\u578b\u8f93\u51fa\u3001\u5de5\u5177\u8c03\u7528\u7ec6\u8282&#xff0c;\u9700\u8981\u6309\u654f\u611f\u6570\u636e\u5bf9\u5f85\u3002<\/p>\n<h4>smoke.eval.ts&#xff1a;\u6700\u57fa\u7840\u7684\u7aef\u5230\u7aef\u53ef\u7528\u6027\u68c0\u67e5<\/h4>\n<p>packages\/evals\/src\/smoke.eval.ts \u662f\u6700\u7b80\u5355\u7684\u4e00\u4e2a eval&#xff0c;\u53ea\u9a8c\u8bc1&#034;Agent \u80fd\u4e0d\u80fd\u6b63\u5e38\u8dd1\u5b8c\u4e00\u8f6e\u771f\u5b9e\u5bf9\u8bdd\u5e76\u7ed9\u51fa\u6b63\u786e\u7b54\u6848&#034;&#xff1a;<\/p>\n<p>const piCodingAgentHarness &#061; createPiCodingAgentHarness({ noTools: &#034;all&#034; });<\/p>\n<p>describeEval(&#034;Pi Coding Agent smoke&#034;, { harness: piCodingAgentHarness }, (it) &#061;&gt; {<br \/>\n    it(&#034;runs a basic prompt end to end&#034;, async ({ run }) &#061;&gt; {<br \/>\n        const result &#061; await run(&#034;What&#039;s the capital of France? Respond with only the city name.&#034;);<\/p>\n<p>        expect(result.output.trim()).toBe(&#034;Paris&#034;);<br \/>\n        expect(result.errors).toEqual([]);<br \/>\n        expect(result.usage.provider).toBe(process.env.PI_PROVIDER);<br \/>\n        expect(result.usage.model).toBe(process.env.PI_MODEL);<br \/>\n        expect(result.usage.totalTokens).toBeGreaterThan(0);<br \/>\n    });<br \/>\n});<\/p>\n<p>\u5b83\u7528 noTools: &#034;all&#034; \u5173\u95ed\u4e86\u5168\u90e8\u5de5\u5177&#xff0c;\u53ea\u6d4b\u6700\u57fa\u7840\u7684&#034;\u53d1\u6d88\u606f\u3001\u6536\u56de\u7b54&#034;\u94fe\u8def&#xff0c;\u672c\u8d28\u4e0a\u662f\u7ed9\u6574\u6761\u771f\u5b9e\u8c03\u7528\u94fe&#xff08;\u6a21\u578b\u89e3\u6790 \u2192 \u8ba4\u8bc1 \u2192 \u8bf7\u6c42 \u2192 \u89e3\u6790\u54cd\u5e94 \u2192 session \u8bb0\u8d26&#xff09;\u505a\u4e00\u6b21\u5192\u70df\u6d4b\u8bd5&#xff08;smoke test&#xff09;\u3002<\/p>\n<h4>extensions.eval.ts&#xff1a;\u8bc4\u6d4b\u66f4\u590d\u6742\u7684\u3001\u5e26\u5de5\u5177\u8c03\u7528\u7684\u5b8c\u6574\u5de5\u4f5c\u6d41<\/h4>\n<p>packages\/evals\/src\/extensions.eval.ts \u590d\u6742\u5f97\u591a&#xff0c;\u5b83\u9a8c\u8bc1\u7684\u662f&#034;Agent \u80fd\u5426\u6839\u636e\u7cfb\u7edf\u63d0\u793a\u8bcd\u7684\u6307\u5f15&#xff0c;\u6b63\u786e\u5730\u521b\u5efa\u4e00\u4e2a pi \u6269\u5c55\u3001reload \u52a0\u8f7d\u5b83\u3001\u518d\u8c03\u7528\u6269\u5c55\u6ce8\u518c\u7684\u5de5\u5177\u5b8c\u6210\u4efb\u52a1&#034;\u3002\u5b83\u7528 createJudge&lt;&#8230;&gt;(&#8230;) \u5b9a\u4e49\u4e86\u4e00\u4e2a\u57fa\u4e8e\u89c4\u5219\u7684\u8bc4\u59d4\u51fd\u6570&#xff0c;\u68c0\u67e5\u751f\u6210\u7684\u6269\u5c55\u6e90\u7801\u662f\u5426 import \u4e86\u6b63\u786e\u7684\u5305\u3001\u6269\u5c55\u662f\u5426\u6210\u529f\u52a0\u8f7d\u3001\u5de5\u5177\u8c03\u7528\u53c2\u6570\u548c\u8fd4\u56de\u503c\u662f\u5426\u7b26\u5408\u9884\u671f&#xff1a;<\/p>\n<p>const ExtensionAuthoringJudge &#061; createJudge&lt;PiCodingAgentInput, ExtensionAuthoringOutput&gt;(<br \/>\n    &#034;ExtensionAuthoringJudge&#034;,<br \/>\n    ({ output, toolCalls }) &#061;&gt; {<br \/>\n        const failures: string[] &#061; [];<br \/>\n        if (output.extensionSource &#061;&#061;&#061; null) {<br \/>\n            failures.push(&#034;generated extension source is unavailable&#034;);<br \/>\n        } else if (!imports.includes(&#034;&#064;earendil-works\/pi-coding-agent&#034;)) {<br \/>\n            failures.push(&#034;extension does not import the canonical &#064;earendil-works\/pi-coding-agent package&#034;);<br \/>\n        }<br \/>\n        return {<br \/>\n            score: failures.length &#061;&#061;&#061; 0 ? 1 : 0,<br \/>\n            metadata: { rationale: failures.length &#061;&#061;&#061; 0 ? &#034;Extension authoring workflow completed.&#034; : failures.join(&#034;; &#034;) },<br \/>\n        };<br \/>\n    },<br \/>\n);<\/p>\n<p>\u66f4\u503c\u5f97\u6ce8\u610f\u7684\u662f\u5b83\u7528 evalHarnessTable(&#8230;) \u505a\u4e86\u4e00\u6b21\u5bf9\u7167\u5b9e\u9a8c&#xff1a;\u628a&#034;\u7cfb\u7edf\u63d0\u793a\u8bcd\u91cc\u5305\u542b\u6269\u5c55\u5f00\u53d1\u6307\u5357\u548c pi \u6587\u6863&#034; vs &#034;\u4e0d\u5305\u542b&#034;\u8fd9\u4e24\u79cd\u60c5\u51b5\u5404\u8dd1\u4e00\u904d\u76f8\u540c\u7684\u4efb\u52a1&#xff0c;\u6bd4\u8f83\u4e24\u7ec4\u7684\u901a\u8fc7\u7387\u5dee\u5f02&#xff1a;<\/p>\n<p>const extensionHarnessTable &#061; evalHarnessTable(&#034;Pi extension authoring system prompt&#034;, {<br \/>\n    baseline: createExtensionAuthoringHarness(&#034;system-prompt-without-docs&#034;, excludeGuidelinesAndDocumentation),<br \/>\n    candidate: createExtensionAuthoringHarness(&#034;default-system-prompt&#034;, prepareDefaultPromptOverride),<br \/>\n});<\/p>\n<p>\u8fd9\u6b63\u662f&#034;\u8bc4\u6d4b Agent \u884c\u4e3a\u8d28\u91cf&#034;\u548c&#034;\u4f20\u7edf\u65ad\u8a00\u5f0f\u5355\u5143\u6d4b\u8bd5&#034;\u7684\u672c\u8d28\u533a\u522b&#xff1a;\u5355\u5143\u6d4b\u8bd5\u95ee\u7684\u662f&#034;\u8fd9\u6bb5\u4ee3\u7801\u662f\u5426\u7b26\u5408\u89c4\u683c&#034;&#xff0c;\u662f\u975e\u9ed1\u5373\u767d\u7684&#xff1b;evals \u95ee\u7684\u662f&#034;\u8fd9\u5957\u63d0\u793a\u8bcd\/\u5de5\u5177\/\u6a21\u578b\u7684\u7ec4\u5408&#xff0c;\u5728\u771f\u5b9e\u6a21\u578b\u7684\u4e0d\u786e\u5b9a\u6027\u4e0b&#xff0c;\u5b8c\u6210\u4efb\u52a1\u7684\u6210\u529f\u7387\u6709\u591a\u9ad8&#034;&#xff0c;\u662f\u6982\u7387\u6027\u7684\u3001\u9700\u8981\u7528\u5bf9\u7167\u7ec4\u548c\u8bc4\u5206\u673a\u5236\u6765\u8861\u91cf\u7684\u3002README.md \u91cc\u4e5f\u660e\u786e\u5efa\u8bae\u5bf9\u7167\u5b9e\u9a8c\u7c7b\u7684 eval \u628a judgeThreshold: null&#xff0c;\u8ba9\u4f4e\u5206\u53ea\u4f5c\u4e3a\u89c2\u5bdf\u8bb0\u5f55\u800c\u4e0d\u76f4\u63a5\u5224\u5931\u8d25\u2014\u2014\u56e0\u4e3a\u771f\u5b9e\u6a21\u578b\u8f93\u51fa\u672c\u8eab\u5c31\u6709\u6ce2\u52a8\u3002<\/p>\n<h4>docs.eval.ts&#xff1a;\u8ba9\u771f\u5b9e Agent \u81ea\u5df1\u5ba1\u8ba1\u6587\u6863\u662f\u5426\u4e0e\u5b9e\u73b0\u4e00\u81f4<\/h4>\n<p>packages\/evals\/src\/ \u540e\u6765\u65b0\u589e\u4e86\u4e00\u4e2a\u5f88\u6709\u610f\u601d\u7684 eval&#xff1a;docs.eval.ts\u3002\u5b83\u7528 globSync(&#034;**\/*.md&#034;, { cwd: docsRoot }) \u626b\u51fa packages\/coding-agent\/docs\/ \u4e0b\u7684\u6bcf\u4e00\u7bc7\u6587\u6863&#xff0c;\u5bf9\u6bcf\u4e00\u7bc7\u90fd\u8dd1\u4e00\u6b21\u771f\u5b9e\u7684 AgentSession&#xff0c;\u8ba9 Agent \u81ea\u5df1\u53bb\u8bfb\u6587\u6863\u5185\u5bb9\u3001\u518d\u7528 read\/grep\/find\/ls \u8fd9\u51e0\u4e2a\u53ea\u8bfb\u5de5\u5177\u53bb\u7ffb\u6e90\u7801&#xff0c;\u6700\u540e\u8c03\u7528\u4e00\u4e2a\u4e13\u95e8\u5b9a\u4e49\u7684 submit_documentation_audit \u5de5\u5177\u63d0\u4ea4\u7ed3\u6784\u5316\u7684\u5ba1\u8ba1\u7ed3\u8bba&#xff08;verdict: &#034;match&#034; | &#034;mismatch&#034;&#xff0c;\u9644\u5e26\u6587\u6863\u8bc1\u636e\u548c\u5b9e\u73b0\u8bc1\u636e&#xff09;&#xff1a;<\/p>\n<p>const submitDocumentationAuditTool &#061; defineTool({<br \/>\n    name: &#034;submit_documentation_audit&#034;,<br \/>\n    description: &#034;Submit the final verdict after completing the documentation investigation.&#034;,<br \/>\n    parameters: Type.Object({<br \/>\n        verdict: Type.Union([Type.Literal(&#034;match&#034;), Type.Literal(&#034;mismatch&#034;)]),<br \/>\n        explanation: Type.String({ minLength: 1, maxLength: 2000 }),<br \/>\n        documentationEvidence: Type.String({ minLength: 1, maxLength: 2000 }),<br \/>\n        implementationEvidence: Type.String({ minLength: 1, maxLength: 3000 }),<br \/>\n    }, { additionalProperties: false }),<br \/>\n    constrainedSampling: { type: &#034;json_schema&#034;, strict: &#034;prefer&#034; },<br \/>\n    \/\/ &#8230;<br \/>\n});<\/p>\n<p>\u8fd9\u662f\u4e00\u4e2a\u8df3\u51fa&#034;\u4eba\u5199\u65ad\u8a00\u3001\u4ee3\u7801\u8dd1\u65ad\u8a00&#034;\u4f20\u7edf\u601d\u8def\u7684\u7528\u6cd5&#xff1a;\u4e0e\u5176\u9760\u4eba\u5de5 review \u4fdd\u8bc1\u6587\u6863\u4e0d\u8fc7\u65f6,\u4e0d\u5982\u8ba9 Agent \u672c\u8eab&#xff08;\u65e2\u7136\u5b83\u5c31\u662f\u8981\u53bb\u8bfb\u8fd9\u4e9b\u6587\u6863\u6765\u7406\u89e3\u81ea\u5df1\u600e\u4e48\u7528&#xff09;\u5145\u5f53\u5ba1\u8ba1\u5458&#xff0c;\u7528\u5b83\u81ea\u5df1\u7684\u9605\u8bfb\u7406\u89e3\u80fd\u529b\u53bb\u6bd4\u5bf9&#034;\u6587\u6863\u8bf4\u7684&#034;\u548c&#034;\u4ee3\u7801\u5b9e\u9645\u505a\u7684&#034;\u662f\u5426\u4e00\u81f4&#xff0c;\u518d\u7528\u4e00\u4e2a constrainedSampling: { type: &#034;json_schema&#034; } \u7684\u81ea\u5b9a\u4e49\u5de5\u5177\u5f3a\u5236\u5b83\u8f93\u51fa\u7ed3\u6784\u5316\u3001\u53ef\u7f16\u7a0b\u6d88\u8d39\u7684\u7ed3\u8bba,\u800c\u4e0d\u662f\u4e00\u6bb5\u81ea\u7531\u6587\u672c\u3002\u8fd9\u4e5f\u89e3\u91ca\u4e86\u672c\u8bfe\u7a0b\u524d\u9762\u51e0\u7bc7\u4e3a\u4ec0\u4e48\u53cd\u590d\u5f3a\u8c03&#034;\u6587\u6863\u63cf\u8ff0\u5728\u5feb\u901f\u8fed\u4ee3\u7684\u4ed3\u5e93\u91cc\u5bb9\u6613\u548c\u5b9e\u73b0\u8131\u8282&#034;\u2014\u2014pi \u9879\u76ee\u81ea\u5df1\u4e5f\u5728\u7528 evals \u8fd9\u5957\u57fa\u7840\u8bbe\u65bd\u6765\u5bf9\u6297\u8fd9\u4e2a\u95ee\u9898\u3002<\/p>\n<p>packages\/evals\/vitest.config.ts \u548c packages\/evals\/vitest.test.config.ts \u662f\u4e24\u4efd\u4e0d\u540c\u914d\u7f6e&#xff1a;\u524d\u8005\u7528\u4e8e\u8dd1\u771f\u6b63\u7684 eval \u4efb\u52a1&#xff08;npm run eval&#xff09;&#xff0c;\u540e\u8005\u7528\u4e8e\u8dd1 evals \u8fd9\u4e2a\u5305\u81ea\u8eab\u57fa\u7840\u8bbe\u65bd\u4ee3\u7801\u7684\u5355\u5143\u6d4b\u8bd5&#xff08;npm run test&#xff0c;\u9a8c\u8bc1 harness-table.ts\u3001summary.ts\u3001artifacts.ts \u8fd9\u4e9b\u5de5\u5177\u51fd\u6570\u672c\u8eab\u6ca1\u5199\u9519&#xff09;\u2014\u2014\u8fd9\u4e24\u8005\u4e0d\u8981\u6df7\u6dc6&#xff1a;\u4e00\u4e2a\u662f&#034;\u7528 evals \u8bc4\u6d4b pi&#034;&#xff0c;\u4e00\u4e2a\u662f&#034;\u6d4b\u8bd5 evals \u5de5\u5177\u672c\u8eab&#034;\u3002<\/p>\n<h3>\u4e94\u3001\u56de\u5f52\u6d4b\u8bd5\u7684\u7ec4\u7ec7\u7ea6\u5b9a&#xff08;\u73b0\u5df2\u4ece\u6587\u6863\u89c4\u5219\u964d\u7ea7\u4e3a\u7ea6\u5b9a\u4fd7\u6210&#xff09;<\/h3>\n<p>\u9700\u8981\u66f4\u65b0\u4e00\u5904\u8ba4\u77e5&#xff1a;\u65e9\u671f packages\/coding-agent\/test\/suite\/README.md \u66fe\u7528\u4e00\u6bb5&#034;Organization&#034;\u660e\u786e\u5199\u51fa\u56de\u5f52\u6d4b\u8bd5\u7684\u7ec4\u7ec7\u89c4\u5219&#xff08;broad \u6d4b\u8bd5\u653e test\/suite\/ \u4e0b\u3001issue \u76f8\u5173\u7684\u56de\u5f52\u6d4b\u8bd5\u653e test\/suite\/regressions\/\u3001\u6309 &lt;issue-number&gt;-&lt;short-slug&gt;.test.ts \u547d\u540d&#xff09;&#xff0c;\u4f46\u8fd9\u6bb5\u89c4\u5219\u5728\u540e\u7eed\u4e00\u6b21\u6587\u6863\u6e05\u7406&#xff08;docs(coding-agent): remove issue-specific regression test placement rule&#xff09;\u4e2d\u88ab\u4ece README \u91cc\u6574\u6bb5\u5220\u9664\u4e86&#xff0c;\u73b0\u5728\u7684 README \u53ea\u4fdd\u7559\u4e86\u4e0a\u4e00\u8282\u5217\u51fa\u7684\u90a3\u51e0\u6761\u786c\u6027\u89c4\u5219&#xff0c;\u4e0d\u518d\u5bf9\u76ee\u5f55\u7ec4\u7ec7\u65b9\u5f0f\u505a\u6587\u6863\u5c42\u9762\u7684\u5f3a\u5236\u7ea6\u5b9a\u3002<\/p>\n<p>\u4e0d\u8fc7\u5b9e\u9645\u4ee3\u7801\u5e93\u91cc\u7684\u7ec4\u7ec7\u65b9\u5f0f\u5e76\u6ca1\u6709\u53d8&#xff1a;test\/suite\/regressions\/ \u76ee\u5f55\u4f9d\u7136\u5b58\u5728&#xff0c;\u5199\u4f5c\u672c\u6587\u65f6\u91cc\u9762\u4ecd\u6709 70 \u591a\u4e2a\u6d4b\u8bd5\u6587\u4ef6&#xff0c;\u6587\u4ef6\u540d\u4f9d\u7136\u6e05\u4e00\u8272\u662f &lt;issue \u7f16\u53f7&gt;-&lt;\u7b80\u77ed\u63cf\u8ff0&gt;.test.ts \u7684\u683c\u5f0f&#xff0c;\u4f8b\u5982&#xff1a;<\/p>\n<p>2023-queued-slash-command-followup.test.ts<br \/>\n3317-network-connection-lost-retry.test.ts<br \/>\n5109-exclude-tools.test.ts<br \/>\n7290-json-stream-linear.test.ts<\/p>\n<p>\u4e5f\u5b58\u5728\u4e2a\u522b\u6ca1\u6709\u7f16\u53f7\u524d\u7f00\u7684\u6587\u4ef6&#xff08;\u5982 pre-prompt-compaction-no-continue.test.ts\u3001startup-session-rebind-duplicate-subscription.test.ts&#xff09;&#xff0c;\u8fd9\u5370\u8bc1\u4e86\u76ee\u5f55\u7ec4\u7ec7\u672c\u8eab\u73b0\u5728\u53ea\u662f\u7ea6\u5b9a\u4fd7\u6210\u7684\u5b9e\u8df5,\u4e0d\u518d\u662f\u6587\u6863\u5f3a\u5236\u7684\u89c4\u5219\u3002\u8fd9\u79cd\u547d\u540d\u65b9\u5f0f\u7684\u597d\u5904\u4f9d\u7136\u5f88\u76f4\u63a5&#xff1a;\u51e0\u5e74\u540e\u518d\u770b\u5230\u8fd9\u4e2a\u6d4b\u8bd5\u6587\u4ef6&#xff0c;\u4e0d\u9700\u8981\u770b\u6d4b\u8bd5\u5185\u5bb9\u5c31\u77e5\u9053\u5b83\u5728\u9632\u6b62\u54ea\u4e2a\u5386\u53f2 bug \u590d\u73b0\u3002<\/p>\n<p>\u5f53\u524d AGENTS.md \u91cc\u5173\u4e8e\u56de\u5f52\u6d4b\u8bd5\u7684\u8981\u6c42\u5df2\u7ecf\u4ece&#034;\u6309\u56fa\u5b9a\u76ee\u5f55 &#043; \u6587\u4ef6\u540d\u683c\u5f0f\u7ec4\u7ec7&#034;\u6539\u6210\u4e86\u66f4\u8f7b\u91cf\u7684\u4e00\u53e5\u8bdd&#xff1a;&#034;\u4fee\u590d\u67d0\u4e2a GitHub issue \u7684\u56de\u5f52\u6d4b\u8bd5&#xff0c;\u8981\u5728\u6d4b\u8bd5\u65c1\u8fb9\u52a0\u4e00\u6761\u5e26 issue \u7f16\u53f7\u7684\u6ce8\u91ca&#034;&#xff08;When regressions tests for fixing a github issue, add a comment with the github issue number next to the test.&#xff09;\u2014\u2014\u4ece&#034;\u9760\u6587\u4ef6\u8def\u5f84\u548c\u547d\u540d\u89c4\u8303\u4f20\u9012\u53ef\u8ffd\u6eaf\u6027&#034;&#xff0c;\u53d8\u6210&#034;\u9760\u4ee3\u7801\u6ce8\u91ca\u4f20\u9012\u53ef\u8ffd\u6eaf\u6027&#034;&#xff0c;\u7ea6\u675f\u76ee\u6807\u6ca1\u53d8&#xff08;\u51e0\u5e74\u540e\u8fd8\u80fd\u987a\u85e4\u6478\u74dc\u627e\u5230\u95ee\u9898\u80cc\u666f&#xff09;&#xff0c;\u4f46\u8f7d\u4f53\u4ece\u6587\u4ef6\u7cfb\u7edf\u7ea6\u5b9a\u653e\u5bbd\u6210\u4e86\u6e90\u7801\u5185\u6ce8\u91ca,\u8fd9\u5bf9\u8d21\u732e\u8005\u6765\u8bf4\u95e8\u69db\u66f4\u4f4e&#xff0c;\u4e5f\u4e0d\u518d\u8981\u6c42\u65b0\u6d4b\u8bd5\u5fc5\u987b\u4e25\u683c\u5957\u8fdb test\/suite\/regressions\/ \u8fd9\u4e00\u4e2a\u76ee\u5f55\u3002\u5f53\u7136&#xff0c;test\/suite\/harness.ts &#043; faux provider\u3001\u4e0d\u80fd\u5f15\u5165\u771f\u5b9e provider \u4f9d\u8d56\u8fd9\u4e24\u6761\u786c\u7ea6\u675f\u6ca1\u6709\u53d8\u5316\u3002<\/p>\n<h3>\u52a8\u624b\u7ec3\u4e60<\/h3>\n<li>\u8dd1\u901a\u4e00\u4e2a\u5177\u4f53\u7684 faux provider \u6d4b\u8bd5&#xff1a;\u514b\u9686\u4ed3\u5e93\u540e&#xff0c;\u5728 packages\/coding-agent \u76ee\u5f55\u4e0b\u6267\u884cnode &#034;$(git rev-parse &#8211;show-toplevel)\/node_modules\/vitest\/dist\/cli.js&#034; &#8211;run test\/suite\/regressions\/2023-queued-slash-command-followup.test.ts<br \/>\n\u8dd1\u901a\u540e&#xff0c;\u5c1d\u8bd5\u4fee\u6539 harness.setResponses([&#8230;]) \u91cc\u7684\u67d0\u4e00\u6b65&#xff08;\u6bd4\u5982\u628a fauxAssistantMessage(&#034;first turn complete&#034;) \u7684\u6587\u672c\u6539\u6389&#xff09;&#xff0c;\u91cd\u65b0\u8fd0\u884c\u5e76\u89c2\u5bdf\u54ea\u4e00\u6761\u65ad\u8a00\u5931\u8d25&#xff0c;\u4f53\u4f1a faux provider \u662f\u5982\u4f55\u8ba9&#034;\u6a21\u578b\u8bf4\u4ec0\u4e48&#034;\u53d8\u6210\u5b8c\u5168\u53ef\u63a7\u7684\u6d4b\u8bd5\u8f93\u5165\u7684\u3002<\/li>\n<li>\u5728 packages\/tui \u91cc\u8dd1\u4e00\u4e2a node:test \u6d4b\u8bd5&#xff1a;\u8fdb\u5165 packages\/tui \u76ee\u5f55&#xff0c;\u6267\u884cnode &#8211;test test\/keys.test.ts<br \/>\n\u5bf9\u6bd4\u5b83\u548c\u4e0a\u4e00\u6b65 vitest \u547d\u4ee4\u5728\u8c03\u7528\u65b9\u5f0f\u3001\u8f93\u51fa\u683c\u5f0f\u4e0a\u7684\u5dee\u5f02&#xff0c;\u786e\u8ba4\u81ea\u5df1\u8bb0\u4f4f\u4e86&#034;vitest \u5305&#034;\u548c&#034;packages\/tui&#034;\u4e24\u79cd\u4e0d\u540c\u7684\u5355\u6d4b\u8bd5\u6587\u4ef6\u8fd0\u884c\u65b9\u5f0f\u3002<\/li>\n<p>&#xff08;\u53ef\u9009&#xff0c;\u9700\u8981\u771f\u5b9e\u5bc6\u94a5&#xff09;\u8dd1\u4e00\u6b21 smoke eval&#xff1a;\u5982\u679c\u4f60\u624b\u5934\u6709\u53ef\u7528\u7684 provider \u5bc6\u94a5&#xff0c;\u53ef\u4ee5\u5728\u4ed3\u5e93\u6839\u76ee\u5f55\u6267\u884c npm run eval &#8212; &#8211;provider &lt;\u4f60\u7684provider&gt; &#8211;model &lt;\u4f60\u7684\u6a21\u578b&gt; &#8212; src\/smoke.eval.ts&#xff0c;\u8dd1\u5b8c\u540e\u67e5\u770b packages\/evals\/.eval\/ \u4e0b\u751f\u6210\u7684 runs.jsonl \u548c\u4f1a\u8bdd JSONL \u6587\u4ef6&#xff0c;\u76f4\u89c2\u611f\u53d7 evals \u4ea7\u7269\u548c\u666e\u901a\u6d4b\u8bd5\u62a5\u544a\u7684\u533a\u522b\u3002<\/p>\n<h3>\u5c0f\u7ed3<\/h3>\n<p>pi \u628a&#034;\u6d4b\u8bd5\u4ee3\u7801\u903b\u8f91&#034;\u548c&#034;\u8bc4\u6d4b Agent \u884c\u4e3a\u8d28\u91cf&#034;\u5f53\u6210\u4e24\u4ef6\u5b8c\u5168\u4e0d\u540c\u7684\u4e8b\u60c5\u6765\u5bf9\u5f85&#xff1a;\u5355\u5143\/\u96c6\u6210\u6d4b\u8bd5\u9760 packages\/ai\/src\/providers\/faux.ts \u63d0\u4f9b\u7684\u5047\u6a21\u578b provider&#xff0c;\u628a\u4e0d\u786e\u5b9a\u7684\u5916\u90e8\u4f9d\u8d56\u4ece\u6d4b\u8bd5\u5173\u952e\u8def\u5f84\u4e0a\u5254\u9664&#xff0c;\u6362\u6765\u53c8\u5feb\u53c8\u7a33\u5b9a\u3001\u53ef\u4ee5\u653e\u5fc3\u8dd1\u5728 CI \u91cc\u7684\u786e\u5b9a\u6027\u6d4b\u8bd5&#xff1b;e2e \u6d4b\u8bd5\u901a\u8fc7 describe.skipIf \u4e0e\u771f\u5b9e\u5bc6\u94a5\u7684\u73af\u5883\u53d8\u91cf\u6302\u94a9&#xff0c;\u9ed8\u8ba4\u4e0d\u8dd1&#xff0c;\u53ea\u6709\u663e\u5f0f\u914d\u7f6e\u4e86\u5bf9\u5e94\u5bc6\u94a5\u624d\u4f1a\u6fc0\u6d3b&#xff0c;\u56e0\u6b64\u7edd\u4e0d\u80fd\u76f4\u63a5\u8dd1\u5b8c\u6574 vitest \u5957\u4ef6&#xff0c;\u5fc5\u987b\u7528 .\/test.sh \u9694\u79bb\u73af\u5883\u6216\u9488\u5bf9\u5355\u6587\u4ef6\u8fd0\u884c&#xff1b;evals \u4f53\u7cfb\u5219\u53cd\u8fc7\u6765\u62e5\u62b1\u771f\u5b9e\u6a21\u578b\u7684\u4e0d\u786e\u5b9a\u6027&#xff0c;\u7528 pi-harness.ts \u628a\u771f\u5b9e AgentSession \u63a5\u5165 vitest-evals&#xff0c;\u914d\u5408\u8bc4\u59d4\u51fd\u6570\u548c\u5bf9\u7167\u5b9e\u9a8c\u8861\u91cf&#034;\u8fd9\u5957\u63d0\u793a\u8bcd\/\u5de5\u5177\/\u6a21\u578b\u7ec4\u5408\u5b8c\u6210\u771f\u5b9e\u4efb\u52a1\u7684\u6548\u679c\u597d\u4e0d\u597d&#034;\u3002\u4e09\u5c42\u5404\u53f8\u5176\u804c&#xff0c;\u5171\u540c\u6784\u6210\u4e86 pi \u5bf9&#034;\u4e00\u4e2a\u4f1a\u8c03\u7528\u771f\u5b9e\u5927\u6a21\u578b\u7684\u590d\u6742\u7cfb\u7edf&#034;\u5e94\u6709\u7684\u6d4b\u8bd5\u7eaa\u5f8b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>pi \u7684\u6d4b\u8bd5\u4f53\u7cfb\u5206\u4e09\u5c42&#xff1a;\u4e0d\u4f9d\u8d56\u6a21\u578b\u7684\u786e\u5b9a\u6027\u5355\u5143\/\u96c6\u6210\u6d4b\u8bd5\u3001\u9700\u8981\u771f\u5b9e\u5bc6\u94a5\u624d\u4f1a\u6fc0\u6d3b\u7684 e2e \u6d4b\u8bd5&#xff0c;\u4ee5\u53ca\u4e13\u95e8\u8bc4\u6d4b Agent \u5728\u771f\u5b9e\u4efb\u52a1\u4e0a\u8868\u73b0\u8d28\u91cf\u7684 evals \u4f53\u7cfb&#xff1b;\u7528\u4e00\u4e2a\\&#8221;\u5047\u7684\\&#8221;\u6a21\u578b provider&#xff08;faux provider&#xff09;\u628a Agent \u903b\u8f91\u6d4b\u8bd5\u548c\u771f\u5b9e API \u5f7b\u5e95\u89e3\u8026&#xff0c;\u662f\u8d2f\u7a7f\u6574\u4e2a\u6d4b\u8bd5\u7b56\u7565\u7684\u6838\u5fc3\u8bbe\u8ba1\u3002\u5b66\u4e60\u76ee\u6807\u7406\u89e3 pi \u4ed3\u5e93\u91cc\u5355\u5143\/\u96c6\u6210\u6d4b\u8bd5\u3001e2e \u6d4b\u8bd5\u3001evals \u4e09\u8005\u7684\u5b9a\u4f4d\u5dee\u5f02&amp;#<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[50],"topic":[],"class_list":["post-108493","post","type-post","status-publish","format-standard","hentry","category-server","tag-50"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>LLM\u4e4bAgent\uff08\u516b\u5341\u4e5d\uff09\uff5cPI\uff08\u4e8c\u5341\u516b\uff09\u6d4b\u8bd5\u7b56\u7565\uff1aFaux Provider \u4e0e Evals - \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\/108493.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"LLM\u4e4bAgent\uff08\u516b\u5341\u4e5d\uff09\uff5cPI\uff08\u4e8c\u5341\u516b\uff09\u6d4b\u8bd5\u7b56\u7565\uff1aFaux Provider \u4e0e Evals - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"pi \u7684\u6d4b\u8bd5\u4f53\u7cfb\u5206\u4e09\u5c42&#xff1a;\u4e0d\u4f9d\u8d56\u6a21\u578b\u7684\u786e\u5b9a\u6027\u5355\u5143\/\u96c6\u6210\u6d4b\u8bd5\u3001\u9700\u8981\u771f\u5b9e\u5bc6\u94a5\u624d\u4f1a\u6fc0\u6d3b\u7684 e2e \u6d4b\u8bd5&#xff0c;\u4ee5\u53ca\u4e13\u95e8\u8bc4\u6d4b Agent \u5728\u771f\u5b9e\u4efb\u52a1\u4e0a\u8868\u73b0\u8d28\u91cf\u7684 evals \u4f53\u7cfb&#xff1b;\u7528\u4e00\u4e2a&quot;\u5047\u7684&quot;\u6a21\u578b provider&#xff08;faux provider&#xff09;\u628a Agent \u903b\u8f91\u6d4b\u8bd5\u548c\u771f\u5b9e API \u5f7b\u5e95\u89e3\u8026&#xff0c;\u662f\u8d2f\u7a7f\u6574\u4e2a\u6d4b\u8bd5\u7b56\u7565\u7684\u6838\u5fc3\u8bbe\u8ba1\u3002\u5b66\u4e60\u76ee\u6807\u7406\u89e3 pi \u4ed3\u5e93\u91cc\u5355\u5143\/\u96c6\u6210\u6d4b\u8bd5\u3001e2e \u6d4b\u8bd5\u3001evals \u4e09\u8005\u7684\u5b9a\u4f4d\u5dee\u5f02&amp;#\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/108493.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-21T14:24:42+00:00\" \/>\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=\"10 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/108493.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/108493.html\",\"name\":\"LLM\u4e4bAgent\uff08\u516b\u5341\u4e5d\uff09\uff5cPI\uff08\u4e8c\u5341\u516b\uff09\u6d4b\u8bd5\u7b56\u7565\uff1aFaux Provider \u4e0e Evals - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-21T14:24:42+00:00\",\"dateModified\":\"2026-09-21T14:24:42+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/108493.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/108493.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/108493.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"LLM\u4e4bAgent\uff08\u516b\u5341\u4e5d\uff09\uff5cPI\uff08\u4e8c\u5341\u516b\uff09\u6d4b\u8bd5\u7b56\u7565\uff1aFaux Provider \u4e0e Evals\"}]},{\"@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":"LLM\u4e4bAgent\uff08\u516b\u5341\u4e5d\uff09\uff5cPI\uff08\u4e8c\u5341\u516b\uff09\u6d4b\u8bd5\u7b56\u7565\uff1aFaux Provider \u4e0e Evals - \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\/108493.html","og_locale":"zh_CN","og_type":"article","og_title":"LLM\u4e4bAgent\uff08\u516b\u5341\u4e5d\uff09\uff5cPI\uff08\u4e8c\u5341\u516b\uff09\u6d4b\u8bd5\u7b56\u7565\uff1aFaux Provider \u4e0e Evals - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"pi \u7684\u6d4b\u8bd5\u4f53\u7cfb\u5206\u4e09\u5c42&#xff1a;\u4e0d\u4f9d\u8d56\u6a21\u578b\u7684\u786e\u5b9a\u6027\u5355\u5143\/\u96c6\u6210\u6d4b\u8bd5\u3001\u9700\u8981\u771f\u5b9e\u5bc6\u94a5\u624d\u4f1a\u6fc0\u6d3b\u7684 e2e \u6d4b\u8bd5&#xff0c;\u4ee5\u53ca\u4e13\u95e8\u8bc4\u6d4b Agent \u5728\u771f\u5b9e\u4efb\u52a1\u4e0a\u8868\u73b0\u8d28\u91cf\u7684 evals \u4f53\u7cfb&#xff1b;\u7528\u4e00\u4e2a\"\u5047\u7684\"\u6a21\u578b provider&#xff08;faux provider&#xff09;\u628a Agent \u903b\u8f91\u6d4b\u8bd5\u548c\u771f\u5b9e API \u5f7b\u5e95\u89e3\u8026&#xff0c;\u662f\u8d2f\u7a7f\u6574\u4e2a\u6d4b\u8bd5\u7b56\u7565\u7684\u6838\u5fc3\u8bbe\u8ba1\u3002\u5b66\u4e60\u76ee\u6807\u7406\u89e3 pi \u4ed3\u5e93\u91cc\u5355\u5143\/\u96c6\u6210\u6d4b\u8bd5\u3001e2e \u6d4b\u8bd5\u3001evals \u4e09\u8005\u7684\u5b9a\u4f4d\u5dee\u5f02&amp;#","og_url":"https:\/\/www.wsisp.com\/helps\/108493.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-21T14:24:42+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"10 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/108493.html","url":"https:\/\/www.wsisp.com\/helps\/108493.html","name":"LLM\u4e4bAgent\uff08\u516b\u5341\u4e5d\uff09\uff5cPI\uff08\u4e8c\u5341\u516b\uff09\u6d4b\u8bd5\u7b56\u7565\uff1aFaux Provider \u4e0e Evals - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-21T14:24:42+00:00","dateModified":"2026-09-21T14:24:42+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/108493.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/108493.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/108493.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"LLM\u4e4bAgent\uff08\u516b\u5341\u4e5d\uff09\uff5cPI\uff08\u4e8c\u5341\u516b\uff09\u6d4b\u8bd5\u7b56\u7565\uff1aFaux Provider \u4e0e Evals"}]},{"@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\/108493","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=108493"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/108493\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=108493"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=108493"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=108493"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=108493"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}