feat(embedding): combine document embedder and query embedder to avoi…#702
Merged
ZaynJarvis merged 1 commit intovolcengine:mainfrom Mar 17, 2026
Merged
Conversation
|
xiaogang.zhou 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. |
ZaynJarvis
reviewed
Mar 17, 2026
ZaynJarvis
reviewed
Mar 17, 2026
ZaynJarvis
reviewed
Mar 17, 2026
15d60a3 to
84d1043
Compare
Contributor
Author
现在看起来这个context使得整个逻辑有点复杂,其实只需要判断有没有设置query params以及是不是query就可以了,不必实现两套,略显冗余 |
ZaynJarvis
reviewed
Mar 17, 2026
| "query_task", | ||
| "document_task", | ||
| ): | ||
| for key in ("query_value", "document_value", "query_task", "document_task"): |
Collaborator
There was a problem hiding this comment.
这里可能要改成 query_param document_param
84d1043 to
776fb7f
Compare
ZaynJarvis
added a commit
to ZaynJarvis/OpenViking
that referenced
this pull request
Mar 17, 2026
ZaynJarvis
added a commit
to ZaynJarvis/OpenViking
that referenced
this pull request
Mar 17, 2026
776fb7f to
27c4971
Compare
ZaynJarvis
added a commit
to ZaynJarvis/OpenViking
that referenced
this pull request
Mar 17, 2026
Clean implementation on latest main (post PR volcengine#702 merge): - Add _parse_param_string() method for key=value parsing - Enhance _build_extra_body() to support multiple parameters - Maintain backward compatibility with simple string format - Update docstrings and examples Usage: - Simple: query_param='query' → {'input_type': 'query'} - Enhanced: query_param='input_type=query,task=search' → {'input_type': 'query', 'task': 'search'} Supports OpenAI-compatible servers with custom parameters while maintaining clean integration with PR volcengine#702's is_query API.
4 tasks
qin-ctx
pushed a commit
that referenced
this pull request
Mar 18, 2026
* feat: add key=value parameter parsing to OpenAI embedder Clean implementation on latest main (post PR #702 merge): - Add _parse_param_string() method for key=value parsing - Enhance _build_extra_body() to support multiple parameters - Maintain backward compatibility with simple string format - Update docstrings and examples Usage: - Simple: query_param='query' → {'input_type': 'query'} - Enhanced: query_param='input_type=query,task=search' → {'input_type': 'query', 'task': 'search'} Supports OpenAI-compatible servers with custom parameters while maintaining clean integration with PR #702's is_query API. * fix: lint issues
11 tasks
chethanuk
added a commit
to chethanuk/OpenViking
that referenced
this pull request
Mar 20, 2026
…ngine#702 pattern - GeminiDenseEmbedder: accept query_param/document_param, use is_query in embed() and embed_batch() to select task_type at call time - EmbeddingConfig: add Gemini provider, factory, validation, dimension - No get_query_embedder/get_document_embedder/_get_contextual_embedder (removed in volcengine#702; embed(is_query=True/False) is the pattern) - Tests use embed(text, is_query=True/False) pattern throughout - Rebased onto current upstream/main
ZaynJarvis
pushed a commit
that referenced
this pull request
Mar 20, 2026
* feat(gemini): add GeminiDenseEmbedder with is_query routing per #702 pattern - GeminiDenseEmbedder: accept query_param/document_param, use is_query in embed() and embed_batch() to select task_type at call time - EmbeddingConfig: add Gemini provider, factory, validation, dimension - No get_query_embedder/get_document_embedder/_get_contextual_embedder (removed in #702; embed(is_query=True/False) is the pattern) - Tests use embed(text, is_query=True/False) pattern throughout - Rebased onto current upstream/main * fix(gemini): remove task_type config field, fix conditional import for CI - Remove task_type from EmbeddingModelConfig (query_param/document_param suffice) - Wrap GeminiDenseEmbedder import in try/except (google-genai is optional) - Update tests for removed field
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.
…d complexity
Description
本次变更主要对 Embedder 模块进行了重构,简化了非对称嵌入(Asymmetric Embedder)的实现逻辑,移除了冗余代码,使代码结构更加清晰。
Related Issue
Type of Change
Changes Made
Testing
Checklist
Screenshots (if applicable)
Additional Notes