From 0b02b097a938457400fea804fe710509dd83bee8 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 6 Feb 2026 17:33:59 +0100 Subject: [PATCH] Pass current and end chat iterators to TracyLlmChat::Turn(). --- profiler/src/profiler/TracyLlm.cpp | 2 +- profiler/src/profiler/TracyLlmChat.cpp | 4 +++- profiler/src/profiler/TracyLlmChat.hpp | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/profiler/src/profiler/TracyLlm.cpp b/profiler/src/profiler/TracyLlm.cpp index 0a12dc68..7601c11d 100644 --- a/profiler/src/profiler/TracyLlm.cpp +++ b/profiler/src/profiler/TracyLlm.cpp @@ -527,7 +527,7 @@ void TracyLlm::Draw() { think = TracyLlmChat::Think::ToolCall; } - if( !m_chatUi->Turn( role, line, think, turnIdx == m_chat.size() - 1 ) ) + if( !m_chatUi->Turn( role, it, m_chat.end(), think, turnIdx == m_chat.size() - 1 ) ) { if( role == TracyLlmChat::TurnRole::Assistant ) { diff --git a/profiler/src/profiler/TracyLlmChat.cpp b/profiler/src/profiler/TracyLlmChat.cpp index 9c09de29..2ee7f313 100644 --- a/profiler/src/profiler/TracyLlmChat.cpp +++ b/profiler/src/profiler/TracyLlmChat.cpp @@ -105,8 +105,10 @@ void TracyLlmChat::End() } } -bool TracyLlmChat::Turn( TurnRole role, const nlohmann::json& json, Think think, bool last ) +bool TracyLlmChat::Turn( TurnRole role, std::vector::iterator it, const std::vector::iterator& end, Think think, bool last ) { + auto& json = *it; + bool keep = true; const auto& roleData = roles[(int)role]; const bool roleChange = role != m_role; diff --git a/profiler/src/profiler/TracyLlmChat.hpp b/profiler/src/profiler/TracyLlmChat.hpp index e95defca..983cd84c 100644 --- a/profiler/src/profiler/TracyLlmChat.hpp +++ b/profiler/src/profiler/TracyLlmChat.hpp @@ -41,7 +41,7 @@ public: void Begin(); void End(); - bool Turn( TurnRole role, const nlohmann::json& json, Think think, bool last ); + bool Turn( TurnRole role, std::vector::iterator it, const std::vector::iterator& end, Think think, bool last ); private: void NormalScope();