feat: update system prompt to include current date, response formatting (#837)

This commit is contained in:
Salman Mohammed
2025-02-11 08:45:18 -05:00
committed by GitHub
parent b19ede4b53
commit 4cd341436e
2 changed files with 28 additions and 9 deletions
+7 -2
View File
@@ -286,7 +286,8 @@ impl Capabilities {
/// Get the extension prompt including client instructions
pub async fn get_system_prompt(&self) -> String {
let mut context: HashMap<&str, Vec<ExtensionInfo>> = HashMap::new();
let mut context: HashMap<&str, Value> = HashMap::new();
let extensions_info: Vec<ExtensionInfo> = self
.clients
.keys()
@@ -297,7 +298,11 @@ impl Capabilities {
})
.collect();
context.insert("extensions", extensions_info);
let current_date_time = Utc::now().format("%Y-%m-%d %H:%M:%S").to_string();
context.insert("extensions", serde_json::to_value(extensions_info).unwrap());
context.insert("current_date_time", Value::String(current_date_time));
load_prompt_file("system.md", &context).expect("Prompt should render")
}