Skip to content
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

vertexai: Preserve sparse_embeddings in data_points_to_batch_update_records #721

Merged
merged 1 commit into from
Jan 31, 2025

Conversation

personabb
Copy link
Contributor

PR Description

Fix missing sparse_embeddings in vector_store.add_texts_with_embeddings() for Vertex AI index

This PR ensures that sparse_embeddings are correctly stored in the Vertex AI index when using vector_store.add_texts_with_embeddings(). Previously, sparse_embeddings were not included in the index due to their absence in the data_points_to_batch_update_records function. This prevented hybrid search from functioning as expected.

Relevant Issues

Fixes issue #720 - sparse_embeddings are not stored in Vertex AI index when using add_texts_with_embeddings

Type

🐛 Bug Fix

Changes(optional)

As described in issue #720.

  • Modified data_points_to_batch_update_records (in libs/vertexai/langchain_google_vertexai/vectorstores/_utils.py) to include sparse_embeddings in the update records.
  • Added a conditional check to ensure sparse_embeddings are properly formatted and stored.

Testing(optional)

Note(optional)

@lkuligin lkuligin merged commit 5788f75 into langchain-ai:main Jan 31, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants