mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
Add timestamp to active system prompt in AIAgent
- Appended the current local date and time to the active system prompt to provide context for the model, addressing potential misinterpretations due to training cutoffs.
This commit is contained in:
parent
ed010752dd
commit
3099a2f53c
1 changed files with 9 additions and 0 deletions
|
|
@ -1981,6 +1981,15 @@ class AIAgent:
|
|||
else:
|
||||
active_system_prompt = context_files_prompt
|
||||
|
||||
# Append the current local date and time so the model knows what
|
||||
# day/time it is (LLM training cutoffs can otherwise mislead it).
|
||||
now = datetime.now()
|
||||
timestamp_line = f"Current local date and time: {now.strftime('%A, %B %d, %Y %I:%M %p')}"
|
||||
if active_system_prompt:
|
||||
active_system_prompt = f"{active_system_prompt}\n\n{timestamp_line}"
|
||||
else:
|
||||
active_system_prompt = timestamp_line
|
||||
|
||||
# Main conversation loop
|
||||
api_call_count = 0
|
||||
final_response = None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue