fix: batch missing search embeddings#2041
Draft
RerankerGuo wants to merge 1 commit into
Draft
Conversation
Collaborator
|
Automated Test Results: QUEUED This PR was retargeted to
I will post the final pass/fail result when the run completes. |
Collaborator
|
Automated Test Results: PASSED Cloud test-engine rerun against
Manual code review is still required before merge. |
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.
Description
Related Issue (Required): Fixes #1482
Batches missing embedding backfills during API search MMR deduplication.
SearchHandler._extract_embeddings()previously sent every memory without cached embedding in one embedder call. Providers such as DashScopetext-embedding-v4reject batches larger than 10, so a search result with many missing embeddings could fail during deduplication. This change caps each missing-embedding call at 10 documents while preserving the returned embeddings in the original memory order.No public API, request/response model, OpenAPI, dependency, or database schema changes.
Type of change
How Has This Been Tested?
Commands run:
Result: passed.
Also attempted:
These are blocked in the local environment because
pytestandpoetryare not installed. Direct test-function execution is also blocked becausepydanticis not installed.Checklist