Skip to content

Commit 68f4cc7

Browse files
changing _check_chat_generator_breakpoint and _check_tool_invoker_breakpoint to staticmethod (#9755)
1 parent 68168c4 commit 68f4cc7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

haystack/components/agents/agent.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,8 @@ def _runtime_checks(self, break_point: Optional[AgentBreakpoint], snapshot: Opti
360360
if break_point and isinstance(break_point.break_point, ToolBreakpoint):
361361
_validate_tool_breakpoint_is_valid(agent_breakpoint=break_point, tools=self.tools)
362362

363+
@staticmethod
363364
def _check_chat_generator_breakpoint(
364-
self,
365365
execution_context: _ExecutionContext,
366366
break_point: Optional[AgentBreakpoint],
367367
parent_snapshot: Optional[PipelineSnapshot],
@@ -398,8 +398,8 @@ def _check_chat_generator_breakpoint(
398398
)
399399
_trigger_chat_generator_breakpoint(agent_snapshot=agent_snapshot, parent_snapshot=parent_snapshot)
400400

401+
@staticmethod
401402
def _check_tool_invoker_breakpoint(
402-
self,
403403
execution_context: _ExecutionContext,
404404
break_point: Optional[AgentBreakpoint],
405405
parent_snapshot: Optional[PipelineSnapshot],
@@ -490,7 +490,7 @@ def run(
490490

491491
while exe_context.counter < self.max_agent_steps:
492492
# Handle breakpoint and ChatGenerator call
493-
self._check_chat_generator_breakpoint(
493+
Agent._check_chat_generator_breakpoint(
494494
execution_context=exe_context, break_point=break_point, parent_snapshot=parent_snapshot
495495
)
496496
# We skip the chat generator when restarting from a snapshot from a ToolBreakpoint
@@ -515,7 +515,7 @@ def run(
515515
break
516516

517517
# Handle breakpoint and ToolInvoker call
518-
self._check_tool_invoker_breakpoint(
518+
Agent._check_tool_invoker_breakpoint(
519519
execution_context=exe_context, break_point=break_point, parent_snapshot=parent_snapshot
520520
)
521521
# We only send the messages from the LLM to the tool invoker

0 commit comments

Comments
 (0)