From 7eedbe130e3beb7538f9ddd1287bae92e8a86f09 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Tue, 13 May 2025 20:14:04 +0200 Subject: [PATCH] Prepare ollama request in an explicit way. --- profiler/src/profiler/TracyLlm.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/profiler/src/profiler/TracyLlm.cpp b/profiler/src/profiler/TracyLlm.cpp index 3c007b8a..fedf46bb 100644 --- a/profiler/src/profiler/TracyLlm.cpp +++ b/profiler/src/profiler/TracyLlm.cpp @@ -484,7 +484,14 @@ void TracyLlm::SendMessage( ollama::messages&& messages ) bool res; try { - res = m_ollama->chat( m_models[m_modelIdx].name, messages, [this]( const ollama::response& response ) -> bool { return OnResponse( response ); }, options ); + ollama::request req( ollama::message_type::chat ); + req["model"] = m_models[m_modelIdx].name; + req["messages"] = messages.to_json(); + req["stream"] = true; + req["options"] = options["options"]; + req["keep_alive"] = "5m"; + + res = m_ollama->chat( req, [this]( const ollama::response& response ) -> bool { return OnResponse( response ); }); } catch( std::exception& e ) {