feat: Support extending the system prompt (#1167)
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
/// Returns a system prompt extension that explains CLI-specific functionality
|
||||
pub fn get_cli_prompt() -> String {
|
||||
String::from(
|
||||
"You are being accessed through a command-line interface. The following slash commands are available
|
||||
- you can let the user know about them if they need help:
|
||||
|
||||
- /exit or /quit - Exit the session
|
||||
- /t - Toggle between Light/Dark/Ansi themes
|
||||
- /? or /help - Display help message
|
||||
|
||||
Additional keyboard shortcuts:
|
||||
- Ctrl+C - Interrupt the current interaction (resets to before the interrupted request)
|
||||
- Ctrl+J - Add a newline
|
||||
- Up/Down arrows - Navigate command history"
|
||||
)
|
||||
}
|
||||
@@ -161,6 +161,11 @@ pub async fn build_session(
|
||||
|
||||
let prompt = Box::new(RustylinePrompt::new());
|
||||
|
||||
// Add CLI-specific system prompt extension
|
||||
agent
|
||||
.extend_system_prompt(crate::cli_prompt::get_cli_prompt())
|
||||
.await;
|
||||
|
||||
display_session_info(resume, &provider_name, &model, &session_file);
|
||||
Session::new(agent, prompt, session_file)
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ pub static APP_STRATEGY: Lazy<AppStrategyArgs> = Lazy::new(|| AppStrategyArgs {
|
||||
app_name: "goose".to_string(),
|
||||
});
|
||||
|
||||
mod cli_prompt;
|
||||
mod commands;
|
||||
mod log_usage;
|
||||
mod logging;
|
||||
|
||||
Reference in New Issue
Block a user