refactor and prep rpbot

This commit is contained in:
2024-01-23 23:05:55 +01:00
parent c497b19b20
commit e504d7a8ef
10 changed files with 129 additions and 12 deletions

View File

@@ -1,19 +1,19 @@
#pragma once
#include "./llama_cpp_web_interface.hpp"
#include "./text_completion_interface.hpp"
#include <httplib.h>
#include <nlohmann/json_fwd.hpp>
#include <random>
struct LlamaCppWeb : public LlamaCppWebI {
struct LlamaCppWeb : public TextCompletionI {
httplib::Client _cli{"http://localhost:8080"};
std::minstd_rand _rng{std::random_device{}()};
~LlamaCppWeb(void);
bool isHealthy(void) override;
bool isGood(void) override;
int64_t completeSelect(const std::string_view prompt, const std::vector<std::string_view>& possible) override;
std::string completeLine(const std::string_view prompt) override;