fix: volcanic engine embedding endpoint (ep-xxx-xx) not working with multimodal API#6135
Open
hanliang97 wants to merge 1 commit into
Open
fix: volcanic engine embedding endpoint (ep-xxx-xx) not working with multimodal API#6135hanliang97 wants to merge 1 commit into
hanliang97 wants to merge 1 commit into
Conversation
Author
|
为了解决 火山向量模型 sp-xxx-xxx无法添加问题 |
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\n\nVolcanic engine embedding models with `ep-xxx-xx` endpoint IDs fail with "list index out of range" error during credential verification. Only `doubao-xxx` model names worked correctly.\n\n## Root Cause\n\nTwo issues:\n\n1. The code only routed `doubao-embedding-vision-` prefixed models to the multimodal embeddings API (`/embeddings/multimodal`), while `ep-xxx-xx` endpoint models fell through to the standard embeddings API (`/embeddings`) which doesn't support multimodal endpoints.\n\n2. The multimodal embeddings API returns `resp.data` as a single `MultimodalEmbedding` object with an `.embedding` attribute, not a list. The extraction logic was incorrectly treating it as a list.\n\n## Fix\n\n- Unify all volcanic engine embedding calls to use `multimodal_embeddings.create()` API (compatible with both pure text and multimodal inputs)\n- Fix `_extract_embedding` to check `hasattr(data, 'embedding')` first, correctly handling single MultimodalEmbedding objects\n- Both `ep-xxx-xx` endpoint IDs and `doubao-xxx` model names now work correctly\n\n## Testing\n\nTested with endpoint `ep-20260527164729-5mshx` (doubao-embedding-vision based) - credential verification and embedding generation both pass.