| from fastapi import APIRouter, File, UploadFile, Form |
| from typing import Optional, List |
|
|
| router = APIRouter(prefix="/api/v1", tags=["API v1"]) |
|
|
| @router.post("/classify") |
| async def classify_image(image: UploadFile = File(...)): |
| return {"endpoint": "classify", "filename": image.filename} |
|
|
| @router.post("/search") |
| async def search_similar(image: UploadFile = File(...), limit: int = Form(10)): |
| return {"endpoint": "search", "limit": limit} |
|
|
| @router.get("/trends") |
| async def get_trends(category: Optional[str] = None): |
| return {"endpoint": "trends", "category": category} |