mirror of
https://github.com/wolfpld/tracy.git
synced 2026-09-03 00:48:26 +00:00
Inject current time into each user message.
This is not removed later on, mainly to enable caching of previous replies (changing any earlier message would require processing everything that's later), but also to give the LLM a sense of passing time.
This commit is contained in:
@@ -781,11 +781,10 @@ 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 );
|
||||
|
||||
chat.front()["content"].get_ref<std::string&>().append( "\n\nThe current time is: " + m_tools->GetCurrentTime() + "\n" );
|
||||
|
||||
nlohmann::json req;
|
||||
req["model"] = m_api->GetModels()[m_modelIdx].name;
|
||||
req["messages"] = std::move( chat );
|
||||
|
||||
Reference in New Issue
Block a user