Move xferinfo_cb to ollama_client.cpp to avoid exposing libcurl in header
- Remove curl/curl.h include from ollama_client.hpp - Remove xferinfo_cb static method declaration from OllamaClient class - Make xferinfo_cb a file-scope static function in ollama_client.cpp Closes: #195
This commit is contained in:
@@ -5,7 +5,6 @@
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
#include <optional>
|
||||
#include <curl/curl.h>
|
||||
|
||||
using http_req_cb_t = std::function<std::string(std::string const& old, std::string const& new_str)>;
|
||||
|
||||
@@ -31,11 +30,6 @@ private:
|
||||
nlohmann::json build_body(const std::vector<Message>& messages,
|
||||
const std::vector<Tool>& tools) const;
|
||||
static size_t write_cb(char* ptr, size_t size, size_t nmemb, void* userdata);
|
||||
static int xferinfo_cb(void* cookie,
|
||||
curl_off_t dltotal,
|
||||
curl_off_t dlnow,
|
||||
curl_off_t ultotal,
|
||||
curl_off_t ulnow);
|
||||
std::expected<std::string, std::string> http_request(const std::string& full_url,
|
||||
const std::string& method,
|
||||
const std::string& body = "",
|
||||
|
||||
@@ -38,8 +38,7 @@ size_t OllamaClient::write_cb(char* ptr, size_t size, size_t nmemb, void* userda
|
||||
return size * nmemb;
|
||||
}
|
||||
|
||||
|
||||
int OllamaClient::xferinfo_cb(void* cookie,
|
||||
static int xferinfo_cb(void* cookie,
|
||||
curl_off_t dltotal,
|
||||
curl_off_t dlnow,
|
||||
curl_off_t ultotal,
|
||||
|
||||
Reference in New Issue
Block a user