langflow
langflow copied to clipboard
fix: fixes the error in order of tool metadata and tool metadata updation
This pull request includes updates to the component_tool.py
, constants.py
, and component.py
files to add and handle tags for tools. The changes primarily focus on adding a new "tags" field to the tool metadata and ensuring that the tags are properly managed and utilized.
This is used for a safety check to ensure that the tool_metadata is updated only if the tags matches.
Key changes include:
Tag Management Enhancements:
-
src/backend/base/langflow/base/tools/component_tool.py
: Added thetags
field to the tool creation process in theget_tools
method. [1] [2] -
src/backend/base/langflow/base/tools/component_tool.py
: Introduced a safety check in theupdate_tools_metadata
method to avoid updating the tool metadata if the tags are not the same.
Tool Metadata Updates:
-
src/backend/base/langflow/base/tools/constants.py
: Added a new entry for "tags" in the tool metadata constants. -
src/backend/base/langflow/custom/custom_component/component.py
: Updated the_build_tools_metadata_input
method to include thetags
field in the tool metadata input.