suppress printout of final_output
This commit is contained in:
@@ -1276,6 +1276,8 @@ The tool will execute immediately and you'll receive the result (success or erro
|
||||
// Execute the tool with formatted output
|
||||
println!(); // New line before tool execution
|
||||
|
||||
// Skip printing tool call details for final_output
|
||||
if tool_call.tool != "final_output" {
|
||||
// Tool call header
|
||||
println!("┌─ {}", tool_call.tool);
|
||||
if let Some(args_obj) = tool_call.args.as_object() {
|
||||
@@ -1306,6 +1308,7 @@ The tool will execute immediately and you'll receive the result (success or erro
|
||||
}
|
||||
}
|
||||
println!("├─ output:");
|
||||
}
|
||||
|
||||
let exec_start = Instant::now();
|
||||
let tool_result = self.execute_tool(&tool_call).await?;
|
||||
@@ -1321,6 +1324,7 @@ The tool will execute immediately and you'll receive the result (success or erro
|
||||
));
|
||||
|
||||
// Display tool execution result with proper indentation
|
||||
if tool_call.tool != "final_output" {
|
||||
let output_lines: Vec<&str> = tool_result.lines().collect();
|
||||
const MAX_LINES: usize = 5;
|
||||
|
||||
@@ -1339,6 +1343,7 @@ The tool will execute immediately and you'll receive the result (success or erro
|
||||
if hidden_count == 1 { "" } else { "s" }
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Check if this was a final_output tool call
|
||||
if tool_call.tool == "final_output" {
|
||||
@@ -1355,10 +1360,12 @@ The tool will execute immediately and you'll receive the result (success or erro
|
||||
}
|
||||
|
||||
// Closure marker with timing
|
||||
if tool_call.tool != "final_output" {
|
||||
println!("└─ ⚡️ {}", Self::format_duration(exec_duration));
|
||||
println!();
|
||||
print!("🤖 ");
|
||||
io::stdout().flush()?;
|
||||
}
|
||||
|
||||
// Add the tool call and result to the context window
|
||||
// Only include the text content if it's not already in full_response
|
||||
|
||||
Reference in New Issue
Block a user