1212import  time 
1313import  uuid 
1414from  functools  import  partial 
15- from  typing  import  Any , Callable ,  Generator , Optional , cast 
15+ from  typing  import  Any , Generator , Optional , cast 
1616
1717from  opentelemetry  import  trace 
1818
@@ -40,7 +40,6 @@ def event_loop_cycle(
4040    system_prompt : Optional [str ],
4141    messages : Messages ,
4242    tool_config : Optional [ToolConfig ],
43-     callback_handler : Callable [..., Any ],
4443    tool_handler : Optional [ToolHandler ],
4544    tool_execution_handler : Optional [ParallelToolExecutorInterface ],
4645    event_loop_metrics : EventLoopMetrics ,
@@ -65,7 +64,6 @@ def event_loop_cycle(
6564        system_prompt: System prompt instructions for the model. 
6665        messages: Conversation history messages. 
6766        tool_config: Configuration for available tools. 
68-         callback_handler: Callback for processing events as they happen. 
6967        tool_handler: Handler for executing tools. 
7068        tool_execution_handler: Optional handler for parallel tool execution. 
7169        event_loop_metrics: Metrics tracking object for the event loop. 
@@ -212,7 +210,6 @@ def event_loop_cycle(
212210                messages ,
213211                tool_config ,
214212                tool_handler ,
215-                 callback_handler ,
216213                tool_execution_handler ,
217214                event_loop_metrics ,
218215                event_loop_parent_span ,
@@ -258,7 +255,6 @@ def recurse_event_loop(
258255    system_prompt : Optional [str ],
259256    messages : Messages ,
260257    tool_config : Optional [ToolConfig ],
261-     callback_handler : Callable [..., Any ],
262258    tool_handler : Optional [ToolHandler ],
263259    tool_execution_handler : Optional [ParallelToolExecutorInterface ],
264260    event_loop_metrics : EventLoopMetrics ,
@@ -274,7 +270,6 @@ def recurse_event_loop(
274270        system_prompt: System prompt instructions for the model 
275271        messages: Conversation history messages 
276272        tool_config: Configuration for available tools 
277-         callback_handler: Callback for processing events as they happen 
278273        tool_handler: Handler for tool execution 
279274        tool_execution_handler: Optional handler for parallel tool execution. 
280275        event_loop_metrics: Metrics tracking object for the event loop. 
@@ -302,7 +297,6 @@ def recurse_event_loop(
302297        system_prompt = system_prompt ,
303298        messages = messages ,
304299        tool_config = tool_config ,
305-         callback_handler = callback_handler ,
306300        tool_handler = tool_handler ,
307301        tool_execution_handler = tool_execution_handler ,
308302        event_loop_metrics = event_loop_metrics ,
@@ -321,7 +315,6 @@ def _handle_tool_execution(
321315    messages : Messages ,
322316    tool_config : ToolConfig ,
323317    tool_handler : ToolHandler ,
324-     callback_handler : Callable [..., Any ],
325318    tool_execution_handler : Optional [ParallelToolExecutorInterface ],
326319    event_loop_metrics : EventLoopMetrics ,
327320    event_loop_parent_span : Optional [trace .Span ],
@@ -345,7 +338,6 @@ def _handle_tool_execution(
345338        messages (Messages): The conversation history messages. 
346339        tool_config (ToolConfig): Configuration for available tools. 
347340        tool_handler (ToolHandler): Handler for tool execution. 
348-         callback_handler (Callable[..., Any]): Callback for processing events as they happen. 
349341        tool_execution_handler (Optional[ParallelToolExecutorInterface]): Optional handler for parallel tool execution. 
350342        event_loop_metrics (EventLoopMetrics): Metrics tracking object for the event loop. 
351343        event_loop_parent_span (Any): Span for the parent of this event loop. 
@@ -374,7 +366,6 @@ def _handle_tool_execution(
374366        system_prompt = system_prompt ,
375367        messages = messages ,
376368        tool_config = tool_config ,
377-         callback_handler = callback_handler ,
378369        kwargs = kwargs ,
379370    )
380371
@@ -415,7 +406,6 @@ def _handle_tool_execution(
415406        system_prompt = system_prompt ,
416407        messages = messages ,
417408        tool_config = tool_config ,
418-         callback_handler = callback_handler ,
419409        tool_handler = tool_handler ,
420410        tool_execution_handler = tool_execution_handler ,
421411        event_loop_metrics = event_loop_metrics ,
0 commit comments