diff --git a/src/solanaceae/llama-cpp-web/llama_cpp_web_impl.cpp b/src/solanaceae/llama-cpp-web/llama_cpp_web_impl.cpp index 1d46415..45678ca 100644 --- a/src/solanaceae/llama-cpp-web/llama_cpp_web_impl.cpp +++ b/src/solanaceae/llama-cpp-web/llama_cpp_web_impl.cpp @@ -27,6 +27,7 @@ LlamaCppWeb::~LlamaCppWeb(void) { } bool LlamaCppWeb::isGood(void) { + //return true; // HACK: test old llama server auto res = _cli.Get("/health"); if ( res.error() != httplib::Error::Success || @@ -122,7 +123,7 @@ std::string LlamaCppWeb::completeLine(const std::string_view prompt) { {"temperature", 0.9}, // depends 1.0 for chat models {"top_k", 60}, {"top_p", 1.0}, // disable - {"n_predict", 1000}, + {"n_predict", 400}, {"seed", _rng()}, {"stop", {"\n"}}, {"cache_prompt", static_cast(_use_server_cache)}, diff --git a/src/solanaceae/rpbot/rpbot.cpp b/src/solanaceae/rpbot/rpbot.cpp index 5517eaf..35246eb 100644 --- a/src/solanaceae/rpbot/rpbot.cpp +++ b/src/solanaceae/rpbot/rpbot.cpp @@ -96,7 +96,7 @@ void RPBot::stateTransition(const Contact3 c, const StateIdle& from, StateNextAc template<> void RPBot::stateTransition(const Contact3, const StateNextActor&, StateIdle& to) { - to.timeout = std::uniform_real_distribution<>{10.f, 45.f}(_rng); + to.timeout = std::uniform_real_distribution<>{30.f, 5.f*60.f}(_rng); } template<> @@ -142,6 +142,8 @@ R"sys(Transcript of a group chat, where {self_name} talks to online strangers. assert(_conf.has_string("RPBot", "system_prompt")); registerCommands(); + + _rmm.subscribe(this, RegistryMessageModel_Event::message_construct); } float RPBot::tick(float time_delta) { @@ -279,6 +281,10 @@ bool RPBot::onEvent(const Message::Events::MessageConstruct& e) { return false; } + if (_cr.any_of(contact_from)) { + return false; // ignore own messages + } + Contact3 rpbot_contact = entt::null; // check ContactTo (public) @@ -302,6 +308,7 @@ bool RPBot::onEvent(const Message::Events::MessageConstruct& e) { auto& timeout = _cr.get(rpbot_contact).timeout; // TODO: config with id timeout = std::min(timeout, _conf.get_double("RPBot", "max_interactive_delay").value_or(4.f)); + std::cout << "RPBot: onMsg new timeout: " << timeout << "\n"; return false; }