mirror of
https://github.com/hwchase17/langchain.git
synced 2026-06-09 10:17:00 +00:00
Voyage has introduced voyage-3-large and voyage-code-3, which feature different output dimensions by leveraging a technique called "Matryoshka Embeddings" (see blog - https://blog.voyageai.com/2024/12/04/voyage-code-3/). These two models are available in various sizes: [256, 512, 1024, 2048] (https://docs.voyageai.com/docs/embeddings#model-choices). This PR adds the option to set the required output dimension.
langchain-voyageai
This package contains the LangChain integrations for VoyageAI through their voyageai client package.
Installation and Setup
- Install the LangChain partner package
pip install langchain-voyageai
- Get an VoyageAI api key and set it as an environment variable (
VOYAGE_API_KEY) or use the API key as a parameter in the Client.
Text Embedding Model
See a usage example
from langchain_voyageai import VoyageAIEmbeddings