log first 20 chars

This commit is contained in:
hjc-puro 2025-11-07 14:08:06 -05:00
parent c27787f09f
commit 2d8f6c46f1

View file

@ -474,7 +474,10 @@ class AIAgent:
print(f"❌ Invalid JSON in tool call arguments: {e}") print(f"❌ Invalid JSON in tool call arguments: {e}")
function_args = {} function_args = {}
print(f" 📞 Tool {i}: {function_name}({list(function_args.keys())})") # Preview tool call arguments (first 20 chars)
args_str = json.dumps(function_args, ensure_ascii=False)
args_preview = args_str[:20] + "..." if len(args_str) > 20 else args_str
print(f" 📞 Tool {i}: {function_name}({list(function_args.keys())}) - {args_preview}")
tool_start_time = time.time() tool_start_time = time.time()
@ -495,7 +498,9 @@ class AIAgent:
"tool_call_id": tool_call.id "tool_call_id": tool_call.id
}) })
print(f" ✅ Tool {i} completed in {tool_duration:.2f}s") # Preview tool response (first 20 chars)
response_preview = function_result[:20] + "..." if len(function_result) > 20 else function_result
print(f" ✅ Tool {i} completed in {tool_duration:.2f}s - {response_preview}")
# Delay between tool calls # Delay between tool calls
if self.tool_delay > 0 and i < len(assistant_message.tool_calls): if self.tool_delay > 0 and i < len(assistant_message.tool_calls):