File size: 383 Bytes
36ed17a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from fastapi import FastAPI
from app.api import chat
from app.db.database import Base, engine  # Import Base and engine for table creation

app = FastAPI()


# Create tables on startup
@app.on_event("startup")
async def startup():
    async with engine.begin() as conn:
        await conn.run_sync(Base.metadata.create_all)


# Include the chat route
app.include_router(chat.router)