Skip to main content

elide

Function elide 

Source
pub(super) fn elide(msg: &mut Value) -> Option<usize>
Expand description

Replace this message’s text with the placeholder when it exceeds TOOL_CONTENT_THRESHOLD_CHARS, and say how many characters that reclaimed.

None when nothing was changed: the message is under the threshold, carries no text, or is split into so many short text parts that one placeholder per part would not be smaller than the text it replaces. Each piece of text becomes the placeholder, so a message of several text parts carries the placeholder once per part, and the estimate counts it once per part.