lfx-nightly 0.2.0.dev41__py3-none-any.whl → 0.3.0.dev3__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 (98) hide show
  1. lfx/__main__.py +137 -6
  2. lfx/_assets/component_index.json +1 -1
  3. lfx/base/agents/agent.py +10 -6
  4. lfx/base/agents/altk_base_agent.py +5 -3
  5. lfx/base/agents/altk_tool_wrappers.py +1 -1
  6. lfx/base/agents/events.py +1 -1
  7. lfx/base/agents/utils.py +4 -0
  8. lfx/base/composio/composio_base.py +78 -41
  9. lfx/base/data/cloud_storage_utils.py +156 -0
  10. lfx/base/data/docling_utils.py +130 -55
  11. lfx/base/datastax/astradb_base.py +75 -64
  12. lfx/base/embeddings/embeddings_class.py +113 -0
  13. lfx/base/models/__init__.py +11 -1
  14. lfx/base/models/google_generative_ai_constants.py +33 -9
  15. lfx/base/models/model_metadata.py +6 -0
  16. lfx/base/models/ollama_constants.py +196 -30
  17. lfx/base/models/openai_constants.py +37 -10
  18. lfx/base/models/unified_models.py +1123 -0
  19. lfx/base/models/watsonx_constants.py +43 -4
  20. lfx/base/prompts/api_utils.py +40 -5
  21. lfx/base/tools/component_tool.py +2 -9
  22. lfx/cli/__init__.py +10 -2
  23. lfx/cli/commands.py +3 -0
  24. lfx/cli/run.py +65 -409
  25. lfx/cli/script_loader.py +18 -7
  26. lfx/cli/validation.py +6 -3
  27. lfx/components/__init__.py +0 -3
  28. lfx/components/composio/github_composio.py +1 -1
  29. lfx/components/cuga/cuga_agent.py +39 -27
  30. lfx/components/data_source/api_request.py +4 -2
  31. lfx/components/datastax/astradb_assistant_manager.py +4 -2
  32. lfx/components/docling/__init__.py +45 -11
  33. lfx/components/docling/docling_inline.py +39 -49
  34. lfx/components/docling/docling_remote.py +1 -0
  35. lfx/components/elastic/opensearch_multimodal.py +1733 -0
  36. lfx/components/files_and_knowledge/file.py +384 -36
  37. lfx/components/files_and_knowledge/ingestion.py +8 -0
  38. lfx/components/files_and_knowledge/retrieval.py +10 -0
  39. lfx/components/files_and_knowledge/save_file.py +91 -88
  40. lfx/components/langchain_utilities/ibm_granite_handler.py +211 -0
  41. lfx/components/langchain_utilities/tool_calling.py +37 -6
  42. lfx/components/llm_operations/batch_run.py +64 -18
  43. lfx/components/llm_operations/lambda_filter.py +213 -101
  44. lfx/components/llm_operations/llm_conditional_router.py +39 -7
  45. lfx/components/llm_operations/structured_output.py +38 -12
  46. lfx/components/models/__init__.py +16 -74
  47. lfx/components/models_and_agents/agent.py +51 -203
  48. lfx/components/models_and_agents/embedding_model.py +171 -255
  49. lfx/components/models_and_agents/language_model.py +54 -318
  50. lfx/components/models_and_agents/mcp_component.py +96 -10
  51. lfx/components/models_and_agents/prompt.py +105 -18
  52. lfx/components/ollama/ollama_embeddings.py +111 -29
  53. lfx/components/openai/openai_chat_model.py +1 -1
  54. lfx/components/processing/text_operations.py +580 -0
  55. lfx/components/vllm/__init__.py +37 -0
  56. lfx/components/vllm/vllm.py +141 -0
  57. lfx/components/vllm/vllm_embeddings.py +110 -0
  58. lfx/custom/custom_component/component.py +65 -10
  59. lfx/custom/custom_component/custom_component.py +8 -6
  60. lfx/events/observability/__init__.py +0 -0
  61. lfx/events/observability/lifecycle_events.py +111 -0
  62. lfx/field_typing/__init__.py +57 -58
  63. lfx/graph/graph/base.py +40 -1
  64. lfx/graph/utils.py +109 -30
  65. lfx/graph/vertex/base.py +75 -23
  66. lfx/graph/vertex/vertex_types.py +0 -5
  67. lfx/inputs/__init__.py +2 -0
  68. lfx/inputs/input_mixin.py +55 -0
  69. lfx/inputs/inputs.py +120 -0
  70. lfx/interface/components.py +24 -7
  71. lfx/interface/initialize/loading.py +42 -12
  72. lfx/io/__init__.py +2 -0
  73. lfx/run/__init__.py +5 -0
  74. lfx/run/base.py +464 -0
  75. lfx/schema/__init__.py +50 -0
  76. lfx/schema/data.py +1 -1
  77. lfx/schema/image.py +26 -7
  78. lfx/schema/message.py +104 -11
  79. lfx/schema/workflow.py +171 -0
  80. lfx/services/deps.py +12 -0
  81. lfx/services/interfaces.py +43 -1
  82. lfx/services/mcp_composer/service.py +7 -1
  83. lfx/services/schema.py +1 -0
  84. lfx/services/settings/auth.py +95 -4
  85. lfx/services/settings/base.py +11 -1
  86. lfx/services/settings/constants.py +2 -0
  87. lfx/services/settings/utils.py +82 -0
  88. lfx/services/storage/local.py +13 -8
  89. lfx/services/transaction/__init__.py +5 -0
  90. lfx/services/transaction/service.py +35 -0
  91. lfx/tests/unit/components/__init__.py +0 -0
  92. lfx/utils/constants.py +2 -0
  93. lfx/utils/mustache_security.py +79 -0
  94. lfx/utils/validate_cloud.py +81 -3
  95. {lfx_nightly-0.2.0.dev41.dist-info → lfx_nightly-0.3.0.dev3.dist-info}/METADATA +7 -2
  96. {lfx_nightly-0.2.0.dev41.dist-info → lfx_nightly-0.3.0.dev3.dist-info}/RECORD +98 -80
  97. {lfx_nightly-0.2.0.dev41.dist-info → lfx_nightly-0.3.0.dev3.dist-info}/WHEEL +0 -0
  98. {lfx_nightly-0.2.0.dev41.dist-info → lfx_nightly-0.3.0.dev3.dist-info}/entry_points.txt +0 -0
