From 877efe4edaf98192c60fb3790384b9fe487670bd Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Thu, 23 Jul 2026 20:34:59 +0200 Subject: [PATCH] Track current personality and warn when the selected one is not active. --- profiler/src/profiler/TracyLlm.cpp | 9 ++++++++- profiler/src/profiler/TracyLlm.hpp | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/profiler/src/profiler/TracyLlm.cpp b/profiler/src/profiler/TracyLlm.cpp index 6d49ab1d..42a583fe 100644 --- a/profiler/src/profiler/TracyLlm.cpp +++ b/profiler/src/profiler/TracyLlm.cpp @@ -309,6 +309,12 @@ void TracyLlm::Draw( WindowConstraints& constraints ) if( ImGui::RadioButton( ICON_FA_FACE_GRIN " Emotion", &s_config.llmPersonality, 1 ) ) SaveConfig(); ImGui::SameLine(); if( ImGui::RadioButton( ICON_FA_FACE_FROWN " Annoyed", &s_config.llmPersonality, 2 ) ) SaveConfig(); + if( s_config.llmPersonality != m_personalityPrompt ) + { + ImGui::SameLine(); + TextColoredUnformatted( 0xFF00FFFF, ICON_FA_TRIANGLE_EXCLAMATION ); + TooltipIfHovered( "Start fresh conversation to apply personality change" ); + } constraints.MarkMinWidth(); ImGui::Checkbox( ICON_FA_EARTH_AMERICAS " Internet access", &m_tools->m_netAccess ); @@ -998,6 +1004,7 @@ void TracyLlm::UpdateSystemPrompt() for( auto& skill : m_skills ) skills += skill.name + ": " + skill.description + "\n"; auto systemPrompt = std::string( m_systemPrompt->data(), m_systemPrompt->size() ); + m_personalityPrompt = std::clamp( s_config.llmPersonality, 0, m_personality.size() - 1 ); Replace( systemPrompt, UserToken, userName ); Replace( systemPrompt, TimeToken, m_tools->GetCurrentTime() ); @@ -1007,7 +1014,7 @@ void TracyLlm::UpdateSystemPrompt() Replace( systemPrompt, ProfileLengthToken, TimeToString( lastTime - firstTime ) ); Replace( systemPrompt, ProfileDescriptionToken, descStr ); Replace( systemPrompt, SkillsToken, skills ); - Replace( systemPrompt, PersonalityToken, m_personality[std::clamp( s_config.llmPersonality, 0, m_personality.size() - 1 )] ); + Replace( systemPrompt, PersonalityToken, m_personality[m_personalityPrompt] ); if( !m_api || m_chatId.load( std::memory_order_acquire ) == 0 ) { diff --git a/profiler/src/profiler/TracyLlm.hpp b/profiler/src/profiler/TracyLlm.hpp index 7f97e02a..24f4ae4a 100644 --- a/profiler/src/profiler/TracyLlm.hpp +++ b/profiler/src/profiler/TracyLlm.hpp @@ -115,6 +115,7 @@ private: float m_temperature = 1.0f; bool m_setTemperature = false; bool m_allThinkingRegions = false; + int m_personalityPrompt = -1; char* m_input; char* m_apiInput;