stynx_code_services/tool_use_summary/
mod.rs1pub trait ToolUseSummarizer: Send + Sync {
2 fn summarize(&self, tool_name: &str, input: &str, output: &str) -> String;
3}
4
5pub struct DefaultSummarizer;
6
7impl DefaultSummarizer {
8 pub fn new() -> Self {
9 Self
10 }
11}
12
13impl ToolUseSummarizer for DefaultSummarizer {
14 fn summarize(&self, tool_name: &str, _input: &str, output: &str) -> String {
15 let truncated = if output.len() > 200 {
16 format!("{}...", &output[..200])
17 } else {
18 output.to_string()
19 };
20 format!("{tool_name}: {truncated}")
21 }
22}