Entropic 2.3.8
Local-first agentic inference engine
Loading...
Searching...
No Matches
messages_json.h File Reference

Shared parser: messages-JSON wire format → vector<Message>. More...

#include <entropic/types/message.h>
#include <string>
#include <vector>
Include dependency graph for messages_json.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  entropic
 Activate model on GPU (WARM → ACTIVE).
 

Functions

std::vector< Messageentropic::parse_messages_json (const char *json_str)
 Parse a JSON array of messages into a vector of Message.
 
bool entropic::any_message_has_images (const std::vector< Message > &messages)
 Convenience: true if any message carries image content_parts.
 

Detailed Description

Shared parser: messages-JSON wire format → vector<Message>.

Originally lived in src/inference/inference_c_api.cpp as an anonymous-namespace helper (v1.9.11). Extracted to a shared library-internal utility in v2.1.8 so the facade's entropic_run_messages entry point can reuse the same parsing without duplicating logic. The implementation depends on nlohmann/json but the header surface is third-party-free per architecture-cpp.md design rule #6.

Wire format (OpenAI-compatible content arrays):

[
{"role":"user","content":"plain text"},
{"role":"user","content":[
{"type":"text","text":"describe"},
{"type":"image","path":"/tmp/foo.png"}
]}
]
Version
2.1.8

Definition in file messages_json.h.