fix: Replace HandleInput with ToolsInput for dynamic outputs

- ToolsInput has real_time_refresh=True hardcoded and is designed for tool selection
- This should properly trigger update_outputs when tools are added/removed
- ToolsInput is specifically built for dynamic tool behavior unlike HandleInput
This commit is contained in:
Rodrigo
2025-10-03 20:46:33 -03:00
parent bd72e657fb
commit e2831e6415

View File

@ -1,7 +1,8 @@
from typing import Any
from lfx.custom import Component
from lfx.io import BoolInput, HandleInput, MessageInput, MessageTextInput, MultilineInput, Output
from lfx.io import BoolInput, MessageInput, MessageTextInput, MultilineInput, Output
from lfx.inputs import ToolsInput
from lfx.schema.message import Message
@ -30,14 +31,11 @@ class ToolRouterComponent(Component):
info="The primary text input for tool selection.",
required=True,
),
HandleInput(
ToolsInput(
name="tools",
display_name="Tools",
input_types=["Tool"],
is_list=True,
required=True,
info="Tools that can be selected based on the input categorization.",
real_time_refresh=True,
required=True,
),
MessageInput(
name="message",