From 3a60a67c95d83564de310889f7c422854e36241e Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Mon, 12 May 2025 22:36:36 +0200 Subject: [PATCH] Explicitly check for assistant role. --- profiler/src/profiler/TracyLlm.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/profiler/src/profiler/TracyLlm.cpp b/profiler/src/profiler/TracyLlm.cpp index 39ba3759..a063839e 100644 --- a/profiler/src/profiler/TracyLlm.cpp +++ b/profiler/src/profiler/TracyLlm.cpp @@ -186,6 +186,7 @@ void TracyLlm::Draw() const auto role = line["role"].get(); const auto isUser = role == "user"; const auto isError = role == "error"; + const auto isAssistant = role == "assistant"; float diff, offset; if( isUser ) @@ -204,7 +205,7 @@ void TracyLlm::Draw() ImGui::SameLine( 0, 0 ); ImGui::TextColored( ImVec4( 1.f, 0.25f, 0.25f, 1.f ), ICON_FA_CIRCLE_EXCLAMATION ); } - else + else if( isAssistant ) { diff = mw - rw; offset = diff / 2; @@ -212,6 +213,11 @@ void TracyLlm::Draw() ImGui::SameLine( 0, 0 ); ImGui::TextColored( ImVec4( 0.4f, 0.5f, 1.f, 1.f ), ICON_FA_ROBOT ); } + else + { + assert( false ); + } + ImGui::SameLine( 0, 0 ); ImGui::Dummy( ImVec2( diff - offset, 0 ) ); ImGui::SameLine(); @@ -227,12 +233,16 @@ void TracyLlm::Draw() { ImGui::PushStyleColor( ImGuiCol_Text, ImVec4( 1.f, 0.25f, 0.25f, 1.f ) ); } - else + else if( isAssistant ) { ImGui::PushStyleColor( ImGuiCol_Text, style.Colors[ImGuiCol_Text] ); } + else + { + assert( false ); + } - if( !isUser && !isError ) + if( isAssistant ) { auto str = line["content"].get(); if( strncmp( str.c_str(), "", 7 ) == 0 )