LLM Task

llm-task ist ein optionales Plugin-Tool, das einen JSON-only LLM-Task ausführt und strukturierte Ausgabe zurückgibt (optional gegen JSON Schema validiert).

Das ist ideal für Workflow-Engines wie Lobster: Du kannst einen einzelnen LLM-Schritt hinzufügen, ohne für jeden Workflow eigenen OpenClaw-Code schreiben zu müssen.

Plugin aktivieren

  1. Plugin aktivieren:
{
  "plugins": {
    "entries": {
      "llm-task": { "enabled": true }
    }
  }
}
  1. Tool in die Allowlist aufnehmen (es wird mit optional: true registriert):
{
  "agents": {
    "list": [
      {
        "id": "main",
        "tools": { "allow": ["llm-task"] }
      }
    ]
  }
}

Konfiguration (optional)

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

allowedModels ist eine Allowlist von provider/model-Strings. Wenn gesetzt, wird jede Anfrage außerhalb der Liste abgelehnt.

Tool-Parameter

  • prompt (string, erforderlich)
  • input (any, optional)
  • schema (object, optionales JSON Schema)
  • provider (string, optional)
  • model (string, optional)
  • thinking (string, optional)
  • authProfileId (string, optional)
  • temperature (number, optional)
  • maxTokens (number, optional)
  • timeoutMs (number, optional)

thinking akzeptiert die standardmäßigen OpenClaw Reasoning-Presets wie low oder medium.

Ausgabe

Gibt details.json mit dem geparsten JSON zurück (und validiert gegen schema, wenn angegeben).

Beispiel: Lobster-Workflow-Schritt

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

Sicherheitshinweise

  • Das Tool ist JSON-only und weist das Modell an, nur JSON auszugeben (keine Code-Fences, kein Kommentar).
  • Dem Modell werden für diesen Run keine Tools bereitgestellt.
  • Behandle die Ausgabe als nicht vertrauenswürdig, es sei denn, du validierst mit schema.
  • Platziere Genehmigungen vor jedem Schritt mit Seiteneffekten (Senden, Posten, Exec).