Spaces:
Running
Running
Bader Alabddan
Add core implementation: API, registry, audit, Docker config, and quickstart guide
8036886
| """Main FastAPI application.""" | |
| from fastapi import FastAPI | |
| from fastapi.middleware.cors import CORSMiddleware | |
| from .core.config import settings | |
| from .core.registry import CapabilityRegistry | |
| from .api import capabilities, health | |
| app = FastAPI( | |
| title=settings.app_name, | |
| version=settings.app_version, | |
| description="Enterprise AI Governance Framework for Insurance" | |
| ) | |
| # CORS | |
| app.add_middleware( | |
| CORSMiddleware, | |
| allow_origins=["*"], | |
| allow_credentials=True, | |
| allow_methods=["*"], | |
| allow_headers=["*"], | |
| ) | |
| # Initialize registry | |
| registry = CapabilityRegistry() | |
| # Include routers | |
| app.include_router(health.router, prefix=settings.api_prefix, tags=["health"]) | |
| app.include_router(capabilities.router, prefix=settings.api_prefix, tags=["capabilities"]) | |
| async def startup_event(): | |
| """Startup tasks.""" | |
| print(f"Starting {settings.app_name} v{settings.app_version}") | |
| print(f"Loaded {len(registry.capabilities)} capabilities") | |
| async def shutdown_event(): | |
| """Shutdown tasks.""" | |
| print("Shutting down BDR Agent Factory") | |