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

GH-1826 Fix EmbeddingModel's usage on Document#embedding #1836

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ilayaperumalg
Copy link
Member

  • Since the Document object's reference to the embedding is deprecated and will be removed, the VectorStore implementations require a way to store the embedding of the corresponding Document objects

    • One way to fix this is, to have the EmbeddingModel#embed to return the embeddings in the same order as that of the Documents passed to it.

      • Since both the Document and embedding collections use the List object, their iteration operation will make sure to keep them in line with the same order.
        • A fix is required to preserve the order when batching strategy is applied.
        • Updated the Javadoc for BatchingStrategy -
        • Fixed the Document List order in TokenCountBatchingStrategy
    • Refactored the vector store implementations to update this change

Resolves #GH-1826

  - Since the Document object's reference to the `embedding` is deprecated and will be removed, the VectorStore implementations require a way to store the embedding of the corresponding Document objects

     - One way to fix this is, to have the EmbeddingModel#embed to return the embeddings in the same order as that of the Documents passed to it.

       - Since both the Document and embedding collections use the List object, their iteration operation will make sure to keep them in line with the same order.

       - A fix is required to preserve the order when batching strategy is applied.
	  - Updated the Javadoc for BatchingStrategy
          - Fixed the Document List order in TokenCountBatchingStrategy

    - Refactored the vector store implementations to update this change

Resolves #spring-projectsGH-1826
@tzolov tzolov self-assigned this Nov 28, 2024
@tzolov tzolov added documentation Improvements or additions to documentation embedding labels Nov 28, 2024
@tzolov tzolov added this to the 1.0.0-M5 milestone Nov 28, 2024
@tzolov tzolov removed the documentation Improvements or additions to documentation label Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants