Full C++23 framework tree: runtime, observability, security, data, app, realtime, supervisor, clients, CLI, example plus enterprise tenancy, audit, operability, governance, supplychain. Postgres via docker compose for tests.
58 lines
1.3 KiB
C++
58 lines
1.3 KiB
C++
#pragma once
|
|
|
|
// Client parity skeletons: REST client (self-call transport), realtime
|
|
// client notes, OpenAPI registry, and the AI harness sample.
|
|
// Gap: real HTTP/1.1 plus HTTP/2 client in 08-clients-openapi.md, realtime
|
|
// clients in 06-realtime.md, and the AI harness CLI in 09-cli-ops.md.
|
|
|
|
#include <functional>
|
|
#include <map>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "Http.hpp"
|
|
|
|
namespace molo::example::fw {
|
|
|
|
using RestTransport = std::function<Response(Request)>;
|
|
|
|
class RestClient {
|
|
public:
|
|
explicit RestClient(RestTransport transport);
|
|
|
|
Response get(const std::string& path);
|
|
Response post_json(const std::string& path, const std::string& json);
|
|
|
|
private:
|
|
RestTransport transport_;
|
|
};
|
|
|
|
struct OpenApiRoute {
|
|
std::string path;
|
|
std::string method;
|
|
std::string summary;
|
|
};
|
|
|
|
class OpenApi {
|
|
public:
|
|
void add(const std::string& path, const std::string& method,
|
|
const std::string& summary);
|
|
std::string to_json() const;
|
|
std::size_t size() const;
|
|
|
|
private:
|
|
std::vector<OpenApiRoute> routes_;
|
|
};
|
|
|
|
struct AiSample {
|
|
std::string base_url;
|
|
std::string model;
|
|
std::string redacted_prompt;
|
|
std::vector<std::string> stream_chunks;
|
|
};
|
|
|
|
std::string redact_secrets(const std::string& text);
|
|
AiSample ai_harness_sample(const std::string& prompt);
|
|
|
|
} // namespace molo::example::fw
|