修改tool 工具日志

This commit is contained in:
朱潮 2026-02-14 19:06:14 +08:00
parent 3655e0ca9b
commit 198bb08690

View File

@ -66,7 +66,7 @@ class LoggingCallbackHandler(BaseCallbackHandler):
tool_name = 'unknown_tool'
else:
tool_name = serialized.get('name', 'unknown_tool')
self.logger.info(f"🔧 Tool Start - {tool_name} with input: {str(input_str)[:100]}")
self.logger.info(f"🔧 Tool Start - {tool_name} with input: {str(input_str)[:300]}")
def on_tool_end(self, output: str, **kwargs: Any) -> None:
"""当工具调用结束时调用"""
@ -76,4 +76,4 @@ class LoggingCallbackHandler(BaseCallbackHandler):
self, error: Exception, **kwargs: Any
) -> None:
"""当工具调用出错时调用"""
self.logger.error(f"❌ Tool Error: {error}")
self.logger.error(f"❌ Tool Error: {error}")