File tree Expand file tree Collapse file tree 1 file changed +6
-27
lines changed
astrbot/core/agent/runners Expand file tree Collapse file tree 1 file changed +6
-27
lines changed Original file line number Diff line number Diff line change @@ -269,17 +269,6 @@ async def _handle_function_tools(
269269 )
270270 yield MessageChain ().message ("返回的数据类型不受支持。" )
271271
272- try :
273- await self .agent_hooks .on_tool_end (
274- self .run_context ,
275- func_tool_name ,
276- func_tool_args ,
277- resp ,
278- )
279- except Exception as e :
280- logger .error (
281- f"Error in on_tool_end hook: { e } " , exc_info = True
282- )
283272 elif resp is None :
284273 # Tool 直接请求发送消息给用户
285274 # 这里我们将直接结束 Agent Loop。
@@ -289,27 +278,17 @@ async def _handle_function_tools(
289278 yield MessageChain (
290279 chain = res .chain , type = "tool_direct_result"
291280 )
292- try :
293- await self .agent_hooks .on_tool_end (
294- self .run_context , func_tool_name , func_tool_args , None
295- )
296- except Exception as e :
297- logger .error (
298- f"Error in on_tool_end hook: { e } " , exc_info = True
299- )
300281 else :
301282 logger .warning (
302283 f"Tool 返回了不支持的类型: { type (resp )} ,将忽略。"
303284 )
304285
305- try :
306- await self .agent_hooks .on_tool_end (
307- self .run_context , func_tool_name , func_tool_args , None
308- )
309- except Exception as e :
310- logger .error (
311- f"Error in on_tool_end hook: { e } " , exc_info = True
312- )
286+ try :
287+ await self .agent_hooks .on_tool_end (
288+ self .run_context , func_tool , func_tool_args , None
289+ )
290+ except Exception as e :
291+ logger .error (f"Error in on_tool_end hook: { e } " , exc_info = True )
313292
314293 self .run_context .event .clear_result ()
315294 except Exception as e :
You can’t perform that action at this time.
0 commit comments