Instructions per chat (system prompt addition; UI dialog and Telegram /prompt)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
434aa84d40
commit
ff8ff585a2
14 files changed
+156
-4
No files matched your search
@@ -216,6 +216,17 @@ fn instruction_files(app: &App, root: &Path, cwd: &Path) -> Vec<(PathBuf, String
|
||||
|
||||
/// The plain chat mode: no coding instructions, project files or memory – only the
|
||||
/// date, the model and what the user keeps in their personal memory.
|
||||
/// Add the instructions the user set for this chat (they come last, so they win).
|
||||
pub fn with_chat_instructions(mut system: String, instructions: &str) -> String {
|
||||
if !instructions.trim().is_empty() {
|
||||
system.push_str(&format!(
|
||||
"\n\n# Instructions for this chat\nThe user set these for this chat. They apply to every message and override the defaults above:\n{}\n",
|
||||
instructions.trim()
|
||||
));
|
||||
}
|
||||
system
|
||||
}
|
||||
|
||||
fn chat_prompt(app: &App, agent: &Agent, model: &str, owner: Option<&crate::store::User>) -> String {
|
||||
let mut s = agent.prompt.clone();
|
||||
s.push_str(&format!("\n\n# Context\n- Date: {}\n- Model: {model}\n", chrono::Local::now().format("%A, %Y-%m-%d")));
|
||||
|
||||
Reference in new issue
Block a user