gg
This commit is contained in:
27
app/main.py
Normal file
27
app/main.py
Normal file
@@ -0,0 +1,27 @@
|
||||
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")
|
||||
Reference in New Issue
Block a user