feat(azure-ai+gpu-ui): per-tenant Azure AI config + GPU health panel

- Per-tenant Azure AI config stored in tenants.tenant_config JSONB
- GET/PUT /api/tenants/{id}/ai-config + POST .../test connection
- api_key never returned to frontend (has_api_key: bool pattern)
- azure_ai.py resolves creds from tenant config when ai_enabled=True
- ai_tasks.py loads tenant config and passes it to validate_thumbnail
- Admin GPU Status section: probe button + status badge + last-checked time
- Notifications: _BELL_CHANNELS filter (notification+alert only in bell)
- Tenants.tsx: per-row Azure AI Config modal with URL auto-parse helper
- Remove duplicate in-memory /gpu-probe endpoints (kept DB-backed /probe/gpu)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-08 21:04:09 +01:00
parent 34f89cc225
commit 22c29d5655
11 changed files with 792 additions and 24 deletions
+9
View File
@@ -12,6 +12,15 @@ _DEFAULT_TENANT_CONFIG = {
"fallback_material": "SCHAEFFLER_059999_FailedMaterial",
"notifications_enabled": True,
"invoice_prefix": "INV",
# Azure AI validation (per-tenant)
"ai_enabled": False,
"ai_api_key": None, # stored but never returned to frontend
"ai_endpoint": None, # e.g. https://myinstance.openai.azure.com
"ai_deployment": "gpt-4o",
"ai_api_version": "2024-02-01",
"ai_max_tokens": 500,
"ai_temperature": 0.1,
"ai_validation_prompt": None, # None = use DEFAULT_VALIDATION_PROMPT from azure_ai.py
}