Version: 0.0.4
agrag.common.validation.require_valid_search_limit
require_valid_search_limit(limit:int) -> None
Check that a search/hybrid_search limit is usable across every backend.
Backends fail differently outside this range: Milvus raises for a
non-positive limit or one above MAX_SEARCH_LIMIT (its own
query/search result-window ceiling), while Qdrant and Weaviate may
instead return an empty or silently truncated result. Enforcing the
tightest bound uniformly means a given limit either works, or fails
the same way, regardless of which backend is configured.
Parameters:
- limit (
int) – The requested maximum number of hits.
Raises:
ValueError–limitis not a positive integer, or exceedsMAX_SEARCH_LIMIT.