diff --git a/profiler/src/profiler/TracyLlm.cpp b/profiler/src/profiler/TracyLlm.cpp index dcbd306c..6c548347 100644 --- a/profiler/src/profiler/TracyLlm.cpp +++ b/profiler/src/profiler/TracyLlm.cpp @@ -660,8 +660,7 @@ void TracyLlm::Draw() m_jobs.emplace_back( WorkItem { .task = Task::SendMessage, - .callback = nullptr, - .chat = m_chat + .callback = nullptr } ); m_cv.notify_all(); } @@ -698,7 +697,7 @@ void TracyLlm::Worker() m_busy = false; break; case Task::SendMessage: - SendMessage( job.chat ); + SendMessage(); break; default: assert( false ); @@ -775,7 +774,7 @@ void TracyLlm::AddMessage( std::string&& str, const char* role ) m_chat.emplace_back( std::move( msg ) ); } -void TracyLlm::SendMessage( const std::vector& messages ) +void TracyLlm::SendMessage() { AddMessage( "", "assistant" ); @@ -785,7 +784,7 @@ void TracyLlm::SendMessage( const std::vector& messages ) { nlohmann::json req; req["model"] = m_api->GetModels()[m_modelIdx].name; - req["messages"] = messages; + req["messages"] = m_chat; req["stream"] = true; if( m_setTemperature ) req["temperature"] = m_temperature; @@ -894,8 +893,7 @@ bool TracyLlm::OnResponse( const nlohmann::json& json ) m_jobs.emplace_back( WorkItem { .task = Task::SendMessage, - .callback = nullptr, - .chat = m_chat + .callback = nullptr } ); m_cv.notify_all(); } diff --git a/profiler/src/profiler/TracyLlm.hpp b/profiler/src/profiler/TracyLlm.hpp index c5efcc19..ed2feccf 100644 --- a/profiler/src/profiler/TracyLlm.hpp +++ b/profiler/src/profiler/TracyLlm.hpp @@ -32,7 +32,6 @@ class TracyLlm { Task task; std::function callback; - std::vector chat; }; struct ChatCache @@ -65,7 +64,7 @@ private: void ResetChat(); void AddMessage( std::string&& str, const char* role ); - void SendMessage( const std::vector& messages ); + void SendMessage(); bool OnResponse( const nlohmann::json& json ); void UpdateCache( ChatCache& cache, const std::string& str );