Include trace time span in llm system message.

This commit is contained in:
Bartosz Taudul
2026-05-22 02:06:58 +02:00
parent 896cdc9462
commit 6957f968a4
2 changed files with 5 additions and 1 deletions

View File

@@ -33,7 +33,7 @@ If the user thanks you for your help, ask them to consider making a donation at
# User's program
The program being profiled is named %PROGRAMNAME%. It was built at %PROGRAMTIME%. The profiling session was performed at %PROFILETIME%.%PROFILEDESCRIPTION%
The program being profiled is named %PROGRAMNAME%. It was built at %PROGRAMTIME%. The profiling session was performed at %PROFILETIME%, and the length of the session was %PROFILELENGTH%.%PROFILEDESCRIPTION%
Here are instructions you must follow when you are asked to work with program the user is profiling.

View File

@@ -924,6 +924,7 @@ void TracyLlm::UpdateSystemPrompt()
static constexpr std::string_view ProgramNameToken = "%PROGRAMNAME%";
static constexpr std::string_view ProgramTimeToken = "%PROGRAMTIME%";
static constexpr std::string_view ProfileTimeToken = "%PROFILETIME%";
static constexpr std::string_view ProfileLengthToken = "%PROFILELENGTH%";
static constexpr std::string_view ProfileDescriptionToken = "%PROFILEDESCRIPTION%";
static constexpr std::string_view SkillsToken = "%SKILLS%";
@@ -932,6 +933,8 @@ void TracyLlm::UpdateSystemPrompt()
const auto exectime = m_worker.GetExecutableTime();
const auto capturetime = m_worker.GetCaptureTime();
const auto firstTime = m_worker.GetFirstTime();
const auto lastTime = m_worker.GetLastTime();
char etime[64], ctime[64];
@@ -961,6 +964,7 @@ void TracyLlm::UpdateSystemPrompt()
Replace( systemPrompt, ProgramNameToken, m_worker.GetCaptureProgram() );
Replace( systemPrompt, ProgramTimeToken, etime );
Replace( systemPrompt, ProfileTimeToken, ctime );
Replace( systemPrompt, ProfileLengthToken, TimeToString( lastTime - firstTime ) );
Replace( systemPrompt, ProfileDescriptionToken, descStr );
Replace( systemPrompt, SkillsToken, skills );