From b40bb95909729b274c8a509b98e15262d71287cf Mon Sep 17 00:00:00 2001 From: "YAMON.IO" Date: Mon, 10 Jun 2024 10:01:27 +0900 Subject: [PATCH] refactor: Include Missing Field in Tool Status (#2118) Modified the status to include args_schema when the tool has it. You can use this translation in your commit message. --- src/backend/base/langflow/base/tools/base.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/backend/base/langflow/base/tools/base.py b/src/backend/base/langflow/base/tools/base.py index e1c4d5fdc..c9422e268 100644 --- a/src/backend/base/langflow/base/tools/base.py +++ b/src/backend/base/langflow/base/tools/base.py @@ -9,7 +9,7 @@ def build_status_from_tool(tool: Tool): tool (Tool): The tool object to build the status for. Returns: - str: The status string representation of the tool, including its name, description, and arguments (if any). + str: The status string representation of the tool, including its name, description, arguments (if any), and args_schema (if any). """ description_repr = repr(tool.description).strip("'") args_str = "\n".join( @@ -19,5 +19,8 @@ def build_status_from_tool(tool: Tool): if "description" in arg_data ] ) + # Include args_schema information + args_schema_str = repr(tool.args_schema) if tool.args_schema else "None" status = f"Name: {tool.name}\nDescription: {description_repr}" + status += f"\nArgs Schema: {args_schema_str}" return status + (f"\nArguments:\n{args_str}" if args_str else "")