You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OpenAi apis limit the number of elements embedded at a time and the size of each element, to work around this the js sdk and python sdk provide the following:
batching if number of documents are above 2048 (promise.all on the batch api calls)
split large (>~8000 tokens) documents in sections and then join the retrieved embeddings in a normalized fashion (here the js sdk does not do it but python one does)
Propose a Solution
Base implementation of sdk chat model on @langchain/oneai models.
For the per document split I believe this needs a custom implementation above the core sdk, didn't see it in js langchain.
Describe Alternatives
Create a wrapper over existing model.
Affected Development Phase
Development
Impact
Inconvenience
Timeline
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered:
krodyrobi
changed the title
embedDocuments model does not split documents in batches nor does it split large documents and joins the embeddings
embedDocuments() batche support and possibly large document splitting
Dec 19, 2024
krodyrobi
changed the title
embedDocuments() batche support and possibly large document splitting
embedDocuments() batch support and possibly large document splitting
Dec 20, 2024
Thanks for raising this feature request. Have you checked langchain textsplitters, langchain vector store, and sample code? We currently do not handle sending batch requests or join embeddings. Will this satisfy your needs since you are using langchain?
Out of all the feature requests this in my opinion can be treated just as nice to have.
For the split of a single document, realistically no document should be that big to begin with as you've pointed out splitters exist, added here just for feature parity with python gen ai sdk and langchain.
For batching multiple documents however langchain-js/openai does this as a convenience. I realize we should stay clear from using something like this as if during the batch 1 request fails we lose quota for the whole promise.all set. Again this is here to provide parity with existing pre-conditions in js and python sdks.
Describe the Problem
OpenAi apis limit the number of elements embedded at a time and the size of each element, to work around this the js sdk and python sdk provide the following:
Propose a Solution
Base implementation of sdk chat model on @langchain/oneai models.
For the per document split I believe this needs a custom implementation above the core sdk, didn't see it in js langchain.
Describe Alternatives
Create a wrapper over existing model.
Affected Development Phase
Development
Impact
Inconvenience
Timeline
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: