fix: tool name in component toolkit if the name of the component is None (#5761)

* Update component_tool.py

* formatting

* Update src/backend/base/langflow/base/tools/component_tool.py

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

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
This commit is contained in:
Edwin Jose 2025-01-20 07:07:33 -05:00 committed by GitHub
commit d9d9cbb345
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -220,7 +220,8 @@ class ComponentToolkit:
args_schema = create_input_schema(tool_mode_inputs)
else:
args_schema = create_input_schema(self.component.inputs)
name = f"{self.component.name}.{output.method}"
name = f"{self.component.name or self.component.__class__.__name__ or ''}.{output.method}".strip(".")
formatted_name = _format_tool_name(name)
event_manager = self.component._event_manager
if asyncio.iscoroutinefunction(output_method):