| | |
| | | from urllib.parse import quote |
| | | from typing import Optional |
| | | |
| | | from fastapi import APIRouter, BackgroundTasks, HTTPException, Query |
| | | from fastapi import APIRouter, BackgroundTasks, HTTPException, Query, Response |
| | | from fastapi.responses import HTMLResponse, StreamingResponse |
| | | |
| | | from api.schemas.pipelines import ( |
| | |
| | | |
| | | @router.get("/api/models") |
| | | async def get_api_models( |
| | | response: Response, |
| | | media_type: Optional[str] = Query(None, pattern="^(image|video)$"), |
| | | model_type: Optional[str] = Query(None, pattern="^(llm|vlm|t2i|i2i|video)$"), |
| | | ability: Optional[str] = Query(None), |
| | | verified_only: bool = False, |
| | | ): |
| | | response.headers["Cache-Control"] = "no-cache, no-store, must-revalidate" |
| | | if model_type: |
| | | models = [] |
| | | for model in get_models_by_type(model_type): |