mirror of
https://github.com/wolfpld/tracy.git
synced 2026-08-27 21:48:22 +00:00
Provide name of the profiled program to LLM.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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() )
|
||||
{
|
||||
|
||||
@@ -105,6 +105,8 @@ private:
|
||||
|
||||
std::shared_ptr<EmbedData> m_systemPrompt;
|
||||
nlohmann::json m_toolsJson;
|
||||
|
||||
Worker& m_worker;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user