diff options
| author | sigoden <sigoden@gmail.com> | 2024-06-27 08:21:49 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-27 08:21:49 +0800 |
| commit | 33a0049a81103c1f6c5639b9cec43cb14a9ef367 (patch) | |
| tree | 7402b251e2d75aaf5306487b70265f35c8d52b22 /src/config/mod.rs | |
| parent | 1ced451c2723c36b7e0cb70e6c0755cdbad457c3 (diff) | |
| download | aichat-33a0049a81103c1f6c5639b9cec43cb14a9ef367.tar.gz | |
refactor: saved messages ignore embedding context (#659)
Diffstat (limited to 'src/config/mod.rs')
| -rw-r--r-- | src/config/mod.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/config/mod.rs b/src/config/mod.rs index f82f36a..69609f4 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -1267,7 +1267,7 @@ impl Config { pub fn after_chat_completion( &mut self, - input: &mut Input, + input: &Input, output: &str, tool_results: &[ToolResult], ) -> Result<()> { @@ -1280,9 +1280,11 @@ impl Config { Ok(()) } - fn save_message(&mut self, input: &mut Input, output: &str) -> Result<()> { + fn save_message(&mut self, input: &Input, output: &str) -> Result<()> { + let mut input = input.clone(); + input.clear_patch(); if let Some(session) = input.session_mut(&mut self.session) { - session.add_message(input, output)?; + session.add_message(&input, output)?; return Ok(()); } |
