Files
---/app/main.py
2025-12-06 15:12:19 +03:00

27 lines
935 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
from fastapi import FastAPI, Request
from fastapi.staticfiles import StaticFiles
from fastapi.templating import Jinja2Templates
from app.api import chat
from app.models.schemas import AgentOption
app = FastAPI(title="SwarmMind Multi-Agent Chat")
app.mount("/static", StaticFiles(directory="app/static"), name="static")
templates = Jinja2Templates(directory="app/templates")
# ------------------------------------------------------------------ #
# UI
# ------------------------------------------------------------------ #
@app.get("/")
async def root(request: Request):
agents = [opt.value for opt in AgentOption]
return templates.TemplateResponse(
"index.html",
{"request": request, "agents": agents},
)
# ------------------------------------------------------------------ #
# API
# ------------------------------------------------------------------ #
app.include_router(chat.router, prefix="/api")