LLM Task

llm-task は、JSON のみの LLM タスクを実行し、 構造化された出力を返す(オプションで JSON Schema に対して検証)オプションのプラグインツール です。

これは Lobster のようなワークフローエンジンに最適です:各ワークフローのためにカスタム OpenClaw コードを書かずに、単一の LLM ステップを追加できます。

プラグインの有効化

  1. プラグインを有効化します:
{
  "plugins": {
    "entries": {
      "llm-task": { "enabled": true }
    }
  }
}
  1. ツールを許可リストに追加します(optional: true で登録されています):
{
  "agents": {
    "list": [
      {
        "id": "main",
        "tools": { "allow": ["llm-task"] }
      }
    ]
  }
}

設定(オプション)

{
  "plugins": {
    "entries": {
      "llm-task": {
        "enabled": true,
        "config": {
          "defaultProvider": "openai-codex",
          "defaultModel": "gpt-5.2",
          "defaultAuthProfileId": "main",
          "allowedModels": ["openai-codex/gpt-5.2"],
          "maxTokens": 800,
          "timeoutMs": 30000
        }
      }
    }
  }
}

allowedModelsprovider/model 文字列の許可リストです。設定されている場合、リスト外のリクエストは拒否されます。

ツールパラメータ

  • prompt(string、必須)
  • input(any、オプション)
  • schema(object、オプションの JSON Schema)
  • provider(string、オプション)
  • model(string、オプション)
  • authProfileId(string、オプション)
  • temperature(number、オプション)
  • maxTokens(number、オプション)
  • timeoutMs(number、オプション)

出力

解析された JSON を含む details.json を返します(提供された場合は schema に対して検証します)。

例:Lobster ワークフローステップ

openclaw.invoke --tool llm-task --action json --args-json '{
  "prompt": "Given the input email, return intent and draft.",
  "input": {
    "subject": "Hello",
    "body": "Can you help?"
  },
  "schema": {
    "type": "object",
    "properties": {
      "intent": { "type": "string" },
      "draft": { "type": "string" }
    },
    "required": ["intent", "draft"],
    "additionalProperties": false
  }
}'

安全性に関する注意

  • ツールは JSON のみ で、モデルに JSON のみを出力するように指示します(コードフェンスなし、コメントなし)。
  • この実行ではモデルにツールは公開されません。
  • schema で検証しない限り、出力を信頼できないものとして扱います。
  • 副作用を伴うステップ(send、post、exec)の前に承認を配置します。