LangChain
A caller-supplied LangChain chat model, selected with LLM_PROVIDER=langchain, used to extract facts from conversations.
Enable it
bash
LLM_PROVIDER=langchain
# No env vars: the LangChain chat model is passed in code, not configured by environment.python
# The provider wraps a langchain_core BaseChatModel you construct and inject.
from langchain_openai import ChatOpenAI
from app.core.llms.factory import create_llm
llm = create_llm("langchain", model=ChatOpenAI(model="gpt-4o-mini"))Configuration
| Variable | Default | Description |
|---|---|---|
LLM_PROVIDER | openai | Set to langchain. |
Notes
- No environment configuration: the provider does no model construction or key handling itself.
- It expects a
langchain_coreBaseChatModelinstance; any other value raises aTypeError. - Requires
langchain-coreto be installed (pip install langchain-core).