-
Notifications
You must be signed in to change notification settings - Fork 0
AI Processor
Der AI Processor ist das Herzstück von Workmate Private. Er analysiert Dokumente mit der Claude API (Anthropic, Sonnet) und extrahiert strukturierte Informationen — sowohl aus Text (analyze_document) als auch direkt aus Bildern (analyze_document_image, Claude Vision).
Auszug aus dem tatsächlichen JSON-Schema (claude_service.py):
{
"type": "invoice",
"title": "Stromrechnung Stadtwerke Koblenz",
"confidence": 0.94,
"sender": {"name": "Stadtwerke Koblenz", "address": "...", "email": "...", "phone": "..."},
"amount": 87.50,
"currency": "EUR",
"due_date": "2026-06-15",
"iban": "DE...",
"action_required": true,
"priority": "high",
"suggested_task": {"title": "Rechnung bezahlen", "description": "...", "due_date": "2026-06-15"},
"contract_start": null,
"contract_end": null,
"notice_period_days": null,
"auto_renewal": null
}Vertragsfelder (contract_start, contract_end, notice_period_days, cancellation_deadline, auto_renewal, monthly_cost, contract_partner) werden nur bei type: contract befüllt. Bei identity_document wird due_date als Ablaufdatum interpretiert.
invoice, reminder, contract, receipt, tax_document, payslip, insurance, bank_statement, letter, identity_document (+ other als Fallback) — Details siehe README.
| Priorität | Kriterium |
|---|---|
| Critical | Mahnung / überfällig |
| High | Frist bald fällig |
| Medium | Rechnung / Steuerdokument |
| Low | Quittung / Kontoauszug |
Für identity_document gilt zusätzlich: action_required = true wenn Ablauf < 6 Monate, priority = high wenn < 3 Monate.
- Paperless-Analyse (
app.tasks.analyze_paperless_document) hatmax_retries=2mit fixem Retry-Delay von 60s (kein Exponential Backoff) - Unlesbare/fehlerhafte Antworten der Claude API führen zu einer Exception, der Task schlägt nach Retries fehl und das Dokument bleibt im Status
pending/failed