fix: set default embedding dims for vector store #3681
+13
−1
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.
This pull request updates the default handling of embedding model dimensions across the vector store configuration and implementation to ensure consistency, particularly with OpenAI's embedder defaults. The changes ensure that if the embedding model dimensions are not specified, a sensible default is used, and the documentation is updated to reflect these defaults.
Configuration and Default Handling Improvements:
embedding_model_dimsto 1536 inVectorStoreBase, aligning with the OpenAI embedder's default dimensions.VectorStoreFactoryto automatically setembedding_model_dimsfromVectorStoreBaseif not specified in the configuration, ensuring consistent behavior across vector store instantiations.Documentation Updates:
embedding_model_dimsto 1536 and added an explicit embedder configuration for OpenAI with matching dimensions.This pull request updates the configuration documentation for integrating OpenSearch with an embedding model, ensuring the embedding dimensions are consistent and adding explicit embedder configuration.Configuration consistency and embedder specification:
embedding_model_dimsparameter in the OpenSearch configuration from 1024 to 1536 to match the embedder's output dimensions.embedderconfiguration section specifying the use of OpenAI'stext-embedding-3-smallmodel withembedding_dimsset to 1536.The previous OpenSearch config example was missing the 'embedder' configuration. This could lead to a mismatch between the embedding dimensions expected by the vector store and the dimensions produced by the embedder. This change adds the 'embedder' config to the example to prevent this issue and also fixes a minor syntax error.Fixes #3677
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Please delete options that are not relevant.
Checklist:
Maintainer Checklist