35 lines
786 B
Python
35 lines
786 B
Python
"""API for AIOS change governance dashboard."""
|
|
|
|
from typing import Any
|
|
|
|
try:
|
|
from fastapi import APIRouter
|
|
except Exception:
|
|
APIRouter = None
|
|
|
|
from .change_governance_dashboard import ChangeGovernanceDashboard
|
|
|
|
|
|
dashboard = ChangeGovernanceDashboard()
|
|
|
|
|
|
def get_change_governance_overview(changes: list[dict[str, Any]] | None = None):
|
|
return dashboard.overview(changes)
|
|
|
|
|
|
def build_router():
|
|
if APIRouter is None:
|
|
return None
|
|
router = APIRouter(prefix="/admin/ai-evolution/governance", tags=["change-governance"])
|
|
|
|
@router.get("/overview", operation_id="getChangeGovernanceOverview")
|
|
def overview():
|
|
return get_change_governance_overview()
|
|
|
|
return router
|
|
|
|
|
|
router = build_router()
|
|
|
|
__all__ = ["router", "get_change_governance_overview"]
|