From 2de119b8d561c0fdef47d3c218387b36c7f4f137 Mon Sep 17 00:00:00 2001 From: Phil Miesle Date: Wed, 27 Nov 2024 00:48:21 +0000 Subject: [PATCH] feat: defaulting tool description to the flow description in Flow as Tool (#4873) defaulting tool description to the flow description --- src/backend/base/langflow/components/logic/flow_tool.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/backend/base/langflow/components/logic/flow_tool.py b/src/backend/base/langflow/components/logic/flow_tool.py index 19b4ccc9c..396a39192 100644 --- a/src/backend/base/langflow/components/logic/flow_tool.py +++ b/src/backend/base/langflow/components/logic/flow_tool.py @@ -60,7 +60,7 @@ class FlowToolComponent(LCToolComponent): StrInput( name="tool_description", display_name="Description", - info="The description of the tool.", + info="The description of the tool; defaults to the Flow's description.", ), BoolInput( name="return_direct", @@ -93,9 +93,10 @@ class FlowToolComponent(LCToolComponent): except Exception: # noqa: BLE001 logger.opt(exception=True).warning("Failed to set run_id") inputs = get_flow_inputs(graph) + tool_description = self.tool_description.strip() if self.tool_description.strip() else flow_data.description tool = FlowTool( name=self.tool_name, - description=self.tool_description, + description=tool_description, graph=graph, return_direct=self.return_direct, inputs=inputs,