fix: add mode field to FindRequest and thread it through to retrieval#2347
Open
mvanhorn wants to merge 1 commit into
Open
fix: add mode field to FindRequest and thread it through to retrieval#2347mvanhorn wants to merge 1 commit into
mvanhorn wants to merge 1 commit into
Conversation
The /api/v1/search/find endpoint advertised a mode parameter (auto/fast/deep) in client tool schemas, but FindRequest had no mode field, so Pydantic's extra='ignore' silently dropped any client-supplied mode before it reached retrieval. Add a validated mode field (default auto) and translate it to the existing RetrieverMode: auto preserves current behavior (no mode forwarded), fast maps to QUICK to skip rerank, and deep maps to THINKING to force it. The mode is threaded through service.search.find() and VikingFS.find() only when non-auto, so existing callers are unaffected. Fixes volcengine#2256
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨No code suggestions found for the PR. |
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
The
/api/v1/search/findendpoint advertises amodeparameter (auto/fast/deep) in client tool schemas, butFindRequesthad nomodefield. Because Pydantic defaults toextra='ignore', a client-suppliedmodewas silently dropped before reachingservice.search.find()/VikingFS.find(), even thoughHierarchicalRetrieveralready has an internalRetrieverModethat gates rerank.This adds a validated
modefield and threads it through to retrieval, so callers can control rerank cost.Related Issue
Fixes #2256
Type of Change
Changes Made
modefield (auto/fast/deep, defaultauto) toFindRequest.RetrieverMode(fast->QUICKto skip rerank,deep->THINKINGto force it) and thread it throughservice.search.find()andVikingFS.find()toHierarchicalRetriever.auto, soautopreserves today's exact behavior and existing callers are unaffected.Testing
Tests cover request-mode validation/mapping, the
autodefault no-op, service pass-through, and retriever pass-through (tests/misc/test_vikingfs_find_without_rerank.py, 10 passed).Checklist
Additional Notes
autoforwards no mode, so the retriever's default behavior is unchanged for existing callers. TheRetrieverModeimport is local to the mapping helper to avoid a module-level dependency from the router on the retriever package.