MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / truncate_for_error

Function truncate_for_error

atomic-agent/src/transcript/generator.rs:351–357  ·  view source on GitHub ↗

Truncate a string for inclusion in error messages.

(s: &str, max_len: usize)

Source from the content-addressed store, hash-verified

349
350/// Truncate a string for inclusion in error messages.
351pub(crate) fn truncate_for_error(s: &str, max_len: usize) -> String {
352 if s.len() <= max_len {
353 s.to_string()
354 } else {
355 format!("{}...", &s[..max_len])
356 }
357}
358
359/// Generate reasoning from a condensed transcript using the default generator.
360///

Callers

nothing calls this directly

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected