mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-06-24 22:42:27 +00:00
rename the class to "OllamaClient"
This commit is contained in:
parent
06475dd113
commit
4c5dcf59ea
@ -3,7 +3,7 @@
|
||||
#include <QCoro/QCoroTask> // IWYU pragma: keep
|
||||
#include <fmt/base.h>
|
||||
#include <gpt4all-backend/formatters.h> // IWYU pragma: keep
|
||||
#include <gpt4all-backend/main.h>
|
||||
#include <gpt4all-backend/ollama_client.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QTimer>
|
||||
@ -14,13 +14,13 @@
|
||||
#include <expected>
|
||||
#include <variant>
|
||||
|
||||
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);
|
||||
|
@ -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
|
||||
)
|
||||
|
@ -48,9 +48,9 @@ using DataOrRespErr = std::expected<T, ResponseError>;
|
||||
struct VersionResponse { QString version; };
|
||||
BOOST_DESCRIBE_STRUCT(VersionResponse, (), (version))
|
||||
|
||||
class LLMProvider {
|
||||
class OllamaClient {
|
||||
public:
|
||||
LLMProvider(QUrl baseUrl)
|
||||
OllamaClient(QUrl baseUrl)
|
||||
: m_baseUrl(baseUrl)
|
||||
{}
|
||||
|
@ -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})
|
||||
|
@ -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<DataOrRespErr<VersionResponse>>
|
||||
auto OllamaClient::getVersion() -> QCoro::Task<DataOrRespErr<VersionResponse>>
|
||||
{
|
||||
std::unique_ptr<QNetworkReply> reply(m_nam.get(QNetworkRequest(m_baseUrl.resolved(u"/api/version"_s))));
|
||||
if (reply->error())
|
Loading…
Reference in New Issue
Block a user