teoat's picture
Upload folder using huggingface_hub
4ae946d verified
from fastapi import APIRouter, Depends, HTTPException
from app.modules.auth.service import auth_service
from core.database import User
from .service import search_service
router = APIRouter()
@router.post("")
async def global_search(
query: str,
limit: int = 20,
current_user: User = Depends(auth_service.get_current_user),
):
"""Unified search endpoint"""
try:
results = await search_service.semantic_search(query, limit)
return {"query": query, "results": results}
except Exception as e:
raise HTTPException(status_code=500, detail=str(e))