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

Method prompt_summary

atomic-agent/src/event.rs:392–401  ·  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

390 /// Useful for display purposes (commit messages, UI previews).
391 /// Returns `None` if no prompt is present.
392 pub fn prompt_summary(&self, max_len: usize) -> Option<String> {
393 self.prompt.as_ref().map(|p| {
394 if p.len() <= max_len {
395 p.clone()
396 } else {
397 let truncated: String = p.chars().take(max_len.saturating_sub(3)).collect();
398 format!("{}...", truncated)
399 }
400 })
401 }
402
403 /// Returns `true` if this event represents a sub-agent (Task) tool use.
404 ///

Calls 3

as_refMethod · 0.80
lenMethod · 0.45
cloneMethod · 0.45