langflow-base-nightly 0.5.0.dev25__py3-none-any.whl → 0.5.0.dev27__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. langflow/components/__init__.py +273 -0
  2. langflow/components/_importing.py +37 -0
  3. langflow/components/aiml/__init__.py +32 -2
  4. langflow/components/amazon/__init__.py +34 -3
  5. langflow/components/anthropic/__init__.py +30 -1
  6. langflow/components/assemblyai/__init__.py +38 -5
  7. langflow/components/azure/__init__.py +32 -2
  8. langflow/components/baidu/__init__.py +30 -1
  9. langflow/components/cleanlab/__init__.py +39 -4
  10. langflow/components/cloudflare/__init__.py +30 -1
  11. langflow/components/cohere/__init__.py +39 -4
  12. langflow/components/composio/__init__.py +40 -6
  13. langflow/components/crewai/__init__.py +40 -6
  14. langflow/components/custom_component/__init__.py +30 -1
  15. langflow/components/datastax/__init__.py +54 -13
  16. langflow/components/deepseek/__init__.py +33 -2
  17. langflow/components/docling/__init__.py +36 -4
  18. langflow/components/embeddings/__init__.py +32 -4
  19. langflow/components/firecrawl/__init__.py +42 -5
  20. langflow/components/groq/__init__.py +33 -2
  21. langflow/components/helpers/__init__.py +42 -7
  22. langflow/components/huggingface/__init__.py +32 -2
  23. langflow/components/ibm/__init__.py +32 -2
  24. langflow/components/input_output/__init__.py +36 -4
  25. langflow/components/langchain_utilities/__init__.py +80 -26
  26. langflow/components/langchain_utilities/conversation.py +1 -1
  27. langflow/components/langchain_utilities/llm_checker.py +1 -1
  28. langflow/components/langchain_utilities/llm_math.py +1 -1
  29. langflow/components/langchain_utilities/retrieval_qa.py +4 -2
  30. langflow/components/langchain_utilities/sql_generator.py +1 -1
  31. langflow/components/lmstudio/__init__.py +32 -2
  32. langflow/components/logic/__init__.py +42 -7
  33. langflow/components/maritalk/__init__.py +30 -1
  34. langflow/components/mistral/__init__.py +36 -3
  35. langflow/components/models/__init__.py +32 -2
  36. langflow/components/notdiamond/__init__.py +36 -0
  37. langflow/components/novita/__init__.py +30 -1
  38. langflow/components/nvidia/__init__.py +45 -7
  39. langflow/components/ollama/__init__.py +32 -2
  40. langflow/components/openai/__init__.py +32 -2
  41. langflow/components/openrouter/__init__.py +30 -1
  42. langflow/components/perplexity/__init__.py +33 -2
  43. langflow/components/processing/__init__.py +90 -23
  44. langflow/components/prototypes/__init__.py +30 -1
  45. langflow/components/sambanova/__init__.py +30 -1
  46. langflow/components/scrapegraph/__init__.py +39 -4
  47. langflow/components/searchapi/__init__.py +36 -0
  48. langflow/components/tools/__init__.py +54 -19
  49. langflow/components/twelvelabs/__init__.py +42 -7
  50. langflow/components/vectorstores/__init__.py +76 -24
  51. langflow/components/vertexai/__init__.py +32 -2
  52. langflow/components/xai/__init__.py +30 -1
  53. langflow/components/youtube/__init__.py +42 -7
  54. {langflow_base_nightly-0.5.0.dev25.dist-info → langflow_base_nightly-0.5.0.dev27.dist-info}/METADATA +1 -1
  55. {langflow_base_nightly-0.5.0.dev25.dist-info → langflow_base_nightly-0.5.0.dev27.dist-info}/RECORD +57 -57
  56. langflow/components/vectara/__init__.py +0 -0
  57. {langflow_base_nightly-0.5.0.dev25.dist-info → langflow_base_nightly-0.5.0.dev27.dist-info}/WHEEL +0 -0
  58. {langflow_base_nightly-0.5.0.dev25.dist-info → langflow_base_nightly-0.5.0.dev27.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,273 @@
1
+ """LangFlow Components module."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import TYPE_CHECKING, Any
6
+
7
+ from langflow.components._importing import import_mod
8
+
9
+ if TYPE_CHECKING:
10
+ from langflow.components import (
11
+ Notion,
12
+ agentql,
13
+ agents,
14
+ aiml,
15
+ amazon,
16
+ anthropic,
17
+ apify,
18
+ arxiv,
19
+ assemblyai,
20
+ azure,
21
+ baidu,
22
+ bing,
23
+ cleanlab,
24
+ cloudflare,
25
+ cohere,
26
+ composio,
27
+ confluence,
28
+ crewai,
29
+ custom_component,
30
+ data,
31
+ datastax,
32
+ deepseek,
33
+ docling,
34
+ duckduckgo,
35
+ embeddings,
36
+ exa,
37
+ firecrawl,
38
+ git,
39
+ glean,
40
+ google,
41
+ groq,
42
+ helpers,
43
+ homeassistant,
44
+ huggingface,
45
+ ibm,
46
+ icosacomputing,
47
+ input_output,
48
+ langchain_utilities,
49
+ langwatch,
50
+ lmstudio,
51
+ logic,
52
+ maritalk,
53
+ mem0,
54
+ mistral,
55
+ models,
56
+ needle,
57
+ notdiamond,
58
+ novita,
59
+ nvidia,
60
+ olivya,
61
+ ollama,
62
+ openai,
63
+ openrouter,
64
+ perplexity,
65
+ processing,
66
+ prototypes,
67
+ redis,
68
+ sambanova,
69
+ scrapegraph,
70
+ searchapi,
71
+ serpapi,
72
+ tavily,
73
+ tools,
74
+ twelvelabs,
75
+ unstructured,
76
+ vectorstores,
77
+ vertexai,
78
+ wikipedia,
79
+ wolframalpha,
80
+ xai,
81
+ yahoosearch,
82
+ youtube,
83
+ zep,
84
+ )
85
+
86
+ _dynamic_imports = {
87
+ "agents": "langflow.components.agents",
88
+ "data": "langflow.components.data",
89
+ "processing": "langflow.components.processing",
90
+ "vectorstores": "langflow.components.vectorstores",
91
+ "tools": "langflow.components.tools",
92
+ "models": "langflow.components.models",
93
+ "embeddings": "langflow.components.embeddings",
94
+ "helpers": "langflow.components.helpers",
95
+ "input_output": "langflow.components.input_output",
96
+ "logic": "langflow.components.logic",
97
+ "custom_component": "langflow.components.custom_component",
98
+ "prototypes": "langflow.components.prototypes",
99
+ "openai": "langflow.components.openai",
100
+ "anthropic": "langflow.components.anthropic",
101
+ "google": "langflow.components.google",
102
+ "azure": "langflow.components.azure",
103
+ "huggingface": "langflow.components.huggingface",
104
+ "ollama": "langflow.components.ollama",
105
+ "groq": "langflow.components.groq",
106
+ "cohere": "langflow.components.cohere",
107
+ "mistral": "langflow.components.mistral",
108
+ "deepseek": "langflow.components.deepseek",
109
+ "nvidia": "langflow.components.nvidia",
110
+ "amazon": "langflow.components.amazon",
111
+ "vertexai": "langflow.components.vertexai",
112
+ "xai": "langflow.components.xai",
113
+ "perplexity": "langflow.components.perplexity",
114
+ "openrouter": "langflow.components.openrouter",
115
+ "lmstudio": "langflow.components.lmstudio",
116
+ "sambanova": "langflow.components.sambanova",
117
+ "maritalk": "langflow.components.maritalk",
118
+ "novita": "langflow.components.novita",
119
+ "olivya": "langflow.components.olivya",
120
+ "notdiamond": "langflow.components.notdiamond",
121
+ "needle": "langflow.components.needle",
122
+ "cloudflare": "langflow.components.cloudflare",
123
+ "baidu": "langflow.components.baidu",
124
+ "aiml": "langflow.components.aiml",
125
+ "ibm": "langflow.components.ibm",
126
+ "langchain_utilities": "langflow.components.langchain_utilities",
127
+ "crewai": "langflow.components.crewai",
128
+ "composio": "langflow.components.composio",
129
+ "mem0": "langflow.components.mem0",
130
+ "datastax": "langflow.components.datastax",
131
+ "cleanlab": "langflow.components.cleanlab",
132
+ "langwatch": "langflow.components.langwatch",
133
+ "icosacomputing": "langflow.components.icosacomputing",
134
+ "homeassistant": "langflow.components.homeassistant",
135
+ "agentql": "langflow.components.agentql",
136
+ "assemblyai": "langflow.components.assemblyai",
137
+ "twelvelabs": "langflow.components.twelvelabs",
138
+ "docling": "langflow.components.docling",
139
+ "unstructured": "langflow.components.unstructured",
140
+ "redis": "langflow.components.redis",
141
+ "zep": "langflow.components.zep",
142
+ "bing": "langflow.components.bing",
143
+ "duckduckgo": "langflow.components.duckduckgo",
144
+ "serpapi": "langflow.components.serpapi",
145
+ "searchapi": "langflow.components.searchapi",
146
+ "tavily": "langflow.components.tavily",
147
+ "exa": "langflow.components.exa",
148
+ "glean": "langflow.components.glean",
149
+ "yahoosearch": "langflow.components.yahoosearch",
150
+ "apify": "langflow.components.apify",
151
+ "arxiv": "langflow.components.arxiv",
152
+ "confluence": "langflow.components.confluence",
153
+ "firecrawl": "langflow.components.firecrawl",
154
+ "git": "langflow.components.git",
155
+ "wikipedia": "langflow.components.wikipedia",
156
+ "youtube": "langflow.components.youtube",
157
+ "scrapegraph": "langflow.components.scrapegraph",
158
+ "Notion": "langflow.components.Notion",
159
+ "wolframalpha": "langflow.components.wolframalpha",
160
+ }
161
+
162
+ __all__: list[str] = [
163
+ "Notion",
164
+ "agentql",
165
+ "agents",
166
+ "aiml",
167
+ "amazon",
168
+ "anthropic",
169
+ "apify",
170
+ "arxiv",
171
+ "assemblyai",
172
+ "azure",
173
+ "baidu",
174
+ "bing",
175
+ "cleanlab",
176
+ "cloudflare",
177
+ "cohere",
178
+ "composio",
179
+ "confluence",
180
+ "crewai",
181
+ "custom_component",
182
+ "data",
183
+ "datastax",
184
+ "deepseek",
185
+ "docling",
186
+ "duckduckgo",
187
+ "embeddings",
188
+ "exa",
189
+ "firecrawl",
190
+ "git",
191
+ "glean",
192
+ "google",
193
+ "groq",
194
+ "helpers",
195
+ "homeassistant",
196
+ "huggingface",
197
+ "ibm",
198
+ "icosacomputing",
199
+ "input_output",
200
+ "langchain_utilities",
201
+ "langwatch",
202
+ "lmstudio",
203
+ "logic",
204
+ "maritalk",
205
+ "mem0",
206
+ "mistral",
207
+ "models",
208
+ "needle",
209
+ "notdiamond",
210
+ "novita",
211
+ "nvidia",
212
+ "olivya",
213
+ "ollama",
214
+ "openai",
215
+ "openrouter",
216
+ "perplexity",
217
+ "processing",
218
+ "prototypes",
219
+ "redis",
220
+ "sambanova",
221
+ "scrapegraph",
222
+ "searchapi",
223
+ "serpapi",
224
+ "tavily",
225
+ "tools",
226
+ "twelvelabs",
227
+ "unstructured",
228
+ "vectorstores",
229
+ "vertexai",
230
+ "wikipedia",
231
+ "wolframalpha",
232
+ "xai",
233
+ "yahoosearch",
234
+ "youtube",
235
+ "zep",
236
+ ]
237
+
238
+
239
+ def __getattr__(attr_name: str) -> Any:
240
+ """Lazily import component modules on attribute access.
241
+
242
+ Args:
243
+ attr_name (str): The attribute/module name to import.
244
+
245
+ Returns:
246
+ Any: The imported module or attribute.
247
+
248
+ Raises:
249
+ AttributeError: If the attribute is not a known component or cannot be imported.
250
+ """
251
+ if attr_name not in _dynamic_imports:
252
+ msg = f"module '{__name__}' has no attribute '{attr_name}'"
253
+ raise AttributeError(msg)
254
+ try:
255
+ # Use import_mod as in LangChain, passing the module name and package
256
+ result = import_mod(attr_name, "__module__", __spec__.parent)
257
+ except (ModuleNotFoundError, ImportError, AttributeError) as e:
258
+ msg = f"Could not import '{attr_name}' from '{__name__}': {e}"
259
+ raise AttributeError(msg) from e
260
+ globals()[attr_name] = result # Cache for future access
261
+ return result
262
+
263
+
264
+ def __dir__() -> list[str]:
265
+ """Return list of available attributes for tab-completion and dir()."""
266
+ return list(__all__)
267
+
268
+
269
+ # Optional: Consistency check (can be removed in production)
270
+ _missing = set(__all__) - set(_dynamic_imports)
271
+ if _missing:
272
+ msg = f"Missing dynamic import mapping for: {', '.join(_missing)}"
273
+ raise ImportError(msg)
@@ -0,0 +1,37 @@
1
+ """Import utilities for LangFlow components."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from importlib import import_module
6
+
7
+
8
+ def import_mod(
9
+ attr_name: str,
10
+ module_name: str | None,
11
+ package: str | None,
12
+ ) -> object:
13
+ """Import an attribute from a module located in a package.
14
+
15
+ This utility function is used in custom __getattr__ methods within __init__.py
16
+ files to dynamically import attributes.
17
+
18
+ Args:
19
+ attr_name: The name of the attribute to import.
20
+ module_name: The name of the module to import from. If None, the attribute
21
+ is imported from the package itself.
22
+ package: The name of the package where the module is located.
23
+ """
24
+ if module_name == "__module__" or module_name is None:
25
+ try:
26
+ result = import_module(f".{attr_name}", package=package)
27
+ except ModuleNotFoundError:
28
+ msg = f"module '{package!r}' has no attribute {attr_name!r}"
29
+ raise AttributeError(msg) from None
30
+ else:
31
+ try:
32
+ module = import_module(f".{module_name}", package=package)
33
+ except ModuleNotFoundError:
34
+ msg = f"module '{package!r}.{module_name!r}' not found"
35
+ raise ImportError(msg) from None
36
+ result = getattr(module, attr_name)
37
+ return result
@@ -1,7 +1,37 @@
1
- from .aiml import AIMLModelComponent
2
- from .aiml_embeddings import AIMLEmbeddingsComponent
1
+ from __future__ import annotations
2
+
3
+ from typing import TYPE_CHECKING, Any
4
+
5
+ from langflow.components._importing import import_mod
6
+
7
+ if TYPE_CHECKING:
8
+ from langflow.components.aiml.aiml import AIMLModelComponent
9
+ from langflow.components.aiml.aiml_embeddings import AIMLEmbeddingsComponent
10
+
11
+ _dynamic_imports = {
12
+ "AIMLModelComponent": "aiml",
13
+ "AIMLEmbeddingsComponent": "aiml_embeddings",
14
+ }
3
15
 
4
16
  __all__ = [
5
17
  "AIMLEmbeddingsComponent",
6
18
  "AIMLModelComponent",
7
19
  ]
20
+
21
+
22
+ def __getattr__(attr_name: str) -> Any:
23
+ """Lazily import aiml components on attribute access."""
24
+ if attr_name not in _dynamic_imports:
25
+ msg = f"module '{__name__}' has no attribute '{attr_name}'"
26
+ raise AttributeError(msg)
27
+ try:
28
+ result = import_mod(attr_name, _dynamic_imports[attr_name], __spec__.parent)
29
+ except (ModuleNotFoundError, ImportError, AttributeError) as e:
30
+ msg = f"Could not import '{attr_name}' from '{__name__}': {e}"
31
+ raise AttributeError(msg) from e
32
+ globals()[attr_name] = result
33
+ return result
34
+
35
+
36
+ def __dir__() -> list[str]:
37
+ return list(__all__)
@@ -1,5 +1,36 @@
1
- from .amazon_bedrock_embedding import AmazonBedrockEmbeddingsComponent
2
- from .amazon_bedrock_model import AmazonBedrockComponent
3
- from .s3_bucket_uploader import S3BucketUploaderComponent
1
+ from __future__ import annotations
2
+
3
+ from typing import TYPE_CHECKING, Any
4
+
5
+ from langflow.components._importing import import_mod
6
+
7
+ if TYPE_CHECKING:
8
+ from langflow.components.amazon.amazon_bedrock_embedding import AmazonBedrockEmbeddingsComponent
9
+ from langflow.components.amazon.amazon_bedrock_model import AmazonBedrockComponent
10
+ from langflow.components.amazon.s3_bucket_uploader import S3BucketUploaderComponent
11
+
12
+ _dynamic_imports = {
13
+ "AmazonBedrockEmbeddingsComponent": "amazon_bedrock_embedding",
14
+ "AmazonBedrockComponent": "amazon_bedrock_model",
15
+ "S3BucketUploaderComponent": "s3_bucket_uploader",
16
+ }
4
17
 
5
18
  __all__ = ["AmazonBedrockComponent", "AmazonBedrockEmbeddingsComponent", "S3BucketUploaderComponent"]
19
+
20
+
21
+ def __getattr__(attr_name: str) -> Any:
22
+ """Lazily import amazon components on attribute access."""
23
+ if attr_name not in _dynamic_imports:
24
+ msg = f"module '{__name__}' has no attribute '{attr_name}'"
25
+ raise AttributeError(msg)
26
+ try:
27
+ result = import_mod(attr_name, _dynamic_imports[attr_name], __spec__.parent)
28
+ except (ModuleNotFoundError, ImportError, AttributeError) as e:
29
+ msg = f"Could not import '{attr_name}' from '{__name__}': {e}"
30
+ raise AttributeError(msg) from e
31
+ globals()[attr_name] = result
32
+ return result
33
+
34
+
35
+ def __dir__() -> list[str]:
36
+ return list(__all__)
@@ -1,5 +1,34 @@
1
- from .anthropic import AnthropicModelComponent
1
+ from __future__ import annotations
2
+
3
+ from typing import TYPE_CHECKING, Any
4
+
5
+ from langflow.components._importing import import_mod
6
+
7
+ if TYPE_CHECKING:
8
+ from langflow.components.anthropic.anthropic import AnthropicModelComponent
9
+
10
+ _dynamic_imports = {
11
+ "AnthropicModelComponent": "anthropic",
12
+ }
2
13
 
3
14
  __all__ = [
4
15
  "AnthropicModelComponent",
5
16
  ]
17
+
18
+
19
+ def __getattr__(attr_name: str) -> Any:
20
+ """Lazily import Anthropic components on attribute access."""
21
+ if attr_name not in _dynamic_imports:
22
+ msg = f"module '{__name__}' has no attribute '{attr_name}'"
23
+ raise AttributeError(msg)
24
+ try:
25
+ result = import_mod(attr_name, _dynamic_imports[attr_name], __spec__.parent)
26
+ except (ModuleNotFoundError, ImportError, AttributeError) as e:
27
+ msg = f"Could not import '{attr_name}' from '{__name__}': {e}"
28
+ raise AttributeError(msg) from e
29
+ globals()[attr_name] = result
30
+ return result
31
+
32
+
33
+ def __dir__() -> list[str]:
34
+ return list(__all__)
@@ -1,8 +1,23 @@
1
- from .assemblyai_get_subtitles import AssemblyAIGetSubtitles
2
- from .assemblyai_lemur import AssemblyAILeMUR
3
- from .assemblyai_list_transcripts import AssemblyAIListTranscripts
4
- from .assemblyai_poll_transcript import AssemblyAITranscriptionJobPoller
5
- from .assemblyai_start_transcript import AssemblyAITranscriptionJobCreator
1
+ from __future__ import annotations
2
+
3
+ from typing import TYPE_CHECKING, Any
4
+
5
+ from langflow.components._importing import import_mod
6
+
7
+ if TYPE_CHECKING:
8
+ from .assemblyai_get_subtitles import AssemblyAIGetSubtitles
9
+ from .assemblyai_lemur import AssemblyAILeMUR
10
+ from .assemblyai_list_transcripts import AssemblyAIListTranscripts
11
+ from .assemblyai_poll_transcript import AssemblyAITranscriptionJobPoller
12
+ from .assemblyai_start_transcript import AssemblyAITranscriptionJobCreator
13
+
14
+ _dynamic_imports = {
15
+ "AssemblyAIGetSubtitles": "assemblyai_get_subtitles",
16
+ "AssemblyAILeMUR": "assemblyai_lemur",
17
+ "AssemblyAIListTranscripts": "assemblyai_list_transcripts",
18
+ "AssemblyAITranscriptionJobCreator": "assemblyai_start_transcript",
19
+ "AssemblyAITranscriptionJobPoller": "assemblyai_poll_transcript",
20
+ }
6
21
 
7
22
  __all__ = [
8
23
  "AssemblyAIGetSubtitles",
@@ -11,3 +26,21 @@ __all__ = [
11
26
  "AssemblyAITranscriptionJobCreator",
12
27
  "AssemblyAITranscriptionJobPoller",
13
28
  ]
29
+
30
+
31
+ def __getattr__(attr_name: str) -> Any:
32
+ """Lazily import assemblyai components on attribute access."""
33
+ if attr_name not in _dynamic_imports:
34
+ msg = f"module '{__name__}' has no attribute '{attr_name}'"
35
+ raise AttributeError(msg)
36
+ try:
37
+ result = import_mod(attr_name, _dynamic_imports[attr_name], __spec__.parent)
38
+ except (ModuleNotFoundError, ImportError, AttributeError) as e:
39
+ msg = f"Could not import '{attr_name}' from '{__name__}': {e}"
40
+ raise AttributeError(msg) from e
41
+ globals()[attr_name] = result
42
+ return result
43
+
44
+
45
+ def __dir__() -> list[str]:
46
+ return list(__all__)
@@ -1,7 +1,37 @@
1
- from .azure_openai import AzureChatOpenAIComponent
2
- from .azure_openai_embeddings import AzureOpenAIEmbeddingsComponent
1
+ from __future__ import annotations
2
+
3
+ from typing import TYPE_CHECKING, Any
4
+
5
+ from langflow.components._importing import import_mod
6
+
7
+ if TYPE_CHECKING:
8
+ from .azure_openai import AzureChatOpenAIComponent
9
+ from .azure_openai_embeddings import AzureOpenAIEmbeddingsComponent
10
+
11
+ _dynamic_imports = {
12
+ "AzureChatOpenAIComponent": "azure_openai",
13
+ "AzureOpenAIEmbeddingsComponent": "azure_openai_embeddings",
14
+ }
3
15
 
4
16
  __all__ = [
5
17
  "AzureChatOpenAIComponent",
6
18
  "AzureOpenAIEmbeddingsComponent",
7
19
  ]
20
+
21
+
22
+ def __getattr__(attr_name: str) -> Any:
23
+ """Lazily import azure components on attribute access."""
24
+ if attr_name not in _dynamic_imports:
25
+ msg = f"module '{__name__}' has no attribute '{attr_name}'"
26
+ raise AttributeError(msg)
27
+ try:
28
+ result = import_mod(attr_name, _dynamic_imports[attr_name], __spec__.parent)
29
+ except (ModuleNotFoundError, ImportError, AttributeError) as e:
30
+ msg = f"Could not import '{attr_name}' from '{__name__}': {e}"
31
+ raise AttributeError(msg) from e
32
+ globals()[attr_name] = result
33
+ return result
34
+
35
+
36
+ def __dir__() -> list[str]:
37
+ return list(__all__)
@@ -1,3 +1,32 @@
1
- from .baidu_qianfan_chat import QianfanChatEndpoint
1
+ from __future__ import annotations
2
+
3
+ from typing import TYPE_CHECKING, Any
4
+
5
+ from langflow.components._importing import import_mod
6
+
7
+ if TYPE_CHECKING:
8
+ from langflow.components.baidu.baidu_qianfan_chat import QianfanChatEndpoint
9
+
10
+ _dynamic_imports = {
11
+ "QianfanChatEndpoint": "baidu_qianfan_chat",
12
+ }
2
13
 
3
14
  __all__ = ["QianfanChatEndpoint"]
15
+
16
+
17
+ def __getattr__(attr_name: str) -> Any:
18
+ """Lazily import baidu components on attribute access."""
19
+ if attr_name not in _dynamic_imports:
20
+ msg = f"module '{__name__}' has no attribute '{attr_name}'"
21
+ raise AttributeError(msg)
22
+ try:
23
+ result = import_mod(attr_name, _dynamic_imports[attr_name], __spec__.parent)
24
+ except (ModuleNotFoundError, ImportError, AttributeError) as e:
25
+ msg = f"Could not import '{attr_name}' from '{__name__}': {e}"
26
+ raise AttributeError(msg) from e
27
+ globals()[attr_name] = result
28
+ return result
29
+
30
+
31
+ def __dir__() -> list[str]:
32
+ return list(__all__)
@@ -1,5 +1,40 @@
1
- from .cleanlab_evaluator import CleanlabEvaluator
2
- from .cleanlab_rag_evaluator import CleanlabRAGEvaluator
3
- from .cleanlab_remediator import CleanlabRemediator
1
+ from __future__ import annotations
4
2
 
5
- __all__ = ["CleanlabEvaluator", "CleanlabRAGEvaluator", "CleanlabRemediator"]
3
+ from typing import TYPE_CHECKING, Any
4
+
5
+ from langflow.components._importing import import_mod
6
+
7
+ if TYPE_CHECKING:
8
+ from .cleanlab_evaluator import CleanlabEvaluator
9
+ from .cleanlab_rag_evaluator import CleanlabRAGEvaluator
10
+ from .cleanlab_remediator import CleanlabRemediator
11
+
12
+ _dynamic_imports = {
13
+ "CleanlabEvaluator": "cleanlab_evaluator",
14
+ "CleanlabRAGEvaluator": "cleanlab_rag_evaluator",
15
+ "CleanlabRemediator": "cleanlab_remediator",
16
+ }
17
+
18
+ __all__ = [
19
+ "CleanlabEvaluator",
20
+ "CleanlabRAGEvaluator",
21
+ "CleanlabRemediator",
22
+ ]
23
+
24
+
25
+ def __getattr__(attr_name: str) -> Any:
26
+ """Lazily import cleanlab components on attribute access."""
27
+ if attr_name not in _dynamic_imports:
28
+ msg = f"module '{__name__}' has no attribute '{attr_name}'"
29
+ raise AttributeError(msg)
30
+ try:
31
+ result = import_mod(attr_name, _dynamic_imports[attr_name], __spec__.parent)
32
+ except (ModuleNotFoundError, ImportError, AttributeError) as e:
33
+ msg = f"Could not import '{attr_name}' from '{__name__}': {e}"
34
+ raise AttributeError(msg) from e
35
+ globals()[attr_name] = result
36
+ return result
37
+
38
+
39
+ def __dir__() -> list[str]:
40
+ return list(__all__)
@@ -1,3 +1,32 @@
1
- from .cloudflare import CloudflareWorkersAIEmbeddingsComponent
1
+ from __future__ import annotations
2
+
3
+ from typing import TYPE_CHECKING, Any
4
+
5
+ from langflow.components._importing import import_mod
6
+
7
+ if TYPE_CHECKING:
8
+ from langflow.components.cloudflare.cloudflare import CloudflareWorkersAIEmbeddingsComponent
9
+
10
+ _dynamic_imports = {
11
+ "CloudflareWorkersAIEmbeddingsComponent": "cloudflare",
12
+ }
2
13
 
3
14
  __all__ = ["CloudflareWorkersAIEmbeddingsComponent"]
15
+
16
+
17
+ def __getattr__(attr_name: str) -> Any:
18
+ """Lazily import cloudflare components on attribute access."""
19
+ if attr_name not in _dynamic_imports:
20
+ msg = f"module '{__name__}' has no attribute '{attr_name}'"
21
+ raise AttributeError(msg)
22
+ try:
23
+ result = import_mod(attr_name, _dynamic_imports[attr_name], __spec__.parent)
24
+ except (ModuleNotFoundError, ImportError, AttributeError) as e:
25
+ msg = f"Could not import '{attr_name}' from '{__name__}': {e}"
26
+ raise AttributeError(msg) from e
27
+ globals()[attr_name] = result
28
+ return result
29
+
30
+
31
+ def __dir__() -> list[str]:
32
+ return list(__all__)
@@ -1,5 +1,40 @@
1
- from .cohere_embeddings import CohereEmbeddingsComponent
2
- from .cohere_models import CohereComponent
3
- from .cohere_rerank import CohereRerankComponent
1
+ from __future__ import annotations
4
2
 
5
- __all__ = ["CohereComponent", "CohereEmbeddingsComponent", "CohereRerankComponent"]
3
+ from typing import TYPE_CHECKING, Any
4
+
5
+ from langflow.components._importing import import_mod
6
+
7
+ if TYPE_CHECKING:
8
+ from .cohere_embeddings import CohereEmbeddingsComponent
9
+ from .cohere_models import CohereComponent
10
+ from .cohere_rerank import CohereRerankComponent
11
+
12
+ _dynamic_imports = {
13
+ "CohereComponent": "cohere_models",
14
+ "CohereEmbeddingsComponent": "cohere_embeddings",
15
+ "CohereRerankComponent": "cohere_rerank",
16
+ }
17
+
18
+ __all__ = [
19
+ "CohereComponent",
20
+ "CohereEmbeddingsComponent",
21
+ "CohereRerankComponent",
22
+ ]
23
+
24
+
25
+ def __getattr__(attr_name: str) -> Any:
26
+ """Lazily import cohere components on attribute access."""
27
+ if attr_name not in _dynamic_imports:
28
+ msg = f"module '{__name__}' has no attribute '{attr_name}'"
29
+ raise AttributeError(msg)
30
+ try:
31
+ result = import_mod(attr_name, _dynamic_imports[attr_name], __spec__.parent)
32
+ except (ModuleNotFoundError, ImportError, AttributeError) as e:
33
+ msg = f"Could not import '{attr_name}' from '{__name__}': {e}"
34
+ raise AttributeError(msg) from e
35
+ globals()[attr_name] = result
36
+ return result
37
+
38
+
39
+ def __dir__() -> list[str]:
40
+ return list(__all__)