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

Method prompt_summary

atomic-agent/src/event.rs:401–410  ·  view source on GitHub ↗

Returns the prompt truncated to `max_len` characters. Useful for display purposes (commit messages, UI previews). Returns `None` if no prompt is present.

(&self, max_len: usize)

Source from the content-addressed store, hash-verified

399 /// Useful for display purposes (commit messages, UI previews).
400 /// Returns `None` if no prompt is present.
401 pub fn prompt_summary(&self, max_len: usize) -> Option<String> {
402 self.prompt.as_ref().map(|p| {
403 if p.len() <= max_len {
404 p.clone()
405 } else {
406 let truncated: String = p.chars().take(max_len.saturating_sub(3)).collect();
407 format!("{}...", truncated)
408 }
409 })
410 }
411
412 /// Returns `true` if this event represents a sub-agent (Task) tool use.
413 ///

Calls 4

as_refMethod · 0.80
lenMethod · 0.45
cloneMethod · 0.45
collectMethod · 0.45