mirror of
https://github.com/aljazceru/goose.git
synced 2026-02-23 15:34:27 +01:00
fix: use less strict timestamp in system prompt (#2434)
This commit is contained in:
@@ -9,6 +9,7 @@ use crate::{config::Config, prompt_template};
|
||||
pub struct PromptManager {
|
||||
system_prompt_override: Option<String>,
|
||||
system_prompt_extras: Vec<String>,
|
||||
current_date_timestamp: String,
|
||||
}
|
||||
|
||||
impl Default for PromptManager {
|
||||
@@ -22,6 +23,8 @@ impl PromptManager {
|
||||
PromptManager {
|
||||
system_prompt_override: None,
|
||||
system_prompt_extras: Vec::new(),
|
||||
// Use the fixed current date time so that prompt cache can be used.
|
||||
current_date_timestamp: Utc::now().format("%Y-%m-%d %H:%M:%S").to_string(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,8 +82,10 @@ impl PromptManager {
|
||||
|
||||
context.insert("extensions", serde_json::to_value(extensions_info).unwrap());
|
||||
|
||||
let current_date_time = Utc::now().format("%Y-%m-%d %H:%M:%S").to_string();
|
||||
context.insert("current_date_time", Value::String(current_date_time));
|
||||
context.insert(
|
||||
"current_date_time",
|
||||
Value::String(self.current_date_timestamp.clone()),
|
||||
);
|
||||
|
||||
// Add the suggestion about disabling extensions if flag is true
|
||||
context.insert(
|
||||
|
||||
Reference in New Issue
Block a user