49 lines
1.0 KiB
Python
49 lines
1.0 KiB
Python
"""FastAPI application entry point."""
|
|
|
|
import logging
|
|
|
|
from fastapi import FastAPI
|
|
from fastapi.responses import FileResponse
|
|
from fastapi.staticfiles import StaticFiles
|
|
|
|
from app.api.routes import router
|
|
from app.config import settings
|
|
|
|
logging.basicConfig(
|
|
level=logging.INFO,
|
|
format="%(asctime)s [%(name)s] %(levelname)s: %(message)s",
|
|
)
|
|
|
|
app = FastAPI(
|
|
title="咨询报告 AI 生成系统",
|
|
version="0.1.0",
|
|
description="Multi-agent pipeline for generating consulting reports",
|
|
)
|
|
|
|
app.include_router(router)
|
|
|
|
# Serve generated files
|
|
settings.output_dir.mkdir(parents=True, exist_ok=True)
|
|
app.mount("/files", StaticFiles(directory=str(settings.output_dir)), name="files")
|
|
|
|
|
|
@app.get("/")
|
|
async def root():
|
|
return {
|
|
"name": "咨询报告 AI 生成系统",
|
|
"version": "0.1.0",
|
|
"status": "running",
|
|
"docs": "/docs",
|
|
}
|
|
|
|
|
|
if __name__ == "__main__":
|
|
import uvicorn
|
|
|
|
uvicorn.run(
|
|
"app.main:app",
|
|
host=settings.host,
|
|
port=settings.port,
|
|
reload=True,
|
|
)
|