Spaces:
Paused
Paused
| 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() | |
| 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)) | |