fix: tool change check logic (#7675)

* Update composio_base.py

* fix: Fix template bug causing empty output in AgentQL component (#7489)

* Fix empty output issue in AgentQL component

* Apply suggestions from code review

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>

* Add reference to AgentQL API key

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>

* tool change check

* optimised logic

---------

Co-authored-by: Desiree Sng <desiree@tinyfish.io>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
This commit is contained in:
Edwin Jose 2025-04-16 16:33:36 -04:00 committed by GitHub
commit dd1205b9a3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1125,7 +1125,11 @@ class Component(CustomComponent):
return component_toolkit(component=self, metadata=metadata).update_tools_metadata(tools=tools)
def check_for_tool_tag_change(self, old_tags: list[str], new_tags: list[str]) -> bool:
return old_tags != new_tags
# First check length - if different lengths, they can't be equal
if len(old_tags) != len(new_tags):
return True
# Use set comparison for O(n) average case complexity, earlier the old_tags.sort() != new_tags.sort() was used
return set(old_tags) != set(new_tags)
def _filter_tools_by_status(self, tools: list[Tool], metadata: pd.DataFrame | None) -> list[Tool]:
"""Filter tools based on their status in metadata.