generated from langchain-ai/integration-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhance
embed_documents
to make use of Cohere's ability to request …
…multiple embeddings at once (#350) The [Cohere embedding provider](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-embed.html) supports asking for multiple embeddings at the same time. The current implementation of `embed_documents` always iterates across the submitted texts and attempts to embed them one-by-one. This PR updates this `embed_documents` logic to check whether we are using the cohere provider, and if so request all of the embeddings at once.
- Loading branch information
Showing
2 changed files
with
73 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters