From 14f60bde0799aecd6341bff824a30688c8f66d2d Mon Sep 17 00:00:00 2001 From: Nathan Date: Fri, 11 Apr 2025 11:41:32 -0500 Subject: [PATCH] fix --- modules/Ollama/src/Ollama.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/Ollama/src/Ollama.cpp b/modules/Ollama/src/Ollama.cpp index bd70cc3..fdf5ee8 100644 --- a/modules/Ollama/src/Ollama.cpp +++ b/modules/Ollama/src/Ollama.cpp @@ -49,7 +49,9 @@ void Ollama::onLoad() { void Ollama::run() { - static std::string s, url, response = ""; + ImGuiIO& io = ImGui::GetIO(); + + static std::string s, url = "https://ollama.blunkall.us", response = ""; static nlohmann::json sendObj; @@ -77,16 +79,18 @@ void Ollama::run() { } ImGui::Text("%s", jsonObj["response"].dump().c_str()); + ImGui::Text("ms per frame: %f", 1000 / io.Framerate); ImGui::End(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, (url + "/api/generate").c_str()); - curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, &oss); } if(inFlight && result.wait_for(std::chrono::seconds(0)) == std::future_status::ready) { CURLcode code = result.get(); + response = oss.str(); if(code != CURLE_OK) { std::cerr << "curl_easy_perform() failed!: " << curl_easy_strerror(code) << std::endl; app->stopModule(getName());