Add dimensions parameter support to openai_embed()#2323
Merged
1 commit merged intoHKUDS:mainfrom Nov 7, 2025
Merged
Conversation
Collaborator
|
This PR has two issues:
|
Collaborator
|
PR #2328 addresses the two issues mentioned above. Please pull the branch and verify if the implementation works as expected. Thank you. |
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
Add support for the
dimensionsparameter in the openai_embed() function to enable API-level dimension reduction for embedding vectors. This fixes an issue where theembedding_dimparameter was accepted but never used in the API call.Related Issues
This PR addresses the issue where embedding dimension reduction was not properly supported, leading to inefficient embedding generation and dimension mismatch errors in multi-tenant scenarios with shared Qdrant collections.
Changes Made
embedding_dimparameter in the openai_embed() functionembedding_dimis used for dimension reductiondimensionsparameter in the API call only whenembedding_dimis providedembedding_dimChecklist
Additional Notes
This change enables several benefits:
Modern embedding models like text-embedding-3-small and text-embedding-3-large support dimension reduction via the API's
dimensionsparameter, which this PR now properly utilizes.