Spaces:
Sleeping
Sleeping
| """ | |
| Tritan API - AI-Native Workflow Engine | |
| """ | |
| from fastapi import FastAPI | |
| from fastapi.middleware.cors import CORSMiddleware | |
| from api import workflows, execute, planner | |
| app = FastAPI( | |
| title="Tritan API", | |
| description="AI-Native Workflow Engine", | |
| version="0.1.0" | |
| ) | |
| # CORS for frontend (GitHub Pages) | |
| app.add_middleware( | |
| CORSMiddleware, | |
| allow_origins=["*"], # Will restrict to GitHub Pages URL later | |
| allow_credentials=True, | |
| allow_methods=["*"], | |
| allow_headers=["*"], | |
| ) | |
| # Include routers | |
| app.include_router(workflows.router, prefix="/api/workflows", tags=["workflows"]) | |
| app.include_router(execute.router, prefix="/api/execute", tags=["execute"]) | |
| app.include_router(planner.router, prefix="/api/planner", tags=["planner"]) | |
| async def root(): | |
| return { | |
| "name": "Tritan API", | |
| "version": "0.1.0", | |
| "status": "running", | |
| "docs": "/docs" | |
| } | |
| async def health(): | |
| return {"status": "healthy", "version": "0.1.0"} | |