#include "cdllexport.h" #include #include #include #include #include "../openaiclient.h" static std::shared_ptr gc = nullptr; class CApiDllExport { public: CApiDllExport(); public: static void init_exchange(ExchangeData* ex); public: static std::shared_ptr client; static std::string server_ip; static unsigned int port; asio::io_context io_context; }; std::shared_ptr CApiDllExport::client = nullptr; CApiDllExport::CApiDllExport() { } void CApiDllExport::init_exchange(ExchangeData* ex) { if (ex == nullptr) { return; } ex->content = nullptr; ex->ck = 0; ex->pk = 0; ex->len = 0; } void init_api(const char* ip, unsigned int port) { } ExchangeData* ask_openai(const char* content) { ExchangeData* ret = (ExchangeData*)malloc(sizeof(ExchangeData)); if (ret == nullptr) { return ret; } CApiDllExport::init_exchange(ret); return ret; } void free_exchange_data(ExchangeData* data) { }