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
@@ -1,9 +1,25 @@
1
- from .composio_api import ComposioAPIComponent
2
- from .github_composio import ComposioGitHubAPIComponent
3
- from .gmail_composio import ComposioGmailAPIComponent
4
- from .googlecalendar_composio import ComposioGoogleCalendarAPIComponent
5
- from .outlook_composio import ComposioOutlookAPIComponent
6
- from .slack_composio import ComposioSlackAPIComponent
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 .composio_api import ComposioAPIComponent
9
+ from .github_composio import ComposioGitHubAPIComponent
10
+ from .gmail_composio import ComposioGmailAPIComponent
11
+ from .googlecalendar_composio import ComposioGoogleCalendarAPIComponent
12
+ from .outlook_composio import ComposioOutlookAPIComponent
13
+ from .slack_composio import ComposioSlackAPIComponent
14
+
15
+ _dynamic_imports = {
16
+ "ComposioAPIComponent": "composio_api",
17
+ "ComposioGitHubAPIComponent": "github_composio",
18
+ "ComposioGmailAPIComponent": "gmail_composio",
19
+ "ComposioGoogleCalendarAPIComponent": "googlecalendar_composio",
20
+ "ComposioOutlookAPIComponent": "outlook_composio",
21
+ "ComposioSlackAPIComponent": "slack_composio",
22
+ }
7
23
 
