|
Entropic 2.3.8
Local-first agentic inference engine
|
JSON serialization helpers for the facade. More...
#include <entropic/mcp/utf8_sanitize.h>#include <entropic/types/config.h>#include <entropic/types/message.h>#include <nlohmann/json.hpp>#include <string>#include <vector>

Go to the source code of this file.
Functions | |
| std::string | facade_json::serialize_messages (const std::vector< entropic::Message > &messages) |
| Serialize messages to JSON array string. | |
| nlohmann::json | facade_json::parse (const char *str) |
| Parse JSON string to nlohmann::json object. | |
| nlohmann::json | facade_json::obj () |
| Create a JSON object from key-value pairs. | |
| nlohmann::json | facade_json::arr () |
| Create an empty JSON array. | |
| std::string | facade_json::serialize_adapter_info (const entropic::AdapterInfo &ai) |
| Serialize an AdapterInfo to JSON string. | |
| std::string | facade_json::serialize_adapter_list (const std::vector< entropic::AdapterInfo > &adapters) |
| Serialize a list of AdapterInfo to JSON array string. | |
JSON serialization helpers for the facade.
Concentrates all nlohmann/json usage in one private facade header. The main entropic.cpp should not include nlohmann/json.hpp directly.
Definition in file json_serializers.h.
|
inline |
Create an empty JSON array.
Definition at line 75 of file json_serializers.h.
|
inline |
Create a JSON object from key-value pairs.
Definition at line 67 of file json_serializers.h.
|
inline |
Parse JSON string to nlohmann::json object.
| str | JSON string. |
Definition at line 56 of file json_serializers.h.
|
inline |
Serialize an AdapterInfo to JSON string.
| ai | Adapter info struct. |
Definition at line 84 of file json_serializers.h.
|
inline |
Serialize a list of AdapterInfo to JSON array string.
| adapters | Adapter info list. |
Definition at line 104 of file json_serializers.h.
|
inline |
Serialize messages to JSON array string.
Sanitizes content through entropic::mcp::sanitize_utf8 before each push so that any bytes which slipped past the inbound sanitize boundaries (model-stream desync, pre-2.1.1 audit-replayed history, pre-2.1.1 stored conversation state) cannot reach arr.dump() and raise json::type_error 316. This is the C-API outbound boundary; see include/entropic/mcp/utf8_sanitize.h for the full boundary policy. Issue #3 (v2.1.1).
| messages | Message vector. |
Definition at line 39 of file json_serializers.h.