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

adds support in pipeline for voyage #3424

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
* **Add support for specifying OCR language to `partition_pdf()`.** Extend language specification capability to `PaddleOCR` in addition to `TesseractOCR`. Users can now specify OCR languages for both OCR engines when using `partition_pdf()`.
* **Add AstraDB source connector** Adds support for ingesting documents from AstraDB.

* **Add Voyage support to Pipelines**

### Fixes

* **Remedy error on Windows when `nltk` binaries are downloaded.** Work around a quirk in the Windows implementation of `tempfile.NamedTemporaryFile` where accessing the temporary file by name raises `PermissionError`.
Expand Down
8 changes: 8 additions & 0 deletions unstructured/ingest/v2/processes/embedder.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ def get_embedder(self) -> BaseEmbeddingEncoder:
)

return VertexAIEmbeddingEncoder(config=VertexAIEmbeddingConfig(**kwargs))

elif self.embedding_provider == "voyage":
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please change "voyage" to "langchain-voyageai"? You can refer to: https://github.com/Unstructured-IO/unstructured/blob/main/unstructured/ingest/interfaces.py#L237

from unstructured.embed.voyageai import (
VoyageAIEmbeddingConfig,
VoyageAIEmbeddingEncoder,
)

return VoyageAIEmbeddingEncoder(config=VoyageAIEmbeddingConfig(**kwargs))
else:
raise ValueError(f"{self.embedding_provider} not a recognized encoder")

Expand Down
Loading