Commit 67903cd
committed
refactor(deps): demote LangChain and LangChain-providers from core to dev
Now that DefaultFramework handles OpenAI-compatible chat via httpx,
LangChain is no longer needed for basic operation. Moving it out of
core slims the mandatory install substantially and makes the
LangChain integration genuinely opt-in.
Core dependencies (removed):
- langchain, langchain-core, langchain-community: only imported lazily
inside nemoguardrails/integrations/langchain/ and in conditional
paths in llm/frameworks.py and rails/llm/llmrails.py (raw-LangChain-
LLM path).
- langchain-openai: not imported anywhere in src; only referenced by
test skipif guards.
- langchain-nvidia-ai-endpoints: imported conditionally in
embeddings/providers/nim.py (NIM embeddings) and in LangChain-NIM
adapter. Users who need these paths install the package directly.
Extras (removed):
- openai (was -> langchain-openai): obsolete, DefaultFramework uses
httpx directly.
- nvidia (was -> langchain-nvidia-ai-endpoints): obsolete for chat;
NIM embeddings users should install langchain-nvidia-ai-endpoints
directly.
Extras (kept and adjusted):
- server: still includes openai because server/schemas and server/api
import openai.types.chat at module scope (server won't start
without the openai SDK).
- all: updated to drop the removed extras.
Dev group additions:
- langchain, langchain-core, langchain-community: needed by the
LangChain integration tests under tests/integrations/langchain/.
- langchain-openai, langchain-nvidia-ai-endpoints: skip-guarded by
tests today; installed in dev so those guards activate.
Runtime behavior unchanged: code that used these packages always
imported them lazily or conditionally. Users on
NEMOGUARDRAILS_LLM_FRAMEWORK=langchain now need to install
langchain-* themselves; an upgrade note in the migration guide is
appropriate (follow-up).1 parent fe06537 commit 67903cd
2 files changed
Lines changed: 16 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | 61 | | |
65 | 62 | | |
66 | 63 | | |
| |||
77 | 74 | | |
78 | 75 | | |
79 | 76 | | |
| 77 | + | |
| 78 | + | |
80 | 79 | | |
81 | 80 | | |
82 | 81 | | |
83 | 82 | | |
84 | 83 | | |
85 | 84 | | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | 85 | | |
90 | 86 | | |
91 | 87 | | |
| |||
103 | 99 | | |
104 | 100 | | |
105 | 101 | | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | 102 | | |
110 | 103 | | |
111 | 104 | | |
| |||
118 | 111 | | |
119 | 112 | | |
120 | 113 | | |
121 | | - | |
122 | 114 | | |
123 | 115 | | |
124 | | - | |
125 | 116 | | |
126 | 117 | | |
127 | 118 | | |
| |||
134 | 125 | | |
135 | 126 | | |
136 | 127 | | |
137 | | - | |
138 | 128 | | |
139 | 129 | | |
140 | 130 | | |
141 | 131 | | |
142 | | - | |
143 | 132 | | |
144 | 133 | | |
145 | 134 | | |
| |||
165 | 154 | | |
166 | 155 | | |
167 | 156 | | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
168 | 164 | | |
169 | 165 | | |
170 | 166 | | |
| |||
0 commit comments