Eine unsaubere CSV-Datei mit einem KI-Agent bereinigen und analysieren

Ein Agent analysiert eine CSV-Datei mit echten Befehlen in einer Sandbox und meldet Duplikate, fehlende Werte, falsche Formate und Ausreißer.

  • Dateien
  • Shell
  • Budgetlimit

Eine echte Ausführung ansehen

Eine echte Ausführung vom 7. Okt. 2026, erneut abgespielt. Modell: openai/gpt-6-luna.

Erfolgreichrun_a95629e4250a32c985f2bd387bfe25f3$0.006427 von $0.05
  1. In WarteschlangeBudget $0.05 reserviert
  2. MicroVMmicroVM ready
  3. MicroVMworker started · shell on · web off
  4. Dateiread orders.csv
  5. Shell$ python3 - <<'PY' import csv p='/tmp/ephemeral-run-s2TPIy/bundle/orders.csv' with open(p,newline='')…
  6. Shell$ python3 - <<'PY' import csv,re,datetime,collections p='/tmp/ephemeral-run-s2TPIy/bundle/orders.csv'…
  7. MicroVMmicroVM destroyed
  8. Erfolgreich3 Modellaufrufe, 9,333 TokensAufgezeichnete Ausgabe (Englisch)

    Verdict: Found data-quality issues in missing values, duplicates, email, casing, dates, and quantity.

    IssueCountAffected data rowsSuggested fix
    Missing customer_email13Populate or explicitly mark unknown.
    Missing unit_price19Populate or explicitly mark unknown.
    Duplicate full rows27, 8Remove one duplicate.
    Duplicate order_id27, 8Confirm which order is valid; make IDs unique.
    Invalid email14Correct the address (e.g., add a valid domain).
    Inconsistent country casing12Normalize de to DE.
    Inconsistent status casing112Normalize Shipped to shipped.
    Date not in YYYY-MM-DD format15Convert to 2026-09-02.
    Nonexistent date114Correct 2026-09-31 to the intended valid date.
    Negative quantity16Verify and correct the quantity.
    Extreme quantity outlier (1000)115Verify against the source order.
  9. Worker zerstört$0.006427 berechnet, $0.043573 freigegeben
Modell $0.001027 · Web $0.00 · Rechenleistung $0.0054

Selbst ausführen

Öffnen Sie das Beispiel im Playground, mit der vollständig ausgefüllten Anfrage. Es läuft in Ihrem eigenen Konto, innerhalb des angezeigten Budgets, gegen dieselben schreibgeschützten Beispielsysteme.

Budget für dieses Beispiel: $0.05

So funktioniert es

Die Datei ist schreibgeschützt und die Sandbox hat kein Netzwerk, die Daten bleiben also, wo sie sind. Der Agent zählt Probleme mit der Shell, statt sie nach Augenmaß zu schätzen, und listet jedes Problem mit Zeilennummern und einem Korrekturvorschlag auf.

Was der Agent tun kann und was nicht

Die Berechtigungen sind Teil der Anfrage. Alles, was hier nicht aufgeführt ist, steht der Ausführung nicht zur Verfügung.

EinstellungErlaubt
VerbindungenKeine
WebAus
ShellAn, innerhalb der abgeschotteten Maschine
Dateienorders.csv (schreibgeschützt)
Null-DatenspeicherungAus: Das Protokoll wird 30 Tage lang gespeichert
Budget$0.05, ein festes Limit
Timeout120 Sekunden

Zugangsdaten gelangen nie in die Maschine: Ein Broker ergänzt sie bei jedem Aufruf und erzwingt die oben genannten Methoden.

Der Code

Das ist die genaue Anfrage, die das Beispiel sendet. Setzen Sie EPHEMERAL_API_KEY auf einen Mitgliedsschlüssel Ihrer Organisation.

curl -X POST $EPHEMERAL_URL/v1/runs \
  -H "Authorization: Bearer $EPHEMERAL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d @request.json

Dateien in der Anfrage

Inline übergeben, es wird also nichts vorher hochgeladen. Der Agent sieht jede einzelne als schreibgeschützte Datei.

