diff --git a/gpt4all-backend-test/src/main.cpp b/gpt4all-backend-test/src/main.cpp index f12fa0f9..559e26af 100644 --- a/gpt4all-backend-test/src/main.cpp +++ b/gpt4all-backend-test/src/main.cpp @@ -3,7 +3,7 @@ #include // IWYU pragma: keep #include #include // IWYU pragma: keep -#include +#include #include #include @@ -14,13 +14,13 @@ #include #include -using gpt4all::backend::LLMProvider; +using gpt4all::backend::OllamaClient; static void run() { fmt::print("Connecting to server at {}\n", OLLAMA_URL); - LLMProvider provider(OLLAMA_URL); + OllamaClient provider(OLLAMA_URL); auto version = QCoro::waitFor(provider.getVersion()); if (version) { fmt::print("Server version: {}\n", version->version); diff --git a/gpt4all-backend/CMakeLists.txt b/gpt4all-backend/CMakeLists.txt index d5b9812b..fcc46726 100644 --- a/gpt4all-backend/CMakeLists.txt +++ b/gpt4all-backend/CMakeLists.txt @@ -11,7 +11,7 @@ add_subdirectory(deps) add_subdirectory(src) target_sources(gpt4all-backend PUBLIC - FILE_SET public_headers TYPE HEADERS BASE_DIRS include - FILES include/gpt4all-backend/main.h - include/gpt4all-backend/formatters.h + FILE_SET public_headers TYPE HEADERS BASE_DIRS include FILES + include/gpt4all-backend/formatters.h + include/gpt4all-backend/ollama_client.h ) diff --git a/gpt4all-backend/include/gpt4all-backend/main.h b/gpt4all-backend/include/gpt4all-backend/ollama_client.h similarity index 96% rename from gpt4all-backend/include/gpt4all-backend/main.h rename to gpt4all-backend/include/gpt4all-backend/ollama_client.h index fcd62cc1..f1773b23 100644 --- a/gpt4all-backend/include/gpt4all-backend/main.h +++ b/gpt4all-backend/include/gpt4all-backend/ollama_client.h @@ -48,9 +48,9 @@ using DataOrRespErr = std::expected; struct VersionResponse { QString version; }; BOOST_DESCRIBE_STRUCT(VersionResponse, (), (version)) -class LLMProvider { +class OllamaClient { public: - LLMProvider(QUrl baseUrl) + OllamaClient(QUrl baseUrl) : m_baseUrl(baseUrl) {} diff --git a/gpt4all-backend/src/CMakeLists.txt b/gpt4all-backend/src/CMakeLists.txt index b83f306d..379e0f25 100644 --- a/gpt4all-backend/src/CMakeLists.txt +++ b/gpt4all-backend/src/CMakeLists.txt @@ -2,7 +2,7 @@ set(TARGET gpt4all-backend) add_library(${TARGET} STATIC json_helpers.cpp - main.cpp + ollama_client.cpp ) target_compile_features(${TARGET} PUBLIC cxx_std_23) gpt4all_add_warning_options(${TARGET}) diff --git a/gpt4all-backend/src/main.cpp b/gpt4all-backend/src/ollama_client.cpp similarity index 91% rename from gpt4all-backend/src/main.cpp rename to gpt4all-backend/src/ollama_client.cpp index fcfdcf82..f33d0cc4 100644 --- a/gpt4all-backend/src/main.cpp +++ b/gpt4all-backend/src/ollama_client.cpp @@ -1,4 +1,4 @@ -#include "main.h" +#include "ollama_client.h" #include "json_helpers.h" @@ -20,7 +20,7 @@ namespace json = boost::json; namespace gpt4all::backend { -auto LLMProvider::getVersion() -> QCoro::Task> +auto OllamaClient::getVersion() -> QCoro::Task> { std::unique_ptr reply(m_nam.get(QNetworkRequest(m_baseUrl.resolved(u"/api/version"_s)))); if (reply->error())