From 11a706a68d1a1a22817f2264bdbbbe7036897378 Mon Sep 17 00:00:00 2001 From: sigoden Date: Sat, 5 Oct 2024 07:15:51 +0800 Subject: feat: when saving input to message.md, use file paths instead of file contents (#905) --- src/config/mod.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/config/mod.rs') diff --git a/src/config/mod.rs b/src/config/mod.rs index 4aa0873..3243c26 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -1759,7 +1759,7 @@ impl Config { } let timestamp = now(); let summary = input.summary(); - let input_markdown = input.render(); + let raw_input = input.raw(); let scope = if self.agent.is_none() { let role_name = if input.role().is_derived() { None @@ -1775,7 +1775,9 @@ impl Config { } else { String::new() }; - let output = format!("# CHAT: {summary} [{timestamp}]{scope}\n{input_markdown}\n--------\n{output}\n--------\n\n",); + let output = format!( + "# CHAT: {summary} [{timestamp}]{scope}\n{raw_input}\n--------\n{output}\n--------\n\n", + ); file.write_all(output.as_bytes()) .with_context(|| "Failed to save message") } -- cgit v1.2.3