mirror of
https://github.com/zvx-echo6/meshai.git
synced 2026-05-22 15:44:39 +02:00
Inject current date into system prompt so LLM knows today's date
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
6e2d956be6
commit
825d93e52d
1 changed files with 4 additions and 2 deletions
|
|
@ -3,6 +3,7 @@
|
|||
import logging
|
||||
import re
|
||||
from dataclasses import dataclass
|
||||
from datetime import datetime, timezone
|
||||
from enum import Enum, auto
|
||||
from typing import Optional
|
||||
|
||||
|
|
@ -157,10 +158,11 @@ class MessageRouter:
|
|||
# Get conversation history
|
||||
history = await self.history.get_history_for_llm(message.sender_id)
|
||||
|
||||
# Get system prompt from config
|
||||
# Get system prompt from config, inject current date
|
||||
system_prompt = ""
|
||||
if getattr(self.config.llm, 'use_system_prompt', True):
|
||||
system_prompt = self.config.llm.system_prompt
|
||||
today = datetime.now(timezone.utc).strftime("%A, %B %d, %Y")
|
||||
system_prompt = f"{self.config.llm.system_prompt}\nToday's date is {today}."
|
||||
|
||||
try:
|
||||
response = await self.llm.generate(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue