Add shared ai-service container as AI provider intermediary

All feature containers now POST messages to ai-service (port 8010) instead
of calling AI providers directly. ai-service routes to LM Studio, Ollama,
or Anthropic based on /config/ai_service_config.json. doc-service AI
providers removed; replaced by httpx ai_client.py. Backend settings
restructured to /api/settings/ai. Frontend gets dedicated AIAdminSettingsPage
and AI Service card in AppsPage.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
curo1305
2026-04-14 12:30:45 +02:00
parent 52a2967f61
commit 88c1ea297e
47 changed files with 1354 additions and 497 deletions
@@ -0,0 +1,23 @@
SYSTEM_PROMPT = (
"You are a financial document analysis assistant. "
"Given the text extracted from a PDF document, return ONLY a JSON object "
"with no markdown, no code fences, and no explanation."
)
USER_PROMPT_TEMPLATE = """Analyze the following document text and return a JSON object with exactly these keys:
document_type (one of: invoice, bill, receipt, order, expense, revenue, unknown),
total_amount (string or null),
currency (string or null),
vendor_name (string or null),
customer_name (string or null),
billing_address (string or null),
customer_address (string or null),
invoice_number (string or null),
invoice_date (string or null),
due_date (string or null),
tags (array of short keyword strings describing the document),
line_items (array of objects, each with keys: description, amount),
suggested_categories (array of 2 to 5 short category name strings a user might want to file this document under, e.g. "Utilities", "Travel", "Software Subscriptions", "Client Invoices").
Document text:
{text}"""