mirror of
https://github.com/Balshgit/gpt_chat_bot.git
synced 2026-02-03 11:40:39 +03:00
auto load environment variables (#72)
* auto load environment variables * add providers gpt6 & chatxyz
This commit is contained in:
@@ -1,24 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
#include <thread>
|
||||
|
||||
#include <yaml_cpp_struct.hpp>
|
||||
|
||||
struct Config {
|
||||
std::string client_root_path;
|
||||
std::size_t interval{300};
|
||||
std::size_t work_thread_num{std::thread::hardware_concurrency() == 1 ? 2
|
||||
: std::thread::hardware_concurrency() * 2};
|
||||
std::string host{"0.0.0.0"};
|
||||
std::string port{"8858"};
|
||||
std::string chat_path{"/chat"};
|
||||
std::size_t interval;
|
||||
std::size_t work_thread_num;
|
||||
std::string host;
|
||||
std::string port;
|
||||
std::string chat_path;
|
||||
std::vector<std::string> providers;
|
||||
bool enable_proxy;
|
||||
std::string http_proxy;
|
||||
std::string api_key;
|
||||
std::vector<std::string> ip_white_list;
|
||||
std::string zeus{"http://127.0.0.1:8860"};
|
||||
std::string flaresolverr{"http://127.0.0.1:8191/v1"};
|
||||
std::string zeus;
|
||||
std::string flaresolverr;
|
||||
};
|
||||
YCS_ADD_STRUCT(Config, client_root_path, interval, work_thread_num, host, port, chat_path, providers, enable_proxy,
|
||||
http_proxy, api_key, ip_white_list, zeus, flaresolverr)
|
||||
|
||||
@@ -33,6 +33,8 @@ public:
|
||||
boost::asio::awaitable<void> aiChatOnline(std::shared_ptr<Channel>, nlohmann::json);
|
||||
boost::asio::awaitable<void> fakeGpt(std::shared_ptr<Channel>, nlohmann::json);
|
||||
boost::asio::awaitable<void> aura(std::shared_ptr<Channel>, nlohmann::json);
|
||||
boost::asio::awaitable<void> gpt6(std::shared_ptr<Channel>, nlohmann::json);
|
||||
boost::asio::awaitable<void> chatxyz(std::shared_ptr<Channel>, nlohmann::json);
|
||||
|
||||
private:
|
||||
boost::asio::awaitable<std::expected<boost::beast::ssl_stream<boost::beast::tcp_stream>, std::string>>
|
||||
|
||||
Reference in New Issue
Block a user