From 78257553c71c469ef37cc192fc0a51dacde1951d Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Tue, 13 May 2025 22:21:56 +0200 Subject: [PATCH] Allow disabling tools use. --- profiler/src/profiler/TracyLlm.cpp | 4 +++- profiler/src/profiler/TracyLlm.hpp | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/profiler/src/profiler/TracyLlm.cpp b/profiler/src/profiler/TracyLlm.cpp index 18278221..f4d81b85 100644 --- a/profiler/src/profiler/TracyLlm.cpp +++ b/profiler/src/profiler/TracyLlm.cpp @@ -157,6 +157,8 @@ void TracyLlm::Draw() ImGui::EndCombo(); } + ImGui::Checkbox( "Enable tools", &m_enableTools ); + ImGui::AlignTextToFramePadding(); ImGui::TextUnformatted( "Context size:" ); ImGui::SameLine(); @@ -517,7 +519,7 @@ void TracyLlm::SendMessage( ollama::messages&& messages ) req["stream"] = true; req["options"] = options["options"]; req["keep_alive"] = "5m"; - req["tools"] = m_tools; // enabling tools prevents streaming in ollama 0.6.8 + if( m_enableTools ) req["tools"] = m_tools; // enabling tools prevents streaming in ollama 0.6.8 res = m_ollama->chat( req, [this]( const ollama::response& response ) -> bool { return OnResponse( response ); }); } diff --git a/profiler/src/profiler/TracyLlm.hpp b/profiler/src/profiler/TracyLlm.hpp index de3c7c80..5cfe5ca4 100644 --- a/profiler/src/profiler/TracyLlm.hpp +++ b/profiler/src/profiler/TracyLlm.hpp @@ -110,6 +110,7 @@ private: bool m_stop = false; bool m_wasUpdated = false; bool m_focusInput = false; + bool m_enableTools = true; char* m_input; std::unique_ptr m_chat;