Skip to main content

sanitize_tool_replacement

Function sanitize_tool_replacement 

Source
pub fn sanitize_tool_replacement(replacement: &str) -> String
Expand description

Sanitize an operator-supplied tool-result replacement before it is fed back to the model: drop control characters (except \n, \r, \t) that could corrupt rendering or smuggle terminal escapes, and truncate to MAX_REPLACEMENT_LEN on a char boundary.