diff --git a/profiler/src/llm/system.prompt.md b/profiler/src/llm/system.prompt.md index 9b16d471..92f07ef3 100644 --- a/profiler/src/llm/system.prompt.md +++ b/profiler/src/llm/system.prompt.md @@ -31,6 +31,8 @@ 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%. + Here are instructions you must follow when you are asked to work with program the user is profiling. ## Attachments diff --git a/profiler/src/profiler/TracyLlm.cpp b/profiler/src/profiler/TracyLlm.cpp index ad12910b..0933a2fa 100644 --- a/profiler/src/profiler/TracyLlm.cpp +++ b/profiler/src/profiler/TracyLlm.cpp @@ -12,6 +12,7 @@ #include "TracyLlmTools.hpp" #include "TracyPrint.hpp" #include "TracyWeb.hpp" +#include "TracyWorker.hpp" #include "../Fonts.hpp" #include "../public/common/TracySystem.hpp" @@ -28,6 +29,7 @@ constexpr size_t InputBufferSize = 1024; TracyLlm::TracyLlm( Worker& worker, View& view, const TracyManualData& manual ) : m_exit( false ) , m_input( nullptr ) + , m_worker( worker ) { if( !s_config.llm ) return; @@ -771,6 +773,7 @@ void TracyLlm::UpdateSystemPrompt() { static constexpr std::string_view UserToken = "%USER%"; static constexpr std::string_view TimeToken = "%TIME%"; + static constexpr std::string_view ProgramNameToken = "%PROGRAMNAME%"; auto userName = GetUserFullName(); if( !userName ) userName = GetUserLogin(); @@ -779,6 +782,7 @@ void TracyLlm::UpdateSystemPrompt() Replace( systemPrompt, UserToken, userName ); Replace( systemPrompt, TimeToken, m_tools->GetCurrentTime() ); + Replace( systemPrompt, ProgramNameToken, m_worker.GetCaptureProgram() ); if( m_chat.empty() ) { diff --git a/profiler/src/profiler/TracyLlm.hpp b/profiler/src/profiler/TracyLlm.hpp index 6176b93b..a07625cc 100644 --- a/profiler/src/profiler/TracyLlm.hpp +++ b/profiler/src/profiler/TracyLlm.hpp @@ -105,6 +105,8 @@ private: std::shared_ptr m_systemPrompt; nlohmann::json m_toolsJson; + + Worker& m_worker; }; }