docs: improve Boost API docstrings (consistency, clarity, accuracy)#2057
Conversation
Polish the docstrings for the Boost API (the Boost class, its factory methods, the Curve/Modifier enums, and the boost= parameter): - Document the boost= parameter in the Args of all 14 query and generate methods (hybrid, near_text, near_object, near_vector, near_image, near_media, bm25). It was present in every signature but documented in none. - Correct the documented defaults and semantics to match server behavior: weight (blend weight in [0, 1], default 0.5, (1 - weight)*primary + weight*boost, 0 is a no-op), depth (the overfetched candidate pool, default 100), curve (default exp), decay value (range (0, 1], default 0.5), offset (default 0), and blend's per-condition weight (default 1.0, may be negative) plus the 20-condition cap. - Unify terminology and add Attributes blocks describing the Curve and Modifier enum members. Docstrings only -- no API or behavior changes. Defaults verified against the server implementation. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Orca Security Scan Summary
| Status | Check | Issues by priority | |
|---|---|---|---|
| Secrets | View in Orca |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev/1.38 #2057 +/- ##
===========================================
Coverage ? 86.60%
===========================================
Files ? 300
Lines ? 23129
Branches ? 0
===========================================
Hits ? 20031
Misses ? 3098
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Replace flowery phrasing ("span many orders of magnitude",
"long-tail dampening") with plain language describing what the
LOG1P/SQRT modifiers do.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Keep the boost= Args entry to a single sentence. The Boost factory methods (filter/time_decay/numeric_decay/numeric_property/blend) are already listed on the Boost class docstring, so repeating them on all 14 query/generate executors was redundant. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This pull request improves the Python client’s Boost API documentation to make the boost= query/generate parameter discoverable and to clarify Boost behavior (semantics, defaults, and terminology) without changing any runtime behavior. It updates docstrings across the query executors and the Boost-related enums/factories in weaviate/collections/classes/grpc.py.
Changes:
- Documented
boost=in theArgs:section for the relevant query and generate executor methods. - Expanded and clarified Boost API docstrings in
weaviate/collections/classes/grpc.py, includingCurve/Modifierenum attribute descriptions and more explicit parameter semantics.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| weaviate/collections/queries/near_vector/query/executor.py | Adds boost to the near_vector query method docstring args. |
| weaviate/collections/queries/near_vector/generate/executor.py | Adds boost to the near_vector generate method docstring args. |
| weaviate/collections/queries/near_text/query/executor.py | Adds boost to the near_text query method docstring args. |
| weaviate/collections/queries/near_text/generate/executor.py | Adds boost to the near_text generate method docstring args. |
| weaviate/collections/queries/near_object/query/executor.py | Adds boost to the near_object query method docstring args. |
| weaviate/collections/queries/near_object/generate/executor.py | Adds boost to the near_object generate method docstring args. |
| weaviate/collections/queries/near_media/query/executor.py | Adds boost to the near_media query method docstring args. |
| weaviate/collections/queries/near_media/generate/executor.py | Adds boost to the near_media generate method docstring args. |
| weaviate/collections/queries/near_image/query/executor.py | Adds boost to the near_image query method docstring args. |
| weaviate/collections/queries/near_image/generate/executor.py | Adds boost to the near_image generate method docstring args. |
| weaviate/collections/queries/hybrid/query/executor.py | Adds boost to the hybrid query method docstring args. |
| weaviate/collections/queries/hybrid/generate/executor.py | Adds boost to the hybrid generate method docstring args. |
| weaviate/collections/queries/bm25/query/executor.py | Adds boost to the bm25 query method docstring args. |
| weaviate/collections/queries/bm25/generate/executor.py | Adds boost to the bm25 generate method docstring args. |
| weaviate/collections/classes/grpc.py | Expands Boost-related docstrings for clarity/consistency, including Curve/Modifier enum docs and Boost factory method docs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
What
Improves the docstrings for the Boost API (added in #2030) for consistency, clarity, and factual accuracy. Docstrings only — no signature or behavior changes. Targets
dev/1.38since the Boost surface lives there.Changes
boost=is now documented in theArgs:of all 14 query + generate methods (hybrid,near_text,near_object,near_vector,near_image,near_media,bm25). It was present in every signature but documented in none.weight: blend weight in[0, 1], default0.5; final score= (1 - weight)·primary + weight·boost;0is a no-opdepth: the candidate pool the primary search overfetches and re-sorts, default100curvedefaults toexp;decayvalue range(0, 1], default0.5;offsetdefault0blend: per-condition weight default1.0(may be negative to demote); max20conditionsrerank=feature) and addedAttributes:blocks for theCurveandModifierenums.Verification
All documented defaults, the blend formula, the 20-condition cap, and the
filter()operator allowlist were verified against the server implementation.python -m py_compilepasses on all edited files.🤖 Generated with Claude Code