@@ -48,25 +48,25 @@ def __getattr__(name: str) -> Any:
48
48
_warn_on_import (name , replacement = "langchain.agents.MRKLChain" )
49
49
50
50
return MRKLChain
51
- elif name == "ReActChain" :
51
+ if name == "ReActChain" :
52
52
from langchain .agents import ReActChain
53
53
54
54
_warn_on_import (name , replacement = "langchain.agents.ReActChain" )
55
55
56
56
return ReActChain
57
- elif name == "SelfAskWithSearchChain" :
57
+ if name == "SelfAskWithSearchChain" :
58
58
from langchain .agents import SelfAskWithSearchChain
59
59
60
60
_warn_on_import (name , replacement = "langchain.agents.SelfAskWithSearchChain" )
61
61
62
62
return SelfAskWithSearchChain
63
- elif name == "ConversationChain" :
63
+ if name == "ConversationChain" :
64
64
from langchain .chains import ConversationChain
65
65
66
66
_warn_on_import (name , replacement = "langchain.chains.ConversationChain" )
67
67
68
68
return ConversationChain
69
- elif name == "LLMBashChain" :
69
+ if name == "LLMBashChain" :
70
70
msg = (
71
71
"This module has been moved to langchain-experimental. "
72
72
"For more details: "
@@ -77,153 +77,153 @@ def __getattr__(name: str) -> Any:
77
77
)
78
78
raise ImportError (msg )
79
79
80
- elif name == "LLMChain" :
80
+ if name == "LLMChain" :
81
81
from langchain .chains import LLMChain
82
82
83
83
_warn_on_import (name , replacement = "langchain.chains.LLMChain" )
84
84
85
85
return LLMChain
86
- elif name == "LLMCheckerChain" :
86
+ if name == "LLMCheckerChain" :
87
87
from langchain .chains import LLMCheckerChain
88
88
89
89
_warn_on_import (name , replacement = "langchain.chains.LLMCheckerChain" )
90
90
91
91
return LLMCheckerChain
92
- elif name == "LLMMathChain" :
92
+ if name == "LLMMathChain" :
93
93
from langchain .chains import LLMMathChain
94
94
95
95
_warn_on_import (name , replacement = "langchain.chains.LLMMathChain" )
96
96
97
97
return LLMMathChain
98
- elif name == "QAWithSourcesChain" :
98
+ if name == "QAWithSourcesChain" :
99
99
from langchain .chains import QAWithSourcesChain
100
100
101
101
_warn_on_import (name , replacement = "langchain.chains.QAWithSourcesChain" )
102
102
103
103
return QAWithSourcesChain
104
- elif name == "VectorDBQA" :
104
+ if name == "VectorDBQA" :
105
105
from langchain .chains import VectorDBQA
106
106
107
107
_warn_on_import (name , replacement = "langchain.chains.VectorDBQA" )
108
108
109
109
return VectorDBQA
110
- elif name == "VectorDBQAWithSourcesChain" :
110
+ if name == "VectorDBQAWithSourcesChain" :
111
111
from langchain .chains import VectorDBQAWithSourcesChain
112
112
113
113
_warn_on_import (name , replacement = "langchain.chains.VectorDBQAWithSourcesChain" )
114
114
115
115
return VectorDBQAWithSourcesChain
116
- elif name == "InMemoryDocstore" :
116
+ if name == "InMemoryDocstore" :
117
117
from langchain_community .docstore import InMemoryDocstore
118
118
119
119
_warn_on_import (name , replacement = "langchain.docstore.InMemoryDocstore" )
120
120
121
121
return InMemoryDocstore
122
- elif name == "Wikipedia" :
122
+ if name == "Wikipedia" :
123
123
from langchain_community .docstore import Wikipedia
124
124
125
125
_warn_on_import (name , replacement = "langchain.docstore.Wikipedia" )
126
126
127
127
return Wikipedia
128
- elif name == "Anthropic" :
128
+ if name == "Anthropic" :
129
129
from langchain_community .llms import Anthropic
130
130
131
131
_warn_on_import (name , replacement = "langchain_community.llms.Anthropic" )
132
132
133
133
return Anthropic
134
- elif name == "Banana" :
134
+ if name == "Banana" :
135
135
from langchain_community .llms import Banana
136
136
137
137
_warn_on_import (name , replacement = "langchain_community.llms.Banana" )
138
138
139
139
return Banana
140
- elif name == "CerebriumAI" :
140
+ if name == "CerebriumAI" :
141
141
from langchain_community .llms import CerebriumAI
142
142
143
143
_warn_on_import (name , replacement = "langchain_community.llms.CerebriumAI" )
144
144
145
145
return CerebriumAI
146
- elif name == "Cohere" :
146
+ if name == "Cohere" :
147
147
from langchain_community .llms import Cohere
148
148
149
149
_warn_on_import (name , replacement = "langchain_community.llms.Cohere" )
150
150
151
151
return Cohere
152
- elif name == "ForefrontAI" :
152
+ if name == "ForefrontAI" :
153
153
from langchain_community .llms import ForefrontAI
154
154
155
155
_warn_on_import (name , replacement = "langchain_community.llms.ForefrontAI" )
156
156
157
157
return ForefrontAI
158
- elif name == "GooseAI" :
158
+ if name == "GooseAI" :
159
159
from langchain_community .llms import GooseAI
160
160
161
161
_warn_on_import (name , replacement = "langchain_community.llms.GooseAI" )
162
162
163
163
return GooseAI
164
- elif name == "HuggingFaceHub" :
164
+ if name == "HuggingFaceHub" :
165
165
from langchain_community .llms import HuggingFaceHub
166
166
167
167
_warn_on_import (name , replacement = "langchain_community.llms.HuggingFaceHub" )
168
168
169
169
return HuggingFaceHub
170
- elif name == "HuggingFaceTextGenInference" :
170
+ if name == "HuggingFaceTextGenInference" :
171
171
from langchain_community .llms import HuggingFaceTextGenInference
172
172
173
173
_warn_on_import (
174
174
name , replacement = "langchain_community.llms.HuggingFaceTextGenInference"
175
175
)
176
176
177
177
return HuggingFaceTextGenInference
178
- elif name == "LlamaCpp" :
178
+ if name == "LlamaCpp" :
179
179
from langchain_community .llms import LlamaCpp
180
180
181
181
_warn_on_import (name , replacement = "langchain_community.llms.LlamaCpp" )
182
182
183
183
return LlamaCpp
184
- elif name == "Modal" :
184
+ if name == "Modal" :
185
185
from langchain_community .llms import Modal
186
186
187
187
_warn_on_import (name , replacement = "langchain_community.llms.Modal" )
188
188
189
189
return Modal
190
- elif name == "OpenAI" :
190
+ if name == "OpenAI" :
191
191
from langchain_community .llms import OpenAI
192
192
193
193
_warn_on_import (name , replacement = "langchain_community.llms.OpenAI" )
194
194
195
195
return OpenAI
196
- elif name == "Petals" :
196
+ if name == "Petals" :
197
197
from langchain_community .llms import Petals
198
198
199
199
_warn_on_import (name , replacement = "langchain_community.llms.Petals" )
200
200
201
201
return Petals
202
- elif name == "PipelineAI" :
202
+ if name == "PipelineAI" :
203
203
from langchain_community .llms import PipelineAI
204
204
205
205
_warn_on_import (name , replacement = "langchain_community.llms.PipelineAI" )
206
206
207
207
return PipelineAI
208
- elif name == "SagemakerEndpoint" :
208
+ if name == "SagemakerEndpoint" :
209
209
from langchain_community .llms import SagemakerEndpoint
210
210
211
211
_warn_on_import (name , replacement = "langchain_community.llms.SagemakerEndpoint" )
212
212
213
213
return SagemakerEndpoint
214
- elif name == "StochasticAI" :
214
+ if name == "StochasticAI" :
215
215
from langchain_community .llms import StochasticAI
216
216
217
217
_warn_on_import (name , replacement = "langchain_community.llms.StochasticAI" )
218
218
219
219
return StochasticAI
220
- elif name == "Writer" :
220
+ if name == "Writer" :
221
221
from langchain_community .llms import Writer
222
222
223
223
_warn_on_import (name , replacement = "langchain_community.llms.Writer" )
224
224
225
225
return Writer
226
- elif name == "HuggingFacePipeline" :
226
+ if name == "HuggingFacePipeline" :
227
227
from langchain_community .llms .huggingface_pipeline import HuggingFacePipeline
228
228
229
229
_warn_on_import (
@@ -232,111 +232,111 @@ def __getattr__(name: str) -> Any:
232
232
)
233
233
234
234
return HuggingFacePipeline
235
- elif name == "FewShotPromptTemplate" :
235
+ if name == "FewShotPromptTemplate" :
236
236
from langchain_core .prompts import FewShotPromptTemplate
237
237
238
238
_warn_on_import (
239
239
name , replacement = "langchain_core.prompts.FewShotPromptTemplate"
240
240
)
241
241
242
242
return FewShotPromptTemplate
243
- elif name == "Prompt" :
243
+ if name == "Prompt" :
244
244
from langchain_core .prompts import PromptTemplate
245
245
246
246
_warn_on_import (name , replacement = "langchain_core.prompts.PromptTemplate" )
247
247
248
248
# it's renamed as prompt template anyways
249
249
# this is just for backwards compat
250
250
return PromptTemplate
251
- elif name == "PromptTemplate" :
251
+ if name == "PromptTemplate" :
252
252
from langchain_core .prompts import PromptTemplate
253
253
254
254
_warn_on_import (name , replacement = "langchain_core.prompts.PromptTemplate" )
255
255
256
256
return PromptTemplate
257
- elif name == "BasePromptTemplate" :
257
+ if name == "BasePromptTemplate" :
258
258
from langchain_core .prompts import BasePromptTemplate
259
259
260
260
_warn_on_import (name , replacement = "langchain_core.prompts.BasePromptTemplate" )
261
261
262
262
return BasePromptTemplate
263
- elif name == "ArxivAPIWrapper" :
263
+ if name == "ArxivAPIWrapper" :
264
264
from langchain_community .utilities import ArxivAPIWrapper
265
265
266
266
_warn_on_import (
267
267
name , replacement = "langchain_community.utilities.ArxivAPIWrapper"
268
268
)
269
269
270
270
return ArxivAPIWrapper
271
- elif name == "GoldenQueryAPIWrapper" :
271
+ if name == "GoldenQueryAPIWrapper" :
272
272
from langchain_community .utilities import GoldenQueryAPIWrapper
273
273
274
274
_warn_on_import (
275
275
name , replacement = "langchain_community.utilities.GoldenQueryAPIWrapper"
276
276
)
277
277
278
278
return GoldenQueryAPIWrapper
279
- elif name == "GoogleSearchAPIWrapper" :
279
+ if name == "GoogleSearchAPIWrapper" :
280
280
from langchain_community .utilities import GoogleSearchAPIWrapper
281
281
282
282
_warn_on_import (
283
283
name , replacement = "langchain_community.utilities.GoogleSearchAPIWrapper"
284
284
)
285
285
286
286
return GoogleSearchAPIWrapper
287
- elif name == "GoogleSerperAPIWrapper" :
287
+ if name == "GoogleSerperAPIWrapper" :
288
288
from langchain_community .utilities import GoogleSerperAPIWrapper
289
289
290
290
_warn_on_import (
291
291
name , replacement = "langchain_community.utilities.GoogleSerperAPIWrapper"
292
292
)
293
293
294
294
return GoogleSerperAPIWrapper
295
- elif name == "PowerBIDataset" :
295
+ if name == "PowerBIDataset" :
296
296
from langchain_community .utilities import PowerBIDataset
297
297
298
298
_warn_on_import (
299
299
name , replacement = "langchain_community.utilities.PowerBIDataset"
300
300
)
301
301
302
302
return PowerBIDataset
303
- elif name == "SearxSearchWrapper" :
303
+ if name == "SearxSearchWrapper" :
304
304
from langchain_community .utilities import SearxSearchWrapper
305
305
306
306
_warn_on_import (
307
307
name , replacement = "langchain_community.utilities.SearxSearchWrapper"
308
308
)
309
309
310
310
return SearxSearchWrapper
311
- elif name == "WikipediaAPIWrapper" :
311
+ if name == "WikipediaAPIWrapper" :
312
312
from langchain_community .utilities import WikipediaAPIWrapper
313
313
314
314
_warn_on_import (
315
315
name , replacement = "langchain_community.utilities.WikipediaAPIWrapper"
316
316
)
317
317
318
318
return WikipediaAPIWrapper
319
- elif name == "WolframAlphaAPIWrapper" :
319
+ if name == "WolframAlphaAPIWrapper" :
320
320
from langchain_community .utilities import WolframAlphaAPIWrapper
321
321
322
322
_warn_on_import (
323
323
name , replacement = "langchain_community.utilities.WolframAlphaAPIWrapper"
324
324
)
325
325
326
326
return WolframAlphaAPIWrapper
327
- elif name == "SQLDatabase" :
327
+ if name == "SQLDatabase" :
328
328
from langchain_community .utilities import SQLDatabase
329
329
330
330
_warn_on_import (name , replacement = "langchain_community.utilities.SQLDatabase" )
331
331
332
332
return SQLDatabase
333
- elif name == "FAISS" :
333
+ if name == "FAISS" :
334
334
from langchain_community .vectorstores import FAISS
335
335
336
336
_warn_on_import (name , replacement = "langchain_community.vectorstores.FAISS" )
337
337
338
338
return FAISS
339
- elif name == "ElasticVectorSearch" :
339
+ if name == "ElasticVectorSearch" :
340
340
from langchain_community .vectorstores import ElasticVectorSearch
341
341
342
342
_warn_on_import (
@@ -345,15 +345,15 @@ def __getattr__(name: str) -> Any:
345
345
346
346
return ElasticVectorSearch
347
347
# For backwards compatibility
348
- elif name == "SerpAPIChain" or name == "SerpAPIWrapper" :
348
+ if name == "SerpAPIChain" or name == "SerpAPIWrapper" :
349
349
from langchain_community .utilities import SerpAPIWrapper
350
350
351
351
_warn_on_import (
352
352
name , replacement = "langchain_community.utilities.SerpAPIWrapper"
353
353
)
354
354
355
355
return SerpAPIWrapper
356
- elif name == "verbose" :
356
+ if name == "verbose" :
357
357
from langchain .globals import _verbose
358
358
359
359
_warn_on_import (
@@ -364,7 +364,7 @@ def __getattr__(name: str) -> Any:
364
364
)
365
365
366
366
return _verbose
367
- elif name == "debug" :
367
+ if name == "debug" :
368
368
from langchain .globals import _debug
369
369
370
370
_warn_on_import (
@@ -375,7 +375,7 @@ def __getattr__(name: str) -> Any:
375
375
)
376
376
377
377
return _debug
378
- elif name == "llm_cache" :
378
+ if name == "llm_cache" :
379
379
from langchain .globals import _llm_cache
380
380
381
381
_warn_on_import (
@@ -386,9 +386,8 @@ def __getattr__(name: str) -> Any:
386
386
)
387
387
388
388
return _llm_cache
389
- else :
390
- msg = f"Could not find: { name } "
391
- raise AttributeError (msg )
389
+ msg = f"Could not find: { name } "
390
+ raise AttributeError (msg )
392
391
393
392
394
393
__all__ = [
0 commit comments