log first 20 chars
This commit is contained in:
parent
c27787f09f
commit
2d8f6c46f1
1 changed files with 10 additions and 5 deletions
|
|
@ -474,7 +474,10 @@ class AIAgent:
|
|||
print(f"❌ Invalid JSON in tool call arguments: {e}")
|
||||
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()
|
||||
|
||||
|
|
@ -495,7 +498,9 @@ class AIAgent:
|
|||
"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
|
||||
if self.tool_delay > 0 and i < len(assistant_message.tool_calls):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue