Files
moloapp/src/cli/ai/socket_transport.hpp
T

27 lines
567 B
C++
Raw Normal View History

#pragma once
#include <string>
#include "ai/ai_transport.hpp"
namespace molo::ai {
// Minimal blocking HTTP transport over POSIX sockets. Plain http:// only;
// https:// URLs fail with the marked TLS stub reason.
class SocketAiTransport : public IAiTransport {
public:
AiHttpResponse post_stream(const AiHttpRequest& request) override;
private:
struct ParsedUrl {
std::string host;
int port = 80;
std::string path;
bool https = false;
bool ok = false;
};
static ParsedUrl parse(const std::string& url);
};
} // namespace molo::ai