Skip to content

fix(clients): thread recall min_scores through the maintained Python SDK wrapper - #2446

Merged
nicoloboschi merged 1 commit into
vectorize-io:mainfrom
r266-tech:fix/recall-min-scores-sdk-wrapper
Jun 30, 2026
Merged

fix(clients): thread recall min_scores through the maintained Python SDK wrapper#2446
nicoloboschi merged 1 commit into
vectorize-io:mainfrom
r266-tech:fix/recall-min-scores-sdk-wrapper

Conversation

@r266-tech

Copy link
Copy Markdown
Contributor

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 public RecallRequest field through recall() / arecall() but has zero references to min_scores, so the most-used surface can't reach the headline feature without dropping down to the raw generated client.

Change

  • Add an optional min_scores: dict[str, float] | None = None to recall() and arecall(), threaded into RecallRequest — mirroring the existing tag_groups dict → from_dict pattern.
  • Unknown keys raise ValueError (e.g. a typo {"sematic": 0.8}) so a misspelled floor fails loud rather than silently applying no filter.
  • Parity test mirrors the existing tests/test_recall_prefer_observations.py (threading, default None, 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.

…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.
@nicoloboschi
nicoloboschi merged commit cce0a2c into vectorize-io:main Jun 30, 2026
83 of 84 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants