diff options
| author | sigoden <sigoden@gmail.com> | 2024-07-30 06:20:30 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-30 06:20:30 +0800 |
| commit | 4c18e91165269970747bd2734b9b5db013ade2c2 (patch) | |
| tree | 33aeb63a679a8964e61f770f1bbdad532b7efe79 /src/config/mod.rs | |
| parent | 44aac171b79835048ae09150d392a683930077e1 (diff) | |
| download | aichat-4c18e91165269970747bd2734b9b5db013ade2c2.tar.gz | |
refactor: agent instructions (#764)
- replace `__TOOLS__` with `{{__tools__}}`
- after `.clear messages`, update system message of agent session
- show interpolated instructions in agent info
Diffstat (limited to 'src/config/mod.rs')
| -rw-r--r-- | src/config/mod.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/config/mod.rs b/src/config/mod.rs index c9a4a73..8f719f4 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -861,6 +861,9 @@ impl Config { pub fn clear_session_messages(&mut self) -> Result<()> { if let Some(session) = self.session.as_mut() { session.clear_messages(); + if let Some(prompt) = self.agent.as_ref().map(|v| v.interpolated_instructions()) { + session.update_role_prompt(&prompt); + } } else { bail!("No session") } |
