Skip to content

Commit e50bb54

Browse files
committed
fix typing issue with ToolsType
1 parent 5372396 commit e50bb54

File tree

1 file changed

+6
-6
lines changed
  • haystack_experimental/components/agents

1 file changed

+6
-6
lines changed

haystack_experimental/components/agents/agent.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
from haystack.dataclasses import ChatMessage
3939
from haystack.dataclasses.breakpoints import AgentBreakpoint, ToolBreakpoint
4040
from haystack.dataclasses.streaming_chunk import StreamingCallbackT
41-
from haystack.tools import Tool, Toolset, deserialize_tools_or_toolset_inplace
41+
from haystack.tools import ToolsType, deserialize_tools_or_toolset_inplace
4242
from haystack.utils.callable_serialization import deserialize_callable
4343
from haystack.utils.deserialization import deserialize_chatgenerator_inplace
4444

@@ -121,7 +121,7 @@ def __init__(
121121
self,
122122
*,
123123
chat_generator: ChatGenerator,
124-
tools: Optional[Union[list[Tool], Toolset]] = None,
124+
tools: Optional[ToolsType] = None,
125125
system_prompt: Optional[str] = None,
126126
exit_conditions: Optional[list[str]] = None,
127127
state_schema: Optional[dict[str, Any]] = None,
@@ -171,7 +171,7 @@ def _initialize_fresh_execution(
171171
requires_async: bool,
172172
*,
173173
system_prompt: Optional[str] = None,
174-
tools: Optional[Union[list[Tool], Toolset, list[str]]] = None,
174+
tools: Optional[Union[ToolsType, list[str]]] = None,
175175
**kwargs: dict[str, Any],
176176
) -> _ExecutionContext:
177177
"""
@@ -212,7 +212,7 @@ def _initialize_from_snapshot( # type: ignore[override]
212212
streaming_callback: Optional[StreamingCallbackT],
213213
requires_async: bool,
214214
*,
215-
tools: Optional[Union[list[Tool], Toolset, list[str]]] = None,
215+
tools: Optional[Union[ToolsType, list[str]]] = None,
216216
) -> _ExecutionContext:
217217
"""
218218
Initialize execution context from an AgentSnapshot.
@@ -250,7 +250,7 @@ def run( # noqa: PLR0915
250250
break_point: Optional[AgentBreakpoint] = None,
251251
snapshot: Optional[AgentSnapshot] = None, # type: ignore[override]
252252
system_prompt: Optional[str] = None,
253-
tools: Optional[Union[list[Tool], Toolset, list[str]]] = None,
253+
tools: Optional[Union[ToolsType, list[str]]] = None,
254254
**kwargs: Any,
255255
) -> dict[str, Any]:
256256
"""
@@ -434,7 +434,7 @@ async def run_async(
434434
break_point: Optional[AgentBreakpoint] = None,
435435
snapshot: Optional[AgentSnapshot] = None, # type: ignore[override]
436436
system_prompt: Optional[str] = None,
437-
tools: Optional[Union[list[Tool], Toolset, list[str]]] = None,
437+
tools: Optional[Union[ToolsType, list[str]]] = None,
438438
**kwargs: Any,
439439
) -> dict[str, Any]:
440440
"""

0 commit comments

Comments
 (0)