Move LLM system prompt to an external file.

This commit is contained in:
Bartosz Taudul
2025-05-13 19:50:03 +02:00
parent cc0aa73527
commit c8dbe33a3c
3 changed files with 9 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.21)
cmake_minimum_required(VERSION 3.25)
option(NO_FILESELECTOR "Disable the file selector" OFF)
option(GTK_FILESELECTOR "Use the GTK file selector on Linux instead of the xdg-portal one" OFF)
@@ -120,6 +120,8 @@ set(PROFILER_FILES
src/winmainArchDiscovery.cpp
)
Embed(PROFILER_FILES SystemPrompt src/llm/system.prompt)
set(INCLUDES "${CMAKE_CURRENT_BINARY_DIR}")
set(LIBS "")

View File

@@ -0,0 +1 @@
You are a helpful assistant operating in context of Tracy Profiler, a C++ real time, nanosecond resolution, remote telemetry, hybrid frame and sampling profiler for games and other applications.

View File

@@ -2,10 +2,13 @@
#include <ollama.hpp>
#include "TracyConfig.hpp"
#include "TracyEmbed.hpp"
#include "TracyImGui.hpp"
#include "TracyLlm.hpp"
#include "TracyPrint.hpp"
#include "data/SystemPrompt.hpp"
extern tracy::Config s_config;
namespace tracy
@@ -464,8 +467,9 @@ void TracyLlm::UpdateModels()
void TracyLlm::ResetChat()
{
Unembed( SystemPrompt );
m_chat = std::make_unique<ollama::messages>();
m_chat->emplace_back( ollama::message( "system", "You are a helpful assistant operating in context of Tracy Profiler, a C++ real time, nanosecond resolution, remote telemetry, hybrid frame and sampling profiler for games and other applications." ) );
m_chat->emplace_back( ollama::message( "system", std::string( SystemPrompt->data(), SystemPrompt->size() ) ) );
}
void TracyLlm::SendMessage( ollama::messages&& messages )