This tries to short-circuit multiple round-trips to llm for reading code. It's a precursor to trying to context engineer tailored to specific tasks. In initial experiments, it's only marginally faster than regular mode, and burns more tokens.
34 lines
665 B
Rust
34 lines
665 B
Rust
/// Simple output helper for printing messages
|
|
#[derive(Clone)]
|
|
pub struct SimpleOutput {
|
|
machine_mode: bool,
|
|
}
|
|
|
|
impl SimpleOutput {
|
|
pub fn new() -> Self {
|
|
SimpleOutput { machine_mode: false }
|
|
}
|
|
|
|
pub fn new_with_mode(machine_mode: bool) -> Self {
|
|
SimpleOutput { machine_mode }
|
|
}
|
|
|
|
pub fn print(&self, message: &str) {
|
|
if !self.machine_mode {
|
|
println!("{}", message);
|
|
}
|
|
}
|
|
|
|
pub fn print_smart(&self, message: &str) {
|
|
if !self.machine_mode {
|
|
println!("{}", message);
|
|
}
|
|
}
|
|
}
|
|
|
|
impl Default for SimpleOutput {
|
|
fn default() -> Self {
|
|
Self::new()
|
|
}
|
|
}
|