Spaces:
Sleeping
Sleeping
| from __future__ import annotations | |
| from fastmcp import FastMCP | |
| from services.search_service import QdrantSearchService | |
| def register(mcp: FastMCP) -> None: | |
| search_service = QdrantSearchService() | |
| def semantic_candidate_search(query: str, top_k: int = 5) -> dict: | |
| """Search candidates semantically from Qdrant and return GenUI-ready payloads.""" | |
| rows = search_service.semantic_search(query=query, top_k=top_k) | |
| if not rows: | |
| return { | |
| "status": "no_results", | |
| "message": "No semantic matches found. Ensure resumes are ingested and Qdrant is configured.", | |
| "ui": {"summary": "No candidate results", "cards": []}, | |
| } | |
| return { | |
| "status": "success", | |
| "count": len(rows), | |
| "matches": rows, | |
| "ui": search_service.build_genui_payload(query=query, rows=rows), | |
| } | |