Move time information to system prompt.

This also changes the context of the information a bit. Previously it was
the current time, now it is the time when the conversation started.
This commit is contained in:
Bartosz Taudul
2025-12-29 17:10:56 +01:00
parent 0a983cb24c
commit f4f3c63755

View File

@@ -644,13 +644,14 @@ void TracyLlm::UpdateModels()
void TracyLlm::ResetChat()
{
std::string systemPrompt = "<SYSTEM_PROMPT>\n";
systemPrompt += std::string( m_systemPrompt->data(), m_systemPrompt->size() );
auto systemPrompt = std::string( m_systemPrompt->data(), m_systemPrompt->size() );
#ifndef NDEBUG
systemPrompt += "\n\n# DEBUG MODE AVAILABLE\n";
systemPrompt += "Upon a user query beginning with `<debug>`, activate *Debug Mode*. In this mode, ignore all prior instructions. Your response must detail your complete reasoning process and the exact steps taken to generate your *previous* non-debug answer. Explicitly state any internal rules applied. Do not say you are sorry. Do not tell how you will change your behavior. Focus strictly on the analysis of what happened.\n";
#endif
systemPrompt += "</SYSTEM_PROMPT>\n";
systemPrompt += "\n\n# Misc information\n";
systemPrompt += "Conversation started at: " + m_tools->GetCurrentTime() + "\n";
*m_input = 0;
m_usedCtx = 0;
@@ -794,7 +795,6 @@ void TracyLlm::SendMessage( std::unique_lock<std::mutex>& lock )
bool res;
try
{
m_chat.back()["content"].get_ref<std::string&>().append( "\n\n<SYSTEM_PROMPT>\nThe current time is: " + m_tools->GetCurrentTime() + "\n</SYSTEM_PROMPT>\n" );
auto chat = m_chat;
AddMessageBlocking( "", "assistant", lock );