pub(crate) fn truncate_tool_output(
output: &str,
) -> (Cow<'_, str>, Option<&'static str>)Expand description
Cuts output down to what a tool output row can hold, returning the text to send and, when it
had to cut, the instruction telling the model what it is looking at.
The notice is returned separately rather than appended so the caller can put it in the instructions block: inside the output delimiters it would read as part of the data it is warning about.