Stanislaus HeesBuchbegleitung

LESEN · VERSTEHEN · WEITERDENKEN

KI ins eigene Produkt · Seite 100

Inhalt

Ein Verlauf · JSON-Zeilen 157–167 · Fortsetzung

"output": "\"\"\"The example's agreed rule, not a universal rule for invoicing.\"\"\"\nfrom pathlib import Path\nimport sys\n\nsys.path.insert(0, str(Path(__file__).resolve().parents[1] / \"src\"))\nfrom prices import total\n\ncases = [([\"4.10\", \"6.20\"], \"10.30\"), ([\"12.345\"], \"12.35\"), ([], \"0.00\")]\nfor inputs, expected in cases:\n    actual = total(inputs)\n    if actual != expected:\n        print(f\"FAIL: expected {expected}, got {actual}\", file=sys.stderr)\n        raise SystemExit(1)\nprint(\"PASS: 3 price cases\")\n"
    },
    {
      "type": "function_call",
      "call_id": "c04",
      "name": "load_skill",
      "arguments": "{\"skill_id\":\"price-changes\"}"
    },
    {
      "type": "function_call_output",
      "call_id": "c04",

Drei Preisfälle

Die Testdatei verlangt:

4.10 + 6.20 → 10.30
12.345 → 12.35
leere Liste → 0.00

Der vollständige Dateiinhalt steht links in output. Gelesene Tests sind noch keine ausgeführten Tests.

Server → Modell · Anfrage 4

input: 9 Einträge.

4. Die Anleitung laden

Der Katalog hat price-changes bereits als Anleitung für Preisänderungen beschrieben. Nun fordert die KI ihren Inhalt an: Werkzeug load_skill, Eingabe skill_id: "price-changes". Die Runtime öffnet die zugeordnete Datei skills/ price-changes/SKILL.md.