Skip to main content

truncate_tool_output

Function truncate_tool_output 

Source
pub fn truncate_tool_output(output: &str) -> String
Expand description

Truncate tool output that exceeds MAX_TOOL_OUTPUT_CHARS using a head+tail split.

Equivalent to truncate_tool_output_at(output, MAX_TOOL_OUTPUT_CHARS).

ยงExample

use zeph_tools::executor::truncate_tool_output;

let short = "hello world";
assert_eq!(truncate_tool_output(short), short);