LLM Task

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

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 zu schreiben.

Plugin aktivieren

  1. Aktiviere das Plugin:
{
  "plugins": {
    "entries": {
      "llm-task": { "enabled": true }
    }
  }
}
  1. Füge das Tool zur Allowlist hinzu (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.2",
          "defaultAuthProfileId": "main",
          "allowedModels": ["openai-codex/gpt-5.2"],
          "maxTokens": 800,
          "timeoutMs": 30000
        }
      }
    }
  }
}

allowedModels ist eine Allowlist von provider/model-Strings. Wenn gesetzt, werden alle Anfragen außerhalb dieser Liste abgelehnt.

Tool-Parameter

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

Ausgabe

Gibt details.json zurück, das das geparste JSON enthält (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.",
  "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 rein JSON-basiert und weist das Modell an, nur JSON auszugeben (keine Code-Fences, keine Kommentare).
  • Dem Modell werden für diesen Durchlauf keine Tools zur Verfügung gestellt.
  • Behandle die Ausgabe als nicht vertrauenswürdig, außer du validierst sie mit schema.
  • Setze Freigaben vor jeden Schritt mit Seiteneffekten (send, post, exec).