langchain-ai/langchain-google
View on GitHubFirst Batch of results in `VertexAIEmbeddings` does not respect the dimensions passed for embedding
Open
#1,089 opened on Aug 22, 2025
help wantedinvestigatevertexai
Repository metrics
- Stars
- (392 stars)
- PR merge metrics
- (PR metrics pending)
Description
In here, it seems that the dimensions is not passed for the first batch to be processed based on the embedding dimensions passed by the client. This Creates a bug when custom dimensions needs to be embedded from VertexAI Embeddings (eg. 768 dimension embedding from gemini-embedding-001)
The fix is simple. pass in the dimensions forward:
first_result = self._get_embeddings_with_retry(
first_batch, embeddings_type, dimensions
)