feat(embedding): surface non-symmetric embedding config for VikingDB provider#1110
Open
mvanhorn wants to merge 1 commit intovolcengine:mainfrom
Open
feat(embedding): surface non-symmetric embedding config for VikingDB provider#1110mvanhorn wants to merge 1 commit intovolcengine:mainfrom
mvanhorn wants to merge 1 commit intovolcengine:mainfrom
Conversation
…provider VikingDB embedders accepted is_query but ignored it. Now VikingDBDenseEmbedder and VikingDBHybridEmbedder accept query_param/document_param and pass input_type to the API when non-symmetric mode is configured. - Add query_param/document_param to VikingDB Dense and Hybrid constructors - Add _resolve_input_type() to select query vs document param - Pass input_type in _call_api data items when set - Wire factory entries to pass config params through - Sparse embedder unchanged (sparse models are symmetric) Closes volcengine#655 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Matt Van Horn seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
|
Failed to generate code suggestions for 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.
Problem Statement
Non-symmetric embedding uses different representations for queries vs documents, improving retrieval quality for models that support it. The OpenAI, Gemini, Jina, and Minimax embedders already support
query_param/document_paraminov.conf. The VikingDB embedder acceptsis_querybut ignores it -- all calls use symmetric mode regardless of config.Closes #655.
Changes
VikingDBDenseEmbedder: acceptquery_param/document_param, passinput_typeto API data itemsVikingDBHybridEmbedder: same treatmentVikingDBClientMixin._call_api(): accept optionalinput_type, add to request data items when setquery_param/document_paramfrom config to VikingDB embedder constructorsConfig Example
When configured, retrieval calls
embed(text, is_query=True)which passesinput_type=queryin the API request. Indexing callsembed(text, is_query=False)which passesinput_type=passage.When not configured, behavior is unchanged (symmetric mode, no
input_typein request).Testing
4 unit tests:
_resolve_input_typereturns None in symmetric mode_resolve_input_typereturns correct param for query vs documentImplementation Notes
openai_embedders.py:213-216_resolve_input_type()is a shared helper on Dense and Hybrid embeddersHierarchicalRetrieveralready passesis_query=Truefor queries (line 132), so this works end-to-end once configuredFeature Area
Retrieval/Search
This contribution was developed with AI assistance (Claude Code).