lfx/__main__.py CHANGED
@@ -2,18 +2,149 @@
2
2
 
3
3
  import typer
4
4
 
5
- from lfx.cli.commands import serve_command
6
- from lfx.cli.run import run
7
-
8
5
  app = typer.Typer(
9
6
  name="lfx",
10
7
  help="lfx - Langflow Executor",
11
8
  add_completion=False,
12
9
  )
13
10
 
14
- # Add commands
15
- app.command(name="serve", help="Serve a flow as an API", no_args_is_help=True)(serve_command)
16
- app.command(name="run", help="Run a flow directly", no_args_is_help=True)(run)
11
+
12
+ @app.command(name="serve", help="Serve a flow as an API", no_args_is_help=True)
13
+ def serve_command_wrapper(
14
+ script_path: str | None = typer.Argument(
15
+ None,
16
+ help=(
17
+ "Path to JSON flow (.json) or Python script (.py) file or stdin input. "
18
+ "Optional when using --flow-json or --stdin."
19
+ ),
20
+ ),
21
+ host: str = typer.Option("127.0.0.1", "--host", "-h", help="Host to bind the server to"),
22
+ port: int = typer.Option(8000, "--port", "-p", help="Port to bind the server to"),
23
+ verbose: bool = typer.Option(False, "--verbose", "-v", help="Show diagnostic output and execution details"), # noqa: FBT001, FBT003
24
+ env_file: str | None = typer.Option(
25
+ None,
26
+ "--env-file",
27
+ help="Path to the .env file containing environment variables",
28
+ ),
29
+ log_level: str = typer.Option(
30
+ "warning",
31
+ "--log-level",
32
+ help="Logging level. One of: debug, info, warning, error, critical",
33
+ ),
34
+ flow_json: str | None = typer.Option(
35
+ None,
36
+ "--flow-json",
37
+ help="Inline JSON flow content as a string (alternative to script_path)",
38
+ ),
39
+ *,
40
+ stdin: bool = typer.Option(
41
+ False, # noqa: FBT003
42
+ "--stdin",
43
+ help="Read JSON flow content from stdin (alternative to script_path)",
44
+ ),
45
+ check_variables: bool = typer.Option(
46
+ True, # noqa: FBT003
47
+ "--check-variables/--no-check-variables",
48
+ help="Check global variables for environment compatibility",
49
+ ),
50
+ ) -> None:
51
+ """Serve LFX flows as a web API (lazy-loaded)."""
52
+ from pathlib import Path
53
+
54
+ from lfx.cli.commands import serve_command
55
+
56
+ # Convert env_file string to Path if provided
57
+ env_file_path = Path(env_file) if env_file else None
58
+
59
+ return serve_command(
60
+ script_path=script_path,
61
+ host=host,
62
+ port=port,
63
+ verbose=verbose,
64
+ env_file=env_file_path,
65
+ log_level=log_level,
66
+ flow_json=flow_json,
67
+ stdin=stdin,
68
+ check_variables=check_variables,
69
+ )
70
+
71
+
72
+ @app.command(name="run", help="Run a flow directly", no_args_is_help=True)
73
+ def run_command_wrapper(
74
+ script_path: str | None = typer.Argument(
75
+ None, help="Path to the Python script (.py) or JSON flow (.json) containing a graph"
76
+ ),
77
+ input_value: str | None = typer.Argument(None, help="Input value to pass to the graph"),
78
+ input_value_option: str | None = typer.Option(
79
+ None,
80
+ "--input-value",
81
+ help="Input value to pass to the graph (alternative to positional argument)",
82
+ ),
83
+ output_format: str = typer.Option(
84
+ "json",
85
+ "--format",
86
+ "-f",
87
+ help="Output format: json, text, message, or result",
88
+ ),
89
+ flow_json: str | None = typer.Option(
90
+ None,
91
+ "--flow-json",
92
+ help="Inline JSON flow content as a string (alternative to script_path)",
93
+ ),
94
+ *,
95
+ stdin: bool = typer.Option(
96
+ default=False,
97
+ show_default=True,
98
+ help="Read JSON flow content from stdin (alternative to script_path)",
99
+ ),
100
+ check_variables: bool = typer.Option(
101
+ default=True,
102
+ show_default=True,
103
+ help="Check global variables for environment compatibility",
104
+ ),
105
+ verbose: bool = typer.Option(
106
+ False, # noqa: FBT003
107
+ "-v",
108
+ "--verbose",
109
+ help="Show basic progress information",
110
+ ),
111
+ verbose_detailed: bool = typer.Option(
112
+ False, # noqa: FBT003
113
+ "-vv",
114
+ help="Show detailed progress and debug information",
115
+ ),
116
+ verbose_full: bool = typer.Option(
117
+ False, # noqa: FBT003
118
+ "-vvv",
119
+ help="Show full debugging output including component logs",
120
+ ),
121
+ timing: bool = typer.Option(
122
+ default=False,
123
+ show_default=True,
124
+ help="Include detailed timing information in output",
125
+ ),
126
+ ) -> None:
127
+ """Run a flow directly (lazy-loaded)."""
128
+ from pathlib import Path
129
+
130
+ from lfx.cli.run import run
131
+
132
+ # Convert script_path string to Path if provided
133
+ script_path_obj = Path(script_path) if script_path else None
134
+
135
+ return run(
136
+ script_path=script_path_obj,
137
+ input_value=input_value,
138
+ input_value_option=input_value_option,
139
+ output_format=output_format,
140
+ flow_json=flow_json,
141
+ stdin=stdin,
142
+ check_variables=check_variables,
143
+ verbose=verbose,
144
+ verbose_detailed=verbose_detailed,
145
+ verbose_full=verbose_full,
146
+ timing=timing,
147
+ )
17
148
 
18
149
 
19
150
  def main():