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

Function preview

atomic-repository/src/ai/tools.rs:1161–1167  ·  view source on GitHub ↗

Generate a short preview for [`ToolTraceEntry`].

(s: &str)

Source from the content-addressed store, hash-verified

1159
1160/// Generate a short preview for [`ToolTraceEntry`].
1161fn preview(s: &str) -> String {
1162 if s.chars().count() <= MAX_PREVIEW_CHARS {
1163 s.to_string()
1164 } else {
1165 s.chars().take(MAX_PREVIEW_CHARS).collect::<String>() + "…"
1166 }
1167}
1168
1169// ── Tests ───────────────────────────────────────────────────────
1170

Callers 2

run_tool_loopFunction · 0.85
test_preview_longFunction · 0.85

Calls 1

countMethod · 0.45

Tested by 1

test_preview_longFunction · 0.68