{"id":286,"date":"2026-03-21T22:47:26","date_gmt":"2026-03-21T14:47:26","guid":{"rendered":"https:\/\/pa.yingzhi8.cn\/index.php\/2026\/03\/21\/tools-llm-task\/"},"modified":"2026-03-21T23:08:55","modified_gmt":"2026-03-21T15:08:55","slug":"tools-llm-task","status":"publish","type":"post","link":"https:\/\/pa.yingzhi8.cn\/index.php\/2026\/03\/21\/tools-llm-task\/","title":{"rendered":"LLM \u4efb\u52a1"},"content":{"rendered":"<h1>LLM \u4efb\u52a1<\/h1>\n<p><code>llm-task<\/code> \u662f\u4e00\u4e2a<strong>\u53ef\u9009\u63d2\u4ef6\u5de5\u5177<\/strong>\uff0c\u7528\u4e8e\u8fd0\u884c\u7eaf JSON \u7684 LLM \u4efb\u52a1\u5e76\u8fd4\u56de\u7ed3\u6784\u5316\u8f93\u51fa\uff08\u53ef\u9009\u62e9\u6839\u636e JSON Schema \u8fdb\u884c\u9a8c\u8bc1\uff09\u3002<\/p>\n<p>\u8fd9\u975e\u5e38\u9002\u5408\u50cf Lobster \u8fd9\u6837\u7684\u5de5\u4f5c\u6d41\u5f15\u64ce\uff1a\u4f60\u53ef\u4ee5\u6dfb\u52a0\u5355\u4e2a LLM \u6b65\u9aa4\uff0c\u800c\u65e0\u9700\u4e3a\u6bcf\u4e2a\u5de5\u4f5c\u6d41\u7f16\u5199\u81ea\u5b9a\u4e49 OpenClaw \u4ee3\u7801\u3002<\/p>\n<h2>\u542f\u7528\u63d2\u4ef6<\/h2>\n<ol>\n<li>\u542f\u7528\u63d2\u4ef6\uff1a<\/li>\n<\/ol>\n<p>&#8220;`json  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\n{<br \/>\n  &#8220;plugins&#8221;: {<br \/>\n    &#8220;entries&#8221;: {<br \/>\n      &#8220;llm-task&#8221;: { &#8220;enabled&#8221;: true }<br \/>\n    }<br \/>\n  }<br \/>\n}<\/p>\n<pre><code>\n2. \u5c06\u5de5\u5177\u52a0\u5165\u5141\u8bb8\u5217\u8868\uff08\u5b83\u4ee5 `optional: true` \u6ce8\u518c\uff09\uff1a\n\n```json  theme={&quot;theme&quot;:{&quot;light&quot;:&quot;min-light&quot;,&quot;dark&quot;:&quot;min-dark&quot;}}\n{\n  &quot;agents&quot;: {\n    &quot;list&quot;: [\n      {\n        &quot;id&quot;: &quot;main&quot;,\n        &quot;tools&quot;: { &quot;allow&quot;: [&quot;llm-task&quot;] }\n      }\n    ]\n  }\n}\n<\/code><\/pre>\n<h2>\u914d\u7f6e\uff08\u53ef\u9009\uff09<\/h2>\n<p>&#8220;`json  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\n{<br \/>\n  &#8220;plugins&#8221;: {<br \/>\n    &#8220;entries&#8221;: {<br \/>\n      &#8220;llm-task&#8221;: {<br \/>\n        &#8220;enabled&#8221;: true,<br \/>\n        &#8220;config&#8221;: {<br \/>\n          &#8220;defaultProvider&#8221;: &#8220;openai-codex&#8221;,<br \/>\n          &#8220;defaultModel&#8221;: &#8220;gpt-5.2&#8221;,<br \/>\n          &#8220;defaultAuthProfileId&#8221;: &#8220;main&#8221;,<br \/>\n          &#8220;allowedModels&#8221;: [&#8220;openai-codex\/gpt-5.2&#8221;],<br \/>\n          &#8220;maxTokens&#8221;: 800,<br \/>\n          &#8220;timeoutMs&#8221;: 30000<br \/>\n        }<br \/>\n      }<br \/>\n    }<br \/>\n  }<br \/>\n}<\/p>\n<pre><code>\n`allowedModels` \u662f `provider\/model` \u5b57\u7b26\u4e32\u7684\u5141\u8bb8\u5217\u8868\u3002\u5982\u679c\u8bbe\u7f6e\u4e86\u8be5\u9879\uff0c\u4efb\u4f55\u4e0d\u5728\u5217\u8868\u4e2d\u7684\u8bf7\u6c42\u90fd\u4f1a\u88ab\u62d2\u7edd\u3002\n\n## \u5de5\u5177\u53c2\u6570\n\n* `prompt`\uff08\u5b57\u7b26\u4e32\uff0c\u5fc5\u586b\uff09\n* `input`\uff08\u4efb\u610f\u7c7b\u578b\uff0c\u53ef\u9009\uff09\n* `schema`\uff08\u5bf9\u8c61\uff0c\u53ef\u9009 JSON Schema\uff09\n* `provider`\uff08\u5b57\u7b26\u4e32\uff0c\u53ef\u9009\uff09\n* `model`\uff08\u5b57\u7b26\u4e32\uff0c\u53ef\u9009\uff09\n* `authProfileId`\uff08\u5b57\u7b26\u4e32\uff0c\u53ef\u9009\uff09\n* `temperature`\uff08\u6570\u5b57\uff0c\u53ef\u9009\uff09\n* `maxTokens`\uff08\u6570\u5b57\uff0c\u53ef\u9009\uff09\n* `timeoutMs`\uff08\u6570\u5b57\uff0c\u53ef\u9009\uff09\n\n## \u8f93\u51fa\n\n\u8fd4\u56de `details.json`\uff0c\u5305\u542b\u89e3\u6790\u540e\u7684 JSON\uff08\u5982\u679c\u63d0\u4f9b\u4e86 `schema`\uff0c\u5219\u4f1a\u8fdb\u884c\u9a8c\u8bc1\uff09\u3002\n\n## \u793a\u4f8b\uff1aLobster \u5de5\u4f5c\u6d41\u6b65\u9aa4\n\n```lobster  theme={&quot;theme&quot;:{&quot;light&quot;:&quot;min-light&quot;,&quot;dark&quot;:&quot;min-dark&quot;}}\nopenclaw.invoke --tool llm-task --action json --args-json '{\n  &quot;prompt&quot;: &quot;Given the input email, return intent and draft.&quot;,\n  &quot;input&quot;: {\n    &quot;subject&quot;: &quot;Hello&quot;,\n    &quot;body&quot;: &quot;Can you help?&quot;\n  },\n  &quot;schema&quot;: {\n    &quot;type&quot;: &quot;object&quot;,\n    &quot;properties&quot;: {\n      &quot;intent&quot;: { &quot;type&quot;: &quot;string&quot; },\n      &quot;draft&quot;: { &quot;type&quot;: &quot;string&quot; }\n    },\n    &quot;required&quot;: [&quot;intent&quot;, &quot;draft&quot;],\n    &quot;additionalProperties&quot;: false\n  }\n}'\n<\/code><\/pre>\n<h2>\u5b89\u5168\u6ce8\u610f\u4e8b\u9879<\/h2>\n<ul>\n<li>\u8be5\u5de5\u5177\u4e3a<strong>\u7eaf JSON \u6a21\u5f0f<\/strong>\uff0c\u6307\u793a\u6a21\u578b\u4ec5\u8f93\u51fa JSON\uff08\u65e0\u4ee3\u7801\u56f4\u680f\u3001\u65e0\u6ce8\u91ca\u8bf4\u660e\uff09\u3002<\/li>\n<li>\u6b64\u6b21\u8fd0\u884c\u4e0d\u4f1a\u5411\u6a21\u578b\u66b4\u9732\u4efb\u4f55\u5de5\u5177\u3002<\/li>\n<li>\u9664\u975e\u4f7f\u7528 <code>schema<\/code> \u8fdb\u884c\u9a8c\u8bc1\uff0c\u5426\u5219\u5e94\u5c06\u8f93\u51fa\u89c6\u4e3a\u4e0d\u53ef\u4fe1\u3002<\/li>\n<li>\u5728\u4efb\u4f55\u6709\u526f\u4f5c\u7528\u7684\u6b65\u9aa4\uff08\u53d1\u9001\u3001\u53d1\u5e03\u3001\u6267\u884c\uff09\u4e4b\u524d\u8bbe\u7f6e\u5ba1\u6279\u6d41\u7a0b\u3002<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>LLM \u4efb\u52a1 llm-task \u662f\u4e00\u4e2a\u53ef\u9009\u63d2\u4ef6\u5de5\u5177\uff0c\u7528\u4e8e\u8fd0\u884c\u7eaf JSON \u7684 LLM \u4efb\u52a1\u5e76\u8fd4\u56de\u7ed3\u6784\u5316\u8f93\u51fa\uff08\u53ef [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-286","post","type-post","status-publish","format-standard","hentry","category-docs"],"_links":{"self":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/286","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/comments?post=286"}],"version-history":[{"count":1,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/286\/revisions"}],"predecessor-version":[{"id":581,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/286\/revisions\/581"}],"wp:attachment":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/media?parent=286"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/categories?post=286"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/tags?post=286"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}