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.
- lfx/__main__.py +137 -6
- lfx/_assets/component_index.json +1 -1
- lfx/base/agents/agent.py +10 -6
- lfx/base/agents/altk_base_agent.py +5 -3
- lfx/base/agents/altk_tool_wrappers.py +1 -1
- lfx/base/agents/events.py +1 -1
- lfx/base/agents/utils.py +4 -0
- lfx/base/composio/composio_base.py +78 -41
- lfx/base/data/cloud_storage_utils.py +156 -0
- lfx/base/data/docling_utils.py +130 -55
- lfx/base/datastax/astradb_base.py +75 -64
- lfx/base/embeddings/embeddings_class.py +113 -0
- lfx/base/models/__init__.py +11 -1
- lfx/base/models/google_generative_ai_constants.py +33 -9
- lfx/base/models/model_metadata.py +6 -0
- lfx/base/models/ollama_constants.py +196 -30
- lfx/base/models/openai_constants.py +37 -10
- lfx/base/models/unified_models.py +1123 -0
- lfx/base/models/watsonx_constants.py +43 -4
- lfx/base/prompts/api_utils.py +40 -5
- lfx/base/tools/component_tool.py +2 -9
- lfx/cli/__init__.py +10 -2
- lfx/cli/commands.py +3 -0
- lfx/cli/run.py +65 -409
- lfx/cli/script_loader.py +18 -7
- lfx/cli/validation.py +6 -3
- lfx/components/__init__.py +0 -3
- lfx/components/composio/github_composio.py +1 -1
- lfx/components/cuga/cuga_agent.py +39 -27
- lfx/components/data_source/api_request.py +4 -2
- lfx/components/datastax/astradb_assistant_manager.py +4 -2
- lfx/components/docling/__init__.py +45 -11
- lfx/components/docling/docling_inline.py +39 -49
- lfx/components/docling/docling_remote.py +1 -0
- lfx/components/elastic/opensearch_multimodal.py +1733 -0
- lfx/components/files_and_knowledge/file.py +384 -36
- lfx/components/files_and_knowledge/ingestion.py +8 -0
- lfx/components/files_and_knowledge/retrieval.py +10 -0
- lfx/components/files_and_knowledge/save_file.py +91 -88
- lfx/components/langchain_utilities/ibm_granite_handler.py +211 -0
- lfx/components/langchain_utilities/tool_calling.py +37 -6
- lfx/components/llm_operations/batch_run.py +64 -18
- lfx/components/llm_operations/lambda_filter.py +213 -101
- lfx/components/llm_operations/llm_conditional_router.py +39 -7
- lfx/components/llm_operations/structured_output.py +38 -12
- lfx/components/models/__init__.py +16 -74
- lfx/components/models_and_agents/agent.py +51 -203
- lfx/components/models_and_agents/embedding_model.py +171 -255
- lfx/components/models_and_agents/language_model.py +54 -318
- lfx/components/models_and_agents/mcp_component.py +96 -10
- lfx/components/models_and_agents/prompt.py +105 -18
- lfx/components/ollama/ollama_embeddings.py +111 -29
- lfx/components/openai/openai_chat_model.py +1 -1
- lfx/components/processing/text_operations.py +580 -0
- lfx/components/vllm/__init__.py +37 -0
- lfx/components/vllm/vllm.py +141 -0
- lfx/components/vllm/vllm_embeddings.py +110 -0
- lfx/custom/custom_component/component.py +65 -10
- lfx/custom/custom_component/custom_component.py +8 -6
- lfx/events/observability/__init__.py +0 -0
- lfx/events/observability/lifecycle_events.py +111 -0
- lfx/field_typing/__init__.py +57 -58
- lfx/graph/graph/base.py +40 -1
- lfx/graph/utils.py +109 -30
- lfx/graph/vertex/base.py +75 -23
- lfx/graph/vertex/vertex_types.py +0 -5
- lfx/inputs/__init__.py +2 -0
- lfx/inputs/input_mixin.py +55 -0
- lfx/inputs/inputs.py +120 -0
- lfx/interface/components.py +24 -7
- lfx/interface/initialize/loading.py +42 -12
- lfx/io/__init__.py +2 -0
- lfx/run/__init__.py +5 -0
- lfx/run/base.py +464 -0
- lfx/schema/__init__.py +50 -0
- lfx/schema/data.py +1 -1
- lfx/schema/image.py +26 -7
- lfx/schema/message.py +104 -11
- lfx/schema/workflow.py +171 -0
- lfx/services/deps.py +12 -0
- lfx/services/interfaces.py +43 -1
- lfx/services/mcp_composer/service.py +7 -1
- lfx/services/schema.py +1 -0
- lfx/services/settings/auth.py +95 -4
- lfx/services/settings/base.py +11 -1
- lfx/services/settings/constants.py +2 -0
- lfx/services/settings/utils.py +82 -0
- lfx/services/storage/local.py +13 -8
- lfx/services/transaction/__init__.py +5 -0
- lfx/services/transaction/service.py +35 -0
- lfx/tests/unit/components/__init__.py +0 -0
- lfx/utils/constants.py +2 -0
- lfx/utils/mustache_security.py +79 -0
- lfx/utils/validate_cloud.py +81 -3
- {lfx_nightly-0.2.0.dev41.dist-info → lfx_nightly-0.3.0.dev3.dist-info}/METADATA +7 -2
- {lfx_nightly-0.2.0.dev41.dist-info → lfx_nightly-0.3.0.dev3.dist-info}/RECORD +98 -80
- {lfx_nightly-0.2.0.dev41.dist-info → lfx_nightly-0.3.0.dev3.dist-info}/WHEEL +0 -0
- {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
|
-
|
|
15
|
-
app.command(name="serve", help="Serve a flow as an API", no_args_is_help=True)
|
|
16
|
-
|
|
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():
|