Repository navigation
Conversation
There was a problem hiding this comment.
Orca Security Scan Summary
| Status | Check | Issues by priority | |
|---|---|---|---|
| Secrets | View in Orca |
c2d2b86 to
ff535fe
Compare
941bd58 to
933bcc4
Compare
rerank=Decide(prop, query, min_probability, order) sends the question to the collection's decisions module: the probability is the rerank score, candidates below min_probability are dropped and order keeps the search order or sorts by probability. An option left unset takes the class setting. rerank=Rerank(...) keeps going to the reranker, or to the decisions module as a relevance predicate when the collection has no reranker. The gRPC stubs carry the new Rerank.decision sub-message.
Rerank leaves the query optional for the reranker; a decision has nothing to judge without one, and the server only fails after the search.
933bcc4 to
7cc18b0
Compare
ff535fe to
b8cc752
Compare
The server would run the search and then fail with 'no query provided'.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## jose/decisions-openai #2198 +/- ##
========================================================
Coverage ? 88.78%
========================================================
Files ? 310
Lines ? 24807
Branches ? 0
========================================================
Hits ? 22024
Misses ? 2783
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The rerank argument keeps the Rerank namespace: Rerank(prop, query) goes to the reranker, Rerank.decide(prop, query, min_probability, order) to the decisions module. The Decide class and DecideOrder are gone; the order enum is RerankOrder, as in the proto.
…uilt The user sees the factory's name in the error, not the private class. RerankOrder is a BaseEnum like the other enums; the Rerank docstring names the decisions-module fallback; a mock test sends the order as a string.
There was a problem hiding this comment.
🟡 Changes recommended
The public order type annotation excludes the supported raw-string enum values.
1 open finding
What changed in this PR
Adds decision-model reranking through Rerank.decide, including validation, gRPC serialization, exports, documentation, and tests.
Changes:
- Adds
RerankOrderand theRerank.decidefactory. - Regenerates protobuf bindings with decision-reranking fields.
- Adds mock and integration coverage.
| File | Description |
|---|---|
weaviate/proto/v1/v6300/v1/search_get_pb2.pyi |
Adds decision-reranking types. |
weaviate/proto/v1/v6300/v1/search_get_pb2.py |
Updates generated descriptors. |
weaviate/proto/v1/v5261/v1/search_get_pb2.pyi |
Adds decision-reranking types. |
weaviate/proto/v1/v5261/v1/search_get_pb2.py |
Updates generated descriptors. |
weaviate/proto/v1/v4216/v1/search_get_pb2.pyi |
Adds decision-reranking types. |
weaviate/proto/v1/v4216/v1/search_get_pb2.py |
Updates generated descriptors. |
weaviate/collections/grpc/query.py |
Serializes decision rerank options. |
weaviate/collections/classes/internal.py |
Corrects decision terminology. |
weaviate/collections/classes/grpc.py |
Defines the public rerank API. |
weaviate/collections/classes/config.py |
Updates decisions configuration documentation. |
weaviate/classes/query.py |
Exports RerankOrder. |
mock_tests/test_decisions.py |
Tests validation and request serialization. |
integration/test_collection_decisions.py |
Tests end-to-end decision reranking. |
Files not reviewed (3)
- weaviate/proto/v1/v4216/v1/search_get_pb2.py: Generated file
- weaviate/proto/v1/v5261/v1/search_get_pb2.py: Generated file
- weaviate/proto/v1/v6300/v1/search_get_pb2.py: Generated file
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| query: str, | ||
| *, | ||
| min_probability: Optional[float] = None, | ||
| order: Optional[RerankOrder] = None, |
DecisionsOrder is the order a decisions module reranks in: the class default of Configure.Decisions.* and the override of Rerank.decide take the same enum, exported from classes.config and classes.query. RerankOrder is gone: it read as an option of every reranker. The type a Decision.* factory returns is DecisionQuestion, as its answer is DecisionAnswer. The question setting of Configure.Decisions.openai is gone with the server's: a plain Rerank asks relevance, Rerank.decide sends the statement.
…op the question setting test/collection/test_config.py still imported DecisionsQuestion and failed at collection. Rerank.decide now accepts a DecisionsOrder or its value and raises WeaviateInvalidInputError for anything else, as it does for a blank query.
There was a problem hiding this comment.
🟡 Changes recommended
The public order type annotation rejects the documented and supported string values.
2 open findings
Files not reviewed (3)
- weaviate/proto/v1/v4216/v1/search_get_pb2.py: Generated file
- weaviate/proto/v1/v5261/v1/search_get_pb2.py: Generated file
- weaviate/proto/v1/v6300/v1/search_get_pb2.py: Generated file
🧠 Review effort: Balanced
| query: str, | ||
| *, | ||
| min_probability: Optional[float] = None, | ||
| order: Optional[DecisionsOrder] = None, |

What
rerank=Rerank.decide(...): rerank by a decision model (server: weaviate/weaviate#13528 and the RFC section "rerank with a decision model"). The collection's decisions module answers the query as a yes/no question about every candidate; the probability ismetadata.rerank_score, candidates belowmin_probabilityare dropped andorderkeeps the search order or sorts by probability.min_probabilityandorderare optional; an option left unset takes the class setting (min_probability,orderofConfigure.Decisions.*).rerank=Rerank(...)keeps going to the collection's reranker, or to the decisions module as a relevance predicate when there is no reranker.rerank=Rerank.decide(...)on a collection without a decisions module is a server error. The page can hold fewer objects thanlimit: the model only removes candidates.The gRPC stubs are regenerated with the
Rerank.decisionsub-message.The rerank argument keeps the
Reranknamespace (review of 2026-10-14):Rerank(prop, query)for a reranker,Rerank.decide(prop, query, min_probability, order)for a decision model. The factory returns a private subclass ofRerank, so everyrerank: Optional[Rerank]signature accepts it;orderis aDecisionsOrder, the same enumConfigure.Decisions.*takes for the class default (exported fromclasses.configandclasses.query), or its value. There is noRerankOrder: the option belongs to the decisions module, not to every reranker. The typeDecision.predicate/choice/scorereturn isDecisionQuestion, as its answer isDecisionAnswer(renamed fromDecideQuestionhere). Thequestionsetting ofConfigure.Decisions.openaiis gone with the server's (weaviate/weaviate#13534): a plainRerank(...)asks relevance,Rerank.decide(...)sends the statement.Tests
decisionwith the set fields only; a plainRerankcarries none;min_probabilityout of[0, 1]and a blank query are rejected client-side;ordergiven as a string is sent as the enum.decisions-dummy, skips without it): class defaults, threshold, order by probability, the plain rerank fallback, class settings overridden by the request, the error on a reranker-only collection, and a collection with both a reranker and a decisions module.Stacked on #2189.