Skip to content

Commit e29038a

Browse files
committed
FIx docstrings
1 parent dab0ced commit e29038a

3 files changed

Lines changed: 14 additions & 6 deletions

File tree

weaviate/collections/classes/grpc.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -617,9 +617,13 @@ def blend(
617617
class MMR:
618618
"""Define MMR (Maximal Marginal Relevance) diversity selection.
619619
620+
Not supported for multi-vector indexes.
621+
620622
Args:
621-
limit: Optional number of candidates to consider for diversification.
622-
balance: Optional MMR lambda in [0.0, 1.0] — 1.0 is pure relevance, 0.0 is pure diversity.
623+
limit: Number of objects to select. The server requires it: it must be at least 1 and
624+
no larger than the query's own `limit` when one is set.
625+
balance: Optional MMR lambda in [0.0, 1.0]. 1.0 ranks purely by relevance to the query,
626+
0.0 purely by dissimilarity to the objects already selected.
623627
"""
624628

625629
limit: Optional[int] = None
@@ -636,9 +640,13 @@ def __init__(self) -> None:
636640
def mmr(limit: Optional[int] = None, balance: Optional[float] = None) -> MMR:
637641
"""Maximal Marginal Relevance diversity selection.
638642
643+
Not supported for multi-vector indexes.
644+
639645
Args:
640-
limit: Number of candidates to consider for diversification.
641-
balance: MMR lambda in [0.0, 1.0] — 1.0 pure relevance, 0.0 pure diversity.
646+
limit: Number of objects to select. The server requires it: it must be at least 1
647+
and no larger than the query's own `limit` when one is set.
648+
balance: MMR lambda in [0.0, 1.0]. 1.0 ranks purely by relevance to the query,
649+
0.0 purely by dissimilarity to the objects already selected.
642650
"""
643651
return MMR(limit=limit, balance=balance)
644652

weaviate/collections/queries/hybrid/generate/executor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ def hybrid(
491491
group_by: How the results should be grouped by a specific property.
492492
rerank: How the results should be reranked. NOTE: A `rerank-*` module must be enabled for this functionality to work.
493493
boost: A `Boost` that re-scores the search candidates to promote or demote objects without removing them.
494-
diversity_selection: An `MMR` selection applied to the fused results to diversify the returned objects.
494+
diversity_selection: An `MMR` selection applied to the fused results to diversify the returned objects. Requires Weaviate >= 1.38.6.
495495
target_vector: The name of the vector space to search in for named vector configurations. Required if multiple spaces are configured.
496496
include_vector: Whether to include the vector in the results. If not specified, this is set to False.
497497
return_metadata: The metadata to return for each object, defaults to `None`.

weaviate/collections/queries/hybrid/query/executor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ def hybrid(
427427
group_by: How the results should be grouped by a specific property.
428428
rerank: How the results should be reranked. NOTE: A `rerank-*` module must be enabled for this functionality to work.
429429
boost: A `Boost` that re-scores the search candidates to promote or demote objects without removing them.
430-
diversity_selection: An `MMR` selection applied to the fused results to diversify the returned objects.
430+
diversity_selection: An `MMR` selection applied to the fused results to diversify the returned objects. Requires Weaviate >= 1.38.6.
431431
target_vector: The name of the vector space to search in for named vector configurations. Required if multiple spaces are configured.
432432
include_vector: Whether to include the vector in the results. If not specified, this is set to False.
433433
return_metadata: The metadata to return for each object, defaults to `None`.

0 commit comments

Comments
 (0)