8
24
  __all__ = [
9
25
  "ComposioAPIComponent",
@@ -13,3 +29,21 @@ __all__ = [
13
29
  "ComposioOutlookAPIComponent",
14
30
  "ComposioSlackAPIComponent",
15
31
  ]
32
+
33
+
34
+ def __getattr__(attr_name: str) -> Any:
35
+ """Lazily import composio components on attribute access."""
36
+ if attr_name not in _dynamic_imports:
37
+ msg = f"module '{__name__}' has no attribute '{attr_name}'"
38
+ raise AttributeError(msg)
39
+ try:
40
+ result = import_mod(attr_name, _dynamic_imports[attr_name], __spec__.parent)
41
+ except (ModuleNotFoundError, ImportError, AttributeError) as e:
42
+ msg = f"Could not import '{attr_name}' from '{__name__}': {e}"
43
+ raise AttributeError(msg) from e
44
+ globals()[attr_name] = result
45
+ return result
46
+
47
+
48
+ def __dir__() -> list[str]:
49
+ return list(__all__)
@@ -1,9 +1,25 @@
1
- from .crewai import CrewAIAgentComponent
2
- from .hierarchical_crew import HierarchicalCrewComponent
3
- from .hierarchical_task import HierarchicalTaskComponent
4
- from .sequential_crew import SequentialCrewComponent
5
- from .sequential_task import SequentialTaskComponent
6
- from .sequential_task_agent import SequentialTaskAgentComponent
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 .crewai import CrewAIAgentComponent
9
+ from .hierarchical_crew import HierarchicalCrewComponent
10
+ from .hierarchical_task import HierarchicalTaskComponent
11
+ from .sequential_crew import SequentialCrewComponent
12
+ from .sequential_task import SequentialTaskComponent
13
+ from .sequential_task_agent import SequentialTaskAgentComponent
14
+
15
+ _dynamic_imports = {
16
+ "CrewAIAgentComponent": "crewai",
17
+ "HierarchicalCrewComponent": "hierarchical_crew",
18
+ "HierarchicalTaskComponent": "hierarchical_task",
19
+ "SequentialCrewComponent": "sequential_crew",
20
+ "SequentialTaskAgentComponent": "sequential_task_agent",
21
+ "SequentialTaskComponent": "sequential_task",
22
+ }
7
23
 
8
24
  __all__ = [
9
25
  "CrewAIAgentComponent",
@@ -13,3 +29,21 @@ __all__ = [
13
29
  "SequentialTaskAgentComponent",
14
30
  "SequentialTaskComponent",
15
31
  ]
32
+
33
+
34
+ def __getattr__(attr_name: str) -> Any:
35
+ """Lazily import crewai components on attribute access."""
36
+ if attr_name not in _dynamic_imports:
37
+ msg = f"module '{__name__}' has no attribute '{attr_name}'"
38
+ raise AttributeError(msg)
39
+ try:
40
+ result = import_mod(attr_name, _dynamic_imports[attr_name], __spec__.parent)
41
+ except (ModuleNotFoundError, ImportError, AttributeError) as e:
42
+ msg = f"Could not import '{attr_name}' from '{__name__}': {e}"
43
+ raise AttributeError(msg) from e
44
+ globals()[attr_name] = result
45
+ return result
46
+
47
+
48
+ def __dir__() -> list[str]:
49
+ return list(__all__)
@@ -1,5 +1,34 @@
1
- from .custom_component import CustomComponent
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 .custom_component import CustomComponent
9
+
10
+ _dynamic_imports = {
11
+ "CustomComponent": "custom_component",
12
+ }
2
13
 
3
14
  __all__ = [
4
15
  "CustomComponent",
5
16
  ]
17
+
18
+
19
+ def __getattr__(attr_name: str) -> Any:
20
+ """Lazily import custom 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,16 +1,39 @@
1
- from .astra_assistant_manager import AstraAssistantManager
2
- from .astra_db import AstraDBChatMemory
3
- from .astra_vectorize import AstraVectorizeComponent
4
- from .astradb_cql import AstraDBCQLToolComponent
5
- from .astradb_tool import AstraDBToolComponent
6
- from .cassandra import CassandraChatMemory
7
- from .create_assistant import AssistantsCreateAssistant
8
- from .create_thread import AssistantsCreateThread
9
- from .dotenv import Dotenv
10
- from .get_assistant import AssistantsGetAssistantName
11
- from .getenvvar import GetEnvVar
12
- from .list_assistants import AssistantsListAssistants
13
- from .run import AssistantsRun
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 .astra_assistant_manager import AstraAssistantManager
9
+ from .astra_db import AstraDBChatMemory
10
+ from .astra_vectorize import AstraVectorizeComponent
11
+ from .astradb_cql import AstraDBCQLToolComponent
12
+ from .astradb_tool import AstraDBToolComponent
13
+ from .cassandra import CassandraChatMemory
14
+ from .create_assistant import AssistantsCreateAssistant
15
+ from .create_thread import AssistantsCreateThread
16
+ from .dotenv import Dotenv
17
+ from .get_assistant import AssistantsGetAssistantName
18
+ from .getenvvar import GetEnvVar
19
+ from .list_assistants import AssistantsListAssistants
20
+ from .run import AssistantsRun
21
+
22
+ _dynamic_imports = {
23
+ "AssistantsCreateAssistant": "create_assistant",
24
+ "AssistantsCreateThread": "create_thread",
25
+ "AssistantsGetAssistantName": "get_assistant",
26
+ "AssistantsListAssistants": "list_assistants",
27
+ "AssistantsRun": "run",
28
+ "AstraAssistantManager": "astra_assistant_manager",
29
+ "AstraDBCQLToolComponent": "astradb_cql",
30
+ "AstraDBChatMemory": "astra_db",
31
+ "AstraDBToolComponent": "astradb_tool",
32
+ "AstraVectorizeComponent": "astra_vectorize",
33
+ "CassandraChatMemory": "cassandra",
34
+ "Dotenv": "dotenv",
35
+ "GetEnvVar": "getenvvar",
36
+ }
14
37
 
15
38
  __all__ = [
16
39
  "AssistantsCreateAssistant",
@@ -27,3 +50,21 @@ __all__ = [
27
50
  "Dotenv",
28
51
  "GetEnvVar",
29
52
  ]
53
+
54
+
55
+ def __getattr__(attr_name: str) -> Any:
56
+ """Lazily import datastax components on attribute access."""
57
+ if attr_name not in _dynamic_imports:
58
+ msg = f"module '{__name__}' has no attribute '{attr_name}'"
59
+ raise AttributeError(msg)
60
+ try:
61
+ result = import_mod(attr_name, _dynamic_imports[attr_name], __spec__.parent)
62
+ except (ModuleNotFoundError, ImportError, AttributeError) as e:
63
+ msg = f"Could not import '{attr_name}' from '{__name__}': {e}"
64
+ raise AttributeError(msg) from e
65
+ globals()[attr_name] = result
66
+ return result
67
+
68
+
69
+ def __dir__() -> list[str]:
70
+ return list(__all__)
@@ -1,3 +1,34 @@
1
- from .deepseek import DeepSeekModelComponent
1
+ from __future__ import annotations
2
2
 
3
- __all__ = ["DeepSeekModelComponent"]
3
+ from typing import TYPE_CHECKING, Any
4
+
5
+ from langflow.components._importing import import_mod
6
+
7
+ if TYPE_CHECKING:
8
+ from .deepseek import DeepSeekModelComponent
9
+
10
+ _dynamic_imports = {
11
+ "DeepSeekModelComponent": "deepseek",
12
+ }
13
+
14
+ __all__ = [
15
+ "DeepSeekModelComponent",
16
+ ]
17
+
18
+
19
+ def __getattr__(attr_name: str) -> Any:
20
+ """Lazily import deepseek 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,7 +1,21 @@
1
- from .chunk_docling_document import ChunkDoclingDocumentComponent
2
- from .docling_inline import DoclingInlineComponent
3
- from .docling_remote import DoclingRemoteComponent
4
- from .export_docling_document import ExportDoclingDocumentComponent
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 .chunk_docling_document import ChunkDoclingDocumentComponent
9
+ from .docling_inline import DoclingInlineComponent
10
+ from .docling_remote import DoclingRemoteComponent
11
+ from .export_docling_document import ExportDoclingDocumentComponent
12
+
13
+ _dynamic_imports = {
14
+ "ChunkDoclingDocumentComponent": "chunk_docling_document",
15
+ "DoclingInlineComponent": "docling_inline",
16
+ "DoclingRemoteComponent": "docling_remote",
17
+ "ExportDoclingDocumentComponent": "export_docling_document",
18
+ }
5
19
 
6
20
  __all__ = [
7
21
  "ChunkDoclingDocumentComponent",
@@ -9,3 +23,21 @@ __all__ = [
9
23
  "DoclingRemoteComponent",
10
24
  "ExportDoclingDocumentComponent",
11
25
  ]
26
+
27
+
28
+ def __getattr__(attr_name: str) -> Any:
29
+ """Lazily import docling components on attribute access."""
30
+ if attr_name not in _dynamic_imports:
31
+ msg = f"module '{__name__}' has no attribute '{attr_name}'"
32
+ raise AttributeError(msg)
33
+ try:
34
+ result = import_mod(attr_name, _dynamic_imports[attr_name], __spec__.parent)
35
+ except (ModuleNotFoundError, ImportError, AttributeError) as e:
36
+ msg = f"Could not import '{attr_name}' from '{__name__}': {e}"
37
+ raise AttributeError(msg) from e
38
+ globals()[attr_name] = result
39
+ return result
40
+
41
+
42
+ def __dir__() -> list[str]:
43
+ return list(__all__)
@@ -1,9 +1,37 @@
1
- from .similarity import EmbeddingSimilarityComponent
2
- from .text_embedder import TextEmbedderComponent
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.embeddings.similarity import EmbeddingSimilarityComponent
9
+ from langflow.components.embeddings.text_embedder import TextEmbedderComponent
10
+
11
+ _dynamic_imports = {
12
+ "EmbeddingSimilarityComponent": "similarity",
13
+ "TextEmbedderComponent": "text_embedder",
14
+ }
3
15
 
4
16
  __all__ = [
5
- "CloudflareWorkersAIEmbeddingsComponent",
6
17
  "EmbeddingSimilarityComponent",
7
- "MistralAIEmbeddingsComponent",
8
18
  "TextEmbedderComponent",
9
19
  ]
20
+
21
+
22
+ def __getattr__(attr_name: str) -> Any:
23
+ """Lazily import embedding 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,6 +1,43 @@
1
- from .firecrawl_crawl_api import FirecrawlCrawlApi
2
- from .firecrawl_extract_api import FirecrawlExtractApi
3
- from .firecrawl_map_api import FirecrawlMapApi
4
- from .firecrawl_scrape_api import FirecrawlScrapeApi
1
+ from __future__ import annotations
5
2
 
6
- __all__ = ["FirecrawlCrawlApi", "FirecrawlExtractApi", "FirecrawlMapApi", "FirecrawlScrapeApi"]
3
+ from typing import TYPE_CHECKING, Any
4
+
5
+ from langflow.components._importing import import_mod
6
+
7
+ if TYPE_CHECKING:
8
+ from .firecrawl_crawl_api import FirecrawlCrawlApi
9
+ from .firecrawl_extract_api import FirecrawlExtractApi
10
+ from .firecrawl_map_api import FirecrawlMapApi
11
+ from .firecrawl_scrape_api import FirecrawlScrapeApi
12
+
13
+ _dynamic_imports = {
14
+ "FirecrawlCrawlApi": "firecrawl_crawl_api",
15
+ "FirecrawlExtractApi": "firecrawl_extract_api",
16
+ "FirecrawlMapApi": "firecrawl_map_api",
17
+ "FirecrawlScrapeApi": "firecrawl_scrape_api",
18
+ }
19
+
20
+ __all__ = [
21
+ "FirecrawlCrawlApi",
22
+ "FirecrawlExtractApi",
23
+ "FirecrawlMapApi",
24
+ "FirecrawlScrapeApi",
25
+ ]
26
+
27
+
28
+ def __getattr__(attr_name: str) -> Any:
29
+ """Lazily import firecrawl components on attribute access."""
30
+ if attr_name not in _dynamic_imports:
31
+ msg = f"module '{__name__}' has no attribute '{attr_name}'"
32
+ raise AttributeError(msg)
33
+ try:
34
+ result = import_mod(attr_name, _dynamic_imports[attr_name], __spec__.parent)
35
+ except (ModuleNotFoundError, ImportError, AttributeError) as e:
36
+ msg = f"Could not import '{attr_name}' from '{__name__}': {e}"
37
+ raise AttributeError(msg) from e
38
+ globals()[attr_name] = result
39
+ return result
40
+
41
+
42
+ def __dir__() -> list[str]:
43
+ return list(__all__)
@@ -1,3 +1,34 @@
1
- from .groq import GroqModel
1
+ from __future__ import annotations
2
2
 
3
- __all__ = ["GroqModel"]
3
+ from typing import TYPE_CHECKING, Any
4
+
5
+ from langflow.components._importing import import_mod
6
+
7
+ if TYPE_CHECKING:
8
+ from .groq import GroqModel
9
+
10
+ _dynamic_imports = {
11
+ "GroqModel": "groq",
12
+ }
13
+
14
+ __all__ = [
15
+ "GroqModel",
16
+ ]
17
+
18
+
19
+ def __getattr__(attr_name: str) -> Any:
20
+ """Lazily import groq 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,10 +1,27 @@
1
- from .calculator_core import CalculatorComponent
2
- from .create_list import CreateListComponent
3
- from .current_date import CurrentDateComponent
4
- from .id_generator import IDGeneratorComponent
5
- from .memory import MemoryComponent
6
- from .output_parser import OutputParserComponent
7
- from .store_message import MessageStoreComponent
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.helpers.calculator_core import CalculatorComponent
9
+ from langflow.components.helpers.create_list import CreateListComponent
10
+ from langflow.components.helpers.current_date import CurrentDateComponent
11
+ from langflow.components.helpers.id_generator import IDGeneratorComponent
12
+ from langflow.components.helpers.memory import MemoryComponent
13
+ from langflow.components.helpers.output_parser import OutputParserComponent
14
+ from langflow.components.helpers.store_message import MessageStoreComponent
15
+
16
+ _dynamic_imports = {
17
+ "CalculatorComponent": "calculator_core",
18
+ "CreateListComponent": "create_list",
19
+ "CurrentDateComponent": "current_date",
20
+ "IDGeneratorComponent": "id_generator",
21
+ "MemoryComponent": "memory",
22
+ "OutputParserComponent": "output_parser",
23
+ "MessageStoreComponent": "store_message",
24
+ }
8
25
 
9
26
  __all__ = [
10
27
  "CalculatorComponent",
@@ -15,3 +32,21 @@ __all__ = [
15
32
  "MessageStoreComponent",
16
33
  "OutputParserComponent",
17
34
  ]
35
+
36
+
37
+ def __getattr__(attr_name: str) -> Any:
38
+ """Lazily import helper components on attribute access."""
39
+ if attr_name not in _dynamic_imports:
40
+ msg = f"module '{__name__}' has no attribute '{attr_name}'"
41
+ raise AttributeError(msg)
42
+ try:
43
+ result = import_mod(attr_name, _dynamic_imports[attr_name], __spec__.parent)
44
+ except (ModuleNotFoundError, ImportError, AttributeError) as e:
45
+ msg = f"Could not import '{attr_name}' from '{__name__}': {e}"
46
+ raise AttributeError(msg) from e
47
+ globals()[attr_name] = result
48
+ return result
49
+
50
+
51
+ def __dir__() -> list[str]:
52
+ return list(__all__)
@@ -1,7 +1,37 @@
1
- from .huggingface import HuggingFaceEndpointsComponent
2
- from .huggingface_inference_api import HuggingFaceInferenceAPIEmbeddingsComponent
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 .huggingface import HuggingFaceEndpointsComponent
9
+ from .huggingface_inference_api import HuggingFaceInferenceAPIEmbeddingsComponent
10
+
11
+ _dynamic_imports = {
12
+ "HuggingFaceEndpointsComponent": "huggingface",
13
+ "HuggingFaceInferenceAPIEmbeddingsComponent": "huggingface_inference_api",
14
+ }
3
15
 
4
16
  __all__ = [
5
17
  "HuggingFaceEndpointsComponent",
6
18
  "HuggingFaceInferenceAPIEmbeddingsComponent",
7
19
  ]
20
+
21
+
22
+ def __getattr__(attr_name: str) -> Any:
23
+ """Lazily import huggingface 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,4 +1,34 @@
1
- from .watsonx import WatsonxAIComponent
2
- from .watsonx_embeddings import WatsonxEmbeddingsComponent
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.ibm.watsonx import WatsonxAIComponent
9
+ from langflow.components.ibm.watsonx_embeddings import WatsonxEmbeddingsComponent
10
+
11
+ _dynamic_imports = {
12
+ "WatsonxAIComponent": "watsonx",
13
+ "WatsonxEmbeddingsComponent": "watsonx_embeddings",
14
+ }
3
15
 
4
16
  __all__ = ["WatsonxAIComponent", "WatsonxEmbeddingsComponent"]
17
+
18
+
19
+ def __getattr__(attr_name: str) -> Any:
20
+ """Lazily import ibm 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,6 +1,38 @@
1
- from .chat import ChatInput
2
- from .chat_output import ChatOutput
3
- from .text import TextInputComponent
4
- from .text_output import TextOutputComponent
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.input_output.chat import ChatInput
9
+ from langflow.components.input_output.chat_output import ChatOutput
10
+ from langflow.components.input_output.text import TextInputComponent
11
+ from langflow.components.input_output.text_output import TextOutputComponent
12
+
13
+ _dynamic_imports = {
14
+ "ChatInput": "chat",
15
+ "ChatOutput": "chat_output",
16
+ "TextInputComponent": "text",
17
+ "TextOutputComponent": "text_output",
18
+ }
5
19
 
6
20
  __all__ = ["ChatInput", "ChatOutput", "TextInputComponent", "TextOutputComponent"]
21
+
22
+
23
+ def __getattr__(attr_name: str) -> Any:
24
+ """Lazily import input/output components on attribute access."""
25
+ if attr_name not in _dynamic_imports:
26
+ msg = f"module '{__name__}' has no attribute '{attr_name}'"
27
+ raise AttributeError(msg)
28
+ try:
29
+ result = import_mod(attr_name, _dynamic_imports[attr_name], __spec__.parent)
30
+ except (ModuleNotFoundError, ImportError, AttributeError) as e:
31
+ msg = f"Could not import '{attr_name}' from '{__name__}': {e}"
32
+ raise AttributeError(msg) from e
33
+ globals()[attr_name] = result
34
+ return result
35
+
36
+
37
+ def __dir__() -> list[str]:
38
+ return list(__all__)