orders.csv
orders.csv
order_id,customer_email,country,order_date,quantity,unit_price,status
1001,[email protected],DE,2026-09-01,2,19.90,shipped
1002,[email protected],de,2026-09-01,1,19.90,shipped
1003,,US,2026-09-02,3,9.50,shipped
1004,carla@example,US,2026-09-02,1,49.00,delivered
1005,[email protected],FR,02/09/2026,1,49.00,delivered
1006,[email protected],FR,2026-09-03,-1,19.90,refunded
1007,[email protected],US,2026-09-03,2,9.50,shipped
1007,[email protected],US,2026-09-03,2,9.50,shipped
1008,[email protected],GB,2026-09-04,1,,shipped
1009,[email protected],JP,2026-09-04,5,19.90,delivered
1010,[email protected],DE,2026-09-05,1,19.90,shipped
1011,[email protected],US,2026-09-05,1,9.50,Shipped
1012,[email protected],KR,2026-09-06,1,49.00,delivered
1013,[email protected],US,2026-09-31,2,9.50,shipped
1014,[email protected],DE,2026-09-07,1000,19.90,shipped
1015,[email protected],FR,2026-09-08,1,19.90,delivered
1016,[email protected],GB,2026-09-08,2,49.00,delivered
1017,[email protected],US,2026-09-09,1,9.50,cancelled
1018,[email protected],DE,2026-09-09,1,19.90,delivered
1019,[email protected],US,2026-09-10,2,9.50,shipped
1020,[email protected],JP,2026-09-10,1,49.00,delivered
Vollständiger Anfragetext request.json

Derselbe Text, mit den Dateien inline.

request.json
{
  "prompt": "Profile orders.csv (columns: order_id, customer_email, country, order_date, quantity, unit_price, status). Use the shell (python3, awk, sort, uniq, whatever is installed) to count the problems; do not count by eye. Check duplicate rows and duplicate order_ids, missing values per column, invalid emails, inconsistent country or status casing, dates that are not YYYY-MM-DD or do not exist, negative quantities and extreme outliers. Reply in Markdown, at most 220 words: a one-line verdict, then a table of issue, count, affected row numbers (data rows, header excluded) and a suggested fix. If a check finds nothing, omit it.",
  "files": [
    {
      "path": "orders.csv",
      "content": "order_id,customer_email,country,order_date,quantity,unit_price,status\n1001,[email protected],DE,2026-09-01,2,19.90,shipped\n1002,[email protected],de,2026-09-01,1,19.90,shipped\n1003,,US,2026-09-02,3,9.50,shipped\n1004,carla@example,US,2026-09-02,1,49.00,delivered\n1005,[email protected],FR,02/09/2026,1,49.00,delivered\n1006,[email protected],FR,2026-09-03,-1,19.90,refunded\n1007,[email protected],US,2026-09-03,2,9.50,shipped\n1007,[email protected],US,2026-09-03,2,9.50,shipped\n1008,[email protected],GB,2026-09-04,1,,shipped\n1009,[email protected],JP,2026-09-04,5,19.90,delivered\n1010,[email protected],DE,2026-09-05,1,19.90,shipped\n1011,[email protected],US,2026-09-05,1,9.50,Shipped\n1012,[email protected],KR,2026-09-06,1,49.00,delivered\n1013,[email protected],US,2026-09-31,2,9.50,shipped\n1014,[email protected],DE,2026-09-07,1000,19.90,shipped\n1015,[email protected],FR,2026-09-08,1,19.90,delivered\n1016,[email protected],GB,2026-09-08,2,49.00,delivered\n1017,[email protected],US,2026-09-09,1,9.50,cancelled\n1018,[email protected],DE,2026-09-09,1,19.90,delivered\n1019,[email protected],US,2026-09-10,2,9.50,shipped\n1020,[email protected],JP,2026-09-10,1,49.00,delivered\n"
    }
  ],
  "web": false,
  "shell": true,
  "timeout_seconds": 120,
  "max_cost_micros": 50000
}

Mehr erfahren

Ähnliche Beispiele

esc

Keine Treffer für „“.