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

refactor(embeddings)!: Change embedDocuments input to List<Document> #153

Merged
merged 1 commit into from
Sep 5, 2023

Conversation

davidmigloz
Copy link
Owner

Currently Embeddings.embedDocuments method takes a List<String> which is not ideal because:

  1. It is not consistent with the name of the method
  2. Some embedding models allow to pass some metadata to improve the quality of the generated embedding (e.g. VertexAI allows to pass a 'title' property)

This PR refactors the method to expect a List<Document> instead. Making it more aligned with the method name and allowing to pass metadata to the embedding models.

Currently `Embeddings.embedDocuments` method takes a `List<String>` which is not ideal because:
1. It is not consistent with the name of the method
2. Some embedding models allow to pass some metadata to improve the quality of the generated embedding (e.g. VertexAI allows to pass a 'title' property)

This PR refactors the method to expect a `List<Document>` instead. Making it more aligned with the method name and allowing to pass metadata to the embedding models.
@davidmigloz davidmigloz self-assigned this Sep 5, 2023
@davidmigloz davidmigloz added t:enhancement New feature or request c:embeddings Embeddings. labels Sep 5, 2023
@davidmigloz davidmigloz added this to the v0.0.12 milestone Sep 5, 2023
@davidmigloz davidmigloz merged commit 527c38a into main Sep 5, 2023
1 check passed
@davidmigloz davidmigloz deleted the embed-doc branch September 5, 2023 11:34
davidmigloz added a commit that referenced this pull request Sep 5, 2023
#153)

Currently `Embeddings.embedDocuments` method takes a `List<String>` which is not ideal because:
1. It is not consistent with the name of the method
2. Some embedding models allow to pass some metadata to improve the quality of the generated embedding (e.g. VertexAI allows to pass a 'title' property)

This PR refactors the method to expect a `List<Document>` instead. Making it more aligned with the method name and allowing to pass metadata to the embedding models.
KennethKnudsen97 pushed a commit to KennethKnudsen97/langchain_dart that referenced this pull request Sep 29, 2023
davidmigloz#153)

Currently `Embeddings.embedDocuments` method takes a `List<String>` which is not ideal because:
1. It is not consistent with the name of the method
2. Some embedding models allow to pass some metadata to improve the quality of the generated embedding (e.g. VertexAI allows to pass a 'title' property)

This PR refactors the method to expect a `List<Document>` instead. Making it more aligned with the method name and allowing to pass metadata to the embedding models.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c:embeddings Embeddings. t:enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant