LangChain embedder
An adapter that wraps a caller-provided LangChain Embeddings object rather than calling any API itself. Selected via EMBEDDING_PROVIDER=langchain.
Enable it
bash
EMBEDDING_PROVIDER=langchain
EMBEDDING_DIMS=<dimension of your wrapped model>pip install langchain-core (plus whichever LangChain embeddings integration you wrap).
Configuration
| Variable | Default | Description |
|---|---|---|
EMBEDDING_PROVIDER | openai | Set to langchain. |
EMBEDDING_DIMS | 1536 | Vector dimension; must match the wrapped model's output. |
Notes
- Unlike the other providers this one embeds no HTTP or SDK logic of its own; it wraps a LangChain
Embeddingsinstance passed in asmodel(orconfig) and mapsembedandembed_batchonto itsembed_queryandembed_documents. - It requires that instance to be supplied in code; there is no env var to name a LangChain model, and it raises if none is passed.
- If the passed object lacks
embed_query/embed_documents, it raises a clear error, and if LangChain is not installed it raises an ImportError with the install hint.