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:
@@ -24,3 +24,25 @@ class TenantOut(BaseModel):
|
||||
created_at: datetime
|
||||
|
||||
model_config = {"from_attributes": True}
|
||||
|
||||
|
||||
class TenantAIConfigUpdate(BaseModel):
|
||||
ai_enabled: bool = False
|
||||
ai_endpoint: str | None = None
|
||||
ai_deployment: str = "gpt-4o"
|
||||
ai_api_version: str = "2024-02-01"
|
||||
ai_api_key: str | None = None # optional — don't require re-entry
|
||||
ai_max_tokens: int = 500
|
||||
ai_temperature: float = 0.1
|
||||
ai_validation_prompt: str | None = None
|
||||
|
||||
|
||||
class TenantAIConfigOut(BaseModel):
|
||||
ai_enabled: bool
|
||||
ai_endpoint: str | None
|
||||
ai_deployment: str
|
||||
ai_api_version: str
|
||||
has_api_key: bool # True if ai_api_key is set — never return the key itself
|
||||
ai_max_tokens: int
|
||||
ai_temperature: float
|
||||
ai_validation_prompt: str | None
|
||||
|
||||
Reference in New Issue
Block a user