from fastapi import FastAPI
from .api.endpoints import router as api_router
from .core.fastgpt_client import lifespan
from .core.logging_config import setup_logging
from .voice.routes import register_voice

# Setup logging first
setup_logging()

app = FastAPI(
    title="AI Accident Information Collection API",
    description="AI Accident Information Collection API",
    version="1.0.0",
    lifespan=lifespan
)

@app.get("/")
def read_root():
    return {"message": "Server is running."}

app.include_router(api_router)
register_voice(app)