- новый api/: /pipeline/process (yt-dlp, субтитры или Vosk, LLM/экстрактивная суммаризация), /videos, /llm; старый код перенесён в api_legacy/ - web/: Flet UI (flet 0.28.3 + flet-web, порт 8550) - Dockerfile.api: ffmpeg слоем из mwader/static-ffmpeg, pip с кэш-маунтом - requirements/pyproject: убраны moviepy, imageio-ffmpeg, битый asyncio - README с инструкцией запуска и загрузкой Vosk-модели Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
29 lines
637 B
Python
29 lines
637 B
Python
import logging
|
|
from contextlib import asynccontextmanager
|
|
|
|
from fastapi import FastAPI
|
|
|
|
from api.db.connection import wait_for_postgres, init_db
|
|
from api.route import default, llm, pipeline, videos
|
|
|
|
|
|
logging.basicConfig(
|
|
level=logging.INFO,
|
|
format="%(asctime)s %(levelname)s %(name)s: %(message)s",
|
|
)
|
|
|
|
|
|
@asynccontextmanager
|
|
async def lifespan(app: FastAPI):
|
|
await wait_for_postgres()
|
|
await init_db()
|
|
yield
|
|
|
|
|
|
app = FastAPI(title="LLM-infa API", version="0.3.0", lifespan=lifespan)
|
|
|
|
app.include_router(default.router)
|
|
app.include_router(pipeline.router)
|
|
app.include_router(videos.router)
|
|
app.include_router(llm.router)
|