-
-
Notifications
You must be signed in to change notification settings - Fork 7.8k
fix(volcengine): support multimodal embedding models #4998
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
rangerTao
wants to merge
2
commits into
QuantumNous:main
Choose a base branch
from
rangerTao:pr/volcengine-multimodal-embedding
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+46
−0
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: QuantumNous/new-api
Length of output: 45
🌐 Web query:
Do OpenAI, Anthropic, or other major LLM providers support typed-parts input format [{type:"text", text:"..."}] for multimodal embedding requests?💡 Result:
As of May 20, 2026, support for the specific typed-parts input format [{type: "text", text: "..."},...] varies significantly among major LLM providers [1][2][3]. Google Gemini API The Gemini API uses a native multimodal structure that supports the requested format for embedding requests. Specifically, the Gemini Embedding 2 model accepts a content structure consisting of parts [3][4]. Users can pass multiple input types (text, images, etc.) within the parts array of a Content object to generate an aggregated embedding [3]: { "model": "models/gemini-embedding-2", "content": { "parts": [ {"text": "Your text here"}, {"inlineData": {"mimeType": "image/jpeg", "data": "..."}} ] } } OpenAI API OpenAI's official Embeddings API does not support a multimodal typed-parts format [1][5]. The input parameter for the embeddings endpoint is strictly limited to a string, an array of strings, or an array of token integers [1]. While OpenAI supports multimodal inputs (like images and text) in their Chat Completions API (using the same typed-parts format you referenced), this format is not compatible with their dedicated embedding endpoints [1][5][6]. Anthropic API Anthropic's Claude API does not currently offer a standalone multimodal embedding endpoint that supports a typed-parts input format [2]. While Anthropic's Messages API uses the [{type: "text", text: "..."}, {type: "image",...}] format for chat interactions [7][6], it does not provide native support for embedding requests in this format [2][8]. Users seeking multimodal embeddings typically rely on third-party models or specialized services like Voyage AI, which also use standard input arrays rather than the typed-parts block format for their embedding endpoints [2].
Citations:
🏁 Script executed:
Repository: QuantumNous/new-api
Length of output: 308
🏁 Script executed:
Repository: QuantumNous/new-api
Length of output: 421
🏁 Script executed:
Repository: QuantumNous/new-api
Length of output: 1811
🏁 Script executed:
Repository: QuantumNous/new-api
Length of output: 7110
🏁 Script executed:
Repository: QuantumNous/new-api
Length of output: 4068
🏁 Script executed:
Repository: QuantumNous/new-api
Length of output: 874
🏁 Script executed:
Repository: QuantumNous/new-api
Length of output: 1062
🏁 Script executed:
Repository: QuantumNous/new-api
Length of output: 173
🏁 Script executed:
Repository: QuantumNous/new-api
Length of output: 2363
🏁 Script executed:
Repository: QuantumNous/new-api
Length of output: 2263
🏁 Script executed:
Repository: QuantumNous/new-api
Length of output: 872
🏁 Script executed:
Repository: QuantumNous/new-api
Length of output: 3397
🏁 Script executed:
Repository: QuantumNous/new-api
Length of output: 2395
🏁 Script executed:
Repository: QuantumNous/new-api
Length of output: 346
Scope the multimodal typed-parts format to Volcengine only.
This logic emits the typed-parts input shape
[{type:"text", text:"hello world"}]for ANY embedding model containing "vision" or "multimodal, regardless of channel type. While this format is correct for Volcengine's/api/v3/embeddings/multimodalendpoint, it is Volcengine-specific and would break other providers if they add multimodal embedding models in the future. For example, Gemini has embedding models and uses a completely different input structure ({content: {parts: [{text: "..."}]}}`); applying the Volcengine format to a future Gemini multimodal embedding model would cause failures.The
channelparameter is available in this function and is already used elsewhere in the file. Add a channel-type check to limit this behavior to Volcengine:Suggested fix
🤖 Prompt for AI Agents