Skip to content

Commit 6a117b5

Browse files
committed
1 parent 8cf3cde commit 6a117b5

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/chat-cli/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ bstr = "1.12.0"
3838
bytes = "1.10.1"
3939
camino = { version = "1.1.3", features = ["serde1"] }
4040
cfg-if = "1.0.0"
41+
chrono = { version = "0.4.41", default-features = false, features = ["std"] }
4142
clap = { version = "4.5.32", features = [
4243
"deprecated",
4344
"derive",

crates/chat-cli/src/cli/chat/conversation_state.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,9 @@ impl ConversationState {
195195
warn!("input must not be empty when adding new messages");
196196
"Empty prompt".to_string()
197197
} else {
198-
input
198+
let now = chrono::Utc::now();
199+
let formatted_time = now.format("%Y-%m-%d %H:%M:%S").to_string();
200+
format!("{}\n\n<currentTimeUTC>\n{}\n</currentTimeUTC>", input, formatted_time)
199201
};
200202

201203
let msg = UserMessage::new_prompt(input);

0 commit comments

Comments
 (0)