Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /GRID-INTELLIGENCE_GRID /src /search /retrieval /base.py
| """Base retriever interface following the GRID-main ABC contract pattern. | |
| Mirrors the dual sync/async convention used by BaseVectorStore, | |
| BaseEmbeddingProvider, and BaseReranker in tools.rag. | |
| """ | |
| from __future__ import annotations | |
| from abc import ABC, abstractmethod | |
| from ..models import ScoredCandidate | |
| class BaseRetriever(ABC): | |
| """Abstract base for all search retrievers.""" | |
| def retrieve( | |
| self, | |
| query_text: str, | |
| n_results: int = 100, | |
| allowed_ids: set[str] | None = None, | |
| ) -> list[ScoredCandidate]: | |
| """Retrieve scored candidates matching the query.""" | |
| pass | |
| async def async_retrieve( | |
| self, | |
| query_text: str, | |
| n_results: int = 100, | |
| allowed_ids: set[str] | None = None, | |
| ) -> list[ScoredCandidate]: | |
| """Async variant. Default delegates to the sync implementation.""" | |
| return self.retrieve(query_text, n_results, allowed_ids) | |
Xet Storage Details
- Size:
- 963 Bytes
- Xet hash:
- 93e160445a47187c2ac7e6dcf80369962c5fbd8c4cf3384ca6b3e94c9d864a43
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.