Compare commits

...

3 Commits

Author SHA1 Message Date
Green Sky
a0d28fb516 fix android builds (missing zstd) by disabling zstd 2025-08-17 16:47:16 +02:00
Green Sky
39f714394b update and some fixes 2025-08-08 15:02:54 +02:00
Green Sky
7e1b424adb make contact store version visible 2025-03-10 20:58:24 +01:00
5 changed files with 13 additions and 8 deletions

View File

@@ -51,9 +51,12 @@ endif()
#endif()
if (NOT TARGET httplib::httplib)
# fails on android
set(HTTPLIB_USE_ZSTD_IF_AVAILABLE OFF CACHE BOOL "" FORCE)
FetchContent_Declare(httplib
GIT_REPOSITORY https://github.com/yhirose/cpp-httplib.git
GIT_TAG v0.19.0
GIT_TAG v0.22.0
EXCLUDE_FROM_ALL
)
FetchContent_MakeAvailable(httplib)

View File

@@ -1,6 +1,7 @@
#include <solanaceae/plugin/solana_plugin_v1.h>
#include <solanaceae/util/config_model.hpp>
#include <solanaceae/contact/contact_store_i.hpp>
#include <solanaceae/llama-cpp-web/text_completion_interface.hpp>
#include <solanaceae/rpbot/rpbot.hpp>
#include <solanaceae/message3/message_command_dispatcher.hpp>

View File

@@ -20,11 +20,11 @@ target_link_libraries(solanaceae_llama-cpp-web PUBLIC
########################################
add_executable(test1 EXCLUDE_FROM_ALL
add_executable(solanaceae_llama-cpp-web_test1 EXCLUDE_FROM_ALL
test1.cpp
)
target_link_libraries(test1 PUBLIC
target_link_libraries(solanaceae_llama-cpp-web_test1 PUBLIC
solanaceae_llama-cpp-web
)

View File

@@ -33,7 +33,10 @@ bool LlamaCppWeb::isGood(void) {
res.error() != httplib::Error::Success ||
res->status != 200 ||
res->body.empty() ||
res->get_header_value("Content-Type") != "application/json"
(
res->get_header_value("Content-Type") != "application/json" &&
res->get_header_value("Content-Type") != "application/json; charset=utf-8"
)
) {
return false;
}

View File

@@ -5,13 +5,11 @@
#include <nlohmann/json.hpp>
#include <iostream>
#include <random>
#include <vector>
#include <chrono>
#include <cstdint>
int main(void) {
SimpleConfigModel scm;
scm.set("LlamaCppWeb", "server", std::string_view{"localhost:8081"});
LlamaCppWeb lcw{scm};
if (!lcw.isGood()) {
@@ -30,7 +28,7 @@ int main(void) {
{"top_p", 1.0}, // disable
{"n_predict", 16},
{"stop", {".", "\n"}},
{"gramar", ""}
{"grammar", ""}
})
<< "\n";