Properly update system prompt on first message.

This commit is contained in:
Bartosz Taudul
2026-01-04 15:29:05 +01:00
parent 3f84749b05
commit b79f3232b6

View File

@@ -579,7 +579,6 @@ void TracyLlm::Draw()
if( *m_input == 0 ) ImGui::EndDisabled();
if( send )
{
if( m_chat.size() <= 1 ) UpdateSystemPrompt();
auto ptr = m_input;
while( *ptr )
{
@@ -762,6 +761,7 @@ void TracyLlm::AddMessage( std::string&& str, const char* role )
.task = Task::Tokenize,
.callback2 = [this, str, role]( nlohmann::json json ) {
m_usedCtx += json["tokens"].get<int>();
if( m_chat.size() == 1 ) UpdateSystemPrompt();
nlohmann::json msg = {
{ "role", role },
{ "content", str }