lfx-nightly 0.1.13.dev7__py3-none-any.whl → 0.1.13.dev8__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.
Potentially problematic release.
This version of lfx-nightly might be problematic. Click here for more details.
- lfx/_assets/component_index.json +1 -1
- lfx/components/agents/mcp_component.py +16 -2
- {lfx_nightly-0.1.13.dev7.dist-info → lfx_nightly-0.1.13.dev8.dist-info}/METADATA +1 -1
- {lfx_nightly-0.1.13.dev7.dist-info → lfx_nightly-0.1.13.dev8.dist-info}/RECORD +6 -6
- {lfx_nightly-0.1.13.dev7.dist-info → lfx_nightly-0.1.13.dev8.dist-info}/WHEEL +0 -0
- {lfx_nightly-0.1.13.dev7.dist-info → lfx_nightly-0.1.13.dev8.dist-info}/entry_points.txt +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
import asyncio
|
|
4
|
+
import json
|
|
4
5
|
import uuid
|
|
5
6
|
from typing import Any
|
|
6
7
|
|
|
@@ -520,7 +521,6 @@ class MCPToolsComponent(ComponentWithCache):
|
|
|
520
521
|
if session_context:
|
|
521
522
|
self.stdio_client.set_session_context(session_context)
|
|
522
523
|
self.streamable_http_client.set_session_context(session_context)
|
|
523
|
-
|
|
524
524
|
exec_tool = self._tool_cache[self.tool]
|
|
525
525
|
tool_args = self.get_inputs_for_all_tools(self.tools)[self.tool]
|
|
526
526
|
kwargs = {}
|
|
@@ -535,11 +535,14 @@ class MCPToolsComponent(ComponentWithCache):
|
|
|
535
535
|
unflattened_kwargs = maybe_unflatten_dict(kwargs)
|
|
536
536
|
|
|
537
537
|
output = await exec_tool.coroutine(**unflattened_kwargs)
|
|
538
|
-
|
|
539
538
|
tool_content = []
|
|
540
539
|
for item in output.content:
|
|
541
540
|
item_dict = item.model_dump()
|
|
541
|
+
item_dict = self.process_output_item(item_dict)
|
|
542
542
|
tool_content.append(item_dict)
|
|
543
|
+
|
|
544
|
+
if isinstance(tool_content, list) and all(isinstance(x, dict) for x in tool_content):
|
|
545
|
+
return DataFrame(tool_content)
|
|
543
546
|
return DataFrame(data=tool_content)
|
|
544
547
|
return DataFrame(data=[{"error": "You must select a tool"}])
|
|
545
548
|
except Exception as e:
|
|
@@ -547,6 +550,17 @@ class MCPToolsComponent(ComponentWithCache):
|
|
|
547
550
|
await logger.aexception(msg)
|
|
548
551
|
raise ValueError(msg) from e
|
|
549
552
|
|
|
553
|
+
def process_output_item(self, item_dict):
|
|
554
|
+
"""Process the output of a tool."""
|
|
555
|
+
if item_dict.get("type") == "text":
|
|
556
|
+
text = item_dict.get("text")
|
|
557
|
+
try:
|
|
558
|
+
return json.loads(text)
|
|
559
|
+
# convert it to dict
|
|
560
|
+
except json.JSONDecodeError:
|
|
561
|
+
return item_dict
|
|
562
|
+
return item_dict
|
|
563
|
+
|
|
550
564
|
def _get_session_context(self) -> str | None:
|
|
551
565
|
"""Get the Langflow session ID for MCP session caching."""
|
|
552
566
|
# Try to get session ID from the component's execution context
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: lfx-nightly
|
|
3
|
-
Version: 0.1.13.
|
|
3
|
+
Version: 0.1.13.dev8
|
|
4
4
|
Summary: Langflow Executor - A lightweight CLI tool for executing and serving Langflow AI flows
|
|
5
5
|
Author-email: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
|
|
6
6
|
Requires-Python: <3.14,>=3.10
|
|
@@ -4,7 +4,7 @@ lfx/constants.py,sha256=Ert_SpwXhutgcTKEvtDArtkONXgyE5x68opMoQfukMA,203
|
|
|
4
4
|
lfx/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
lfx/settings.py,sha256=wnx4zkOLQ8mvampYsnnvVV9GvEnRUuWQpKFSbFTCIp4,181
|
|
6
6
|
lfx/type_extraction.py,sha256=eCZNl9nAQivKdaPv_9BK71N0JV9Rtr--veAht0dnQ4A,2921
|
|
7
|
-
lfx/_assets/component_index.json,sha256=
|
|
7
|
+
lfx/_assets/component_index.json,sha256=iFhI2IAaOrFMIB-NI1GrezFq6uTRjP83yqSIaGpgUbM,3558913
|
|
8
8
|
lfx/base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
9
|
lfx/base/constants.py,sha256=v9vo0Ifg8RxDu__XqgGzIXHlsnUFyWM-SSux0uHHoz8,1187
|
|
10
10
|
lfx/base/agents/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -119,7 +119,7 @@ lfx/components/agents/__init__.py,sha256=O5ng90Dn9mSlpCdeGPXM4tvdWYVfEMv_7PGDKSh
|
|
|
119
119
|
lfx/components/agents/agent.py,sha256=-pGSOYS-2pHoYq5VyNdDCnkQVzVz52as4hdF_BB1hVI,26993
|
|
120
120
|
lfx/components/agents/altk_agent.py,sha256=D_ChOwqYao0QZBfiLpiMVoMOgCwzcb_q0MIPDULLHW8,15939
|
|
121
121
|
lfx/components/agents/cuga_agent.py,sha256=JNi4MsSziTJQI3z_0KGzNWxm5RDaMk_W9zcTW2KcTtI,44499
|
|
122
|
-
lfx/components/agents/mcp_component.py,sha256=
|
|
122
|
+
lfx/components/agents/mcp_component.py,sha256=gbEzi-hZMqVmIGO5DjJDOlmpisPkylOSZSGgaDjiQLY,26809
|
|
123
123
|
lfx/components/aiml/__init__.py,sha256=DNKB-HMFGFYmsdkON-s8557ttgBXVXADmS-BcuSQiIQ,1087
|
|
124
124
|
lfx/components/aiml/aiml.py,sha256=23Ineg1ajlCoqXgWgp50I20OnQbaleRNsw1c6IzPu3A,3877
|
|
125
125
|
lfx/components/aiml/aiml_embeddings.py,sha256=2uNwORuj55mxn2SfLbh7oAIfjuXwHbsnOqRjfMtQRqc,1095
|
|
@@ -730,7 +730,7 @@ lfx/utils/schemas.py,sha256=NbOtVQBrn4d0BAu-0H_eCTZI2CXkKZlRY37XCSmuJwc,3865
|
|
|
730
730
|
lfx/utils/util.py,sha256=Ww85wbr1-vjh2pXVtmTqoUVr6MXAW8S7eDx_Ys6HpE8,20696
|
|
731
731
|
lfx/utils/util_strings.py,sha256=nU_IcdphNaj6bAPbjeL-c1cInQPfTBit8mp5Y57lwQk,1686
|
|
732
732
|
lfx/utils/version.py,sha256=cHpbO0OJD2JQAvVaTH_6ibYeFbHJV0QDHs_YXXZ-bT8,671
|
|
733
|
-
lfx_nightly-0.1.13.
|
|
734
|
-
lfx_nightly-0.1.13.
|
|
735
|
-
lfx_nightly-0.1.13.
|
|
736
|
-
lfx_nightly-0.1.13.
|
|
733
|
+
lfx_nightly-0.1.13.dev8.dist-info/METADATA,sha256=OuXsV_znOj-UTr--bes0-v4clOA1MVVgLl2ygj8ok94,8289
|
|
734
|
+
lfx_nightly-0.1.13.dev8.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
735
|
+
lfx_nightly-0.1.13.dev8.dist-info/entry_points.txt,sha256=1724p3RHDQRT2CKx_QRzEIa7sFuSVO0Ux70YfXfoMT4,42
|
|
736
|
+
lfx_nightly-0.1.13.dev8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|