Allow disabling tools use.

This commit is contained in:
Bartosz Taudul
2025-05-13 22:21:56 +02:00
parent 4c46cc4deb
commit 78257553c7
2 changed files with 4 additions and 1 deletions

View File

@@ -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 ); });
}

View File

@@ -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<ollama::messages> m_chat;