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

OpenAIEmbeddings to core module #380

Merged
merged 8 commits into from
Sep 5, 2023
Merged

OpenAIEmbeddings to core module #380

merged 8 commits into from
Sep 5, 2023

Conversation

javipacheco
Copy link
Contributor

@javipacheco javipacheco commented Sep 4, 2023

This PR removes OpenAIEmbeddings and I'm adding the implementation of this to com.xebia.functional.xef.llm.Embeddings and now com.xebia.functional.xef.embeddings.Embeddings is not necessary

Montagon
Montagon previously approved these changes Sep 4, 2023
@Intex32 Intex32 self-requested a review September 4, 2023 08:24
@Intex32
Copy link
Member

Intex32 commented Sep 4, 2023

Considering the scope of the issue, LGTM.
Possible renames for EmbeddingsProvider I can think of are EmbeddingsStrategy and EmbeddingsService.

For another issue, I suggest making the embedQuery function an extension function that calls embedDocuments, as it is just a special case of the latter until now.
Additionally, the chunkSize should be passed in the constructor of EmbeddingsProvider and not be part of the Embeddings interface function signature, as the chunk size is specific to this implementation.

These are just my humble thoughts.

Intex32
Intex32 previously approved these changes Sep 4, 2023
@javipacheco javipacheco dismissed stale reviews from Intex32 and Montagon via aa0ef8c September 4, 2023 10:19
@javipacheco javipacheco marked this pull request as draft September 4, 2023 14:16
@javipacheco javipacheco marked this pull request as ready for review September 5, 2023 08:14
Copy link
Contributor

@raulraja raulraja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great @javipacheco , thanks!

In this or another PR, we must address the number and size of messages for embedding requests. We have been defaulting to 400 or configured chunk size, but we know the max content length of the model, which would allow us to send fewer and lengthier requests.

Copy link
Contributor

@Montagon Montagon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@javipacheco javipacheco merged commit de40a7b into main Sep 5, 2023
5 checks passed
@javipacheco javipacheco deleted the embeddings-provider branch September 5, 2023 13:03
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.

4 participants