fix(clients): thread recall min_scores through the maintained Python SDK wrapper - #2446
Merged
nicoloboschi merged 1 commit intoJun 30, 2026
Conversation
…SDK wrapper vectorize-io#2422 added the public RecallRequest.min_scores (per-stage score floors) to the HTTP/MCP API and the generated clients, but the hand-maintained high-level Python wrapper (hindsight_client.recall/arecall) never got it, so high-level SDK users can't use the feature without dropping to the raw generated client. Thread an optional min_scores dict through recall()/arecall() into RecallRequest, mirroring the existing tag_groups dict->from_dict pattern. Unknown keys raise ValueError so a misspelled floor fails loud instead of silently applying no filter. Parity test mirrors tests/test_recall_prefer_observations.py. Follow-up to vectorize-io#2422.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #2422, which added
RecallRequest.min_scores(two-level retrieval/post-query score floors) to the HTTP/MCP API and the generated clients — but the hand-maintained high-level Python wrapper never got it.hindsight-clients/python/hindsight_client/hindsight_client.py(header: "This file is MAINTAINED and NOT auto-generated") threads every other publicRecallRequestfield throughrecall()/arecall()but has zero references tomin_scores, so the most-used surface can't reach the headline feature without dropping down to the raw generated client.Change
min_scores: dict[str, float] | None = Nonetorecall()andarecall(), threaded intoRecallRequest— mirroring the existingtag_groupsdict →from_dictpattern.ValueError(e.g. a typo{"sematic": 0.8}) so a misspelled floor fails loud rather than silently applying no filter.tests/test_recall_prefer_observations.py(threading, defaultNone, and unknown-key rejection).No codegen and no behavior change for callers who don't pass
min_scores.The TypeScript wrapper (
typescript/src/index.ts) has the same gap; happy to send a follow-up there if you'd like it in this PR.