NeoGraph 0.10.0
A C++17 Graph Agent Engine Library — LangGraph for C++
Loading...
Searching...
No Matches
schema_provider.h File Reference

Multi-vendor LLM provider adapter driven by JSON schema configuration. More...

#include <neograph/api.h>
#include <neograph/provider.h>
#include <neograph/llm/json_path.h>
#include <asio/executor_work_guard.hpp>
#include <asio/io_context.hpp>
#include <fstream>
#include <memory>
#include <mutex>
#include <optional>
#include <set>
#include <string>
#include <thread>
#include <map>
Include dependency graph for schema_provider.h:

Go to the source code of this file.

Classes

struct  neograph::llm::SchemaProvider::Config
 Configuration for schema-based provider. More...
 
class  neograph::llm::SchemaProvider
 LLM provider that adapts to any API via a JSON schema. More...
 
class  neograph::llm::test_access::SchemaProviderTestAccess
 Test-only friend of SchemaProvider. More...
 

Detailed Description

Multi-vendor LLM provider adapter driven by JSON schema configuration.

SchemaProvider reads a JSON schema file that describes how to serialize requests and parse responses for any LLM API (OpenAI, Claude, Gemini, etc.). Built-in schemas are embedded at build time via embed_schemas.py.

This allows supporting new LLM providers without writing C++ code – just add a new JSON schema file.

Warning
Downstream httplib.h macro consistency (issue #16). The SchemaProvider implementation TU defines CPPHTTPLIB_OPENSSL_SUPPORT before including <httplib.h>. If your application also includes <httplib.h> in any of its own TUs (e.g. to run an httplib::Server SSE endpoint), every such include site MUST #define CPPHTTPLIB_OPENSSL_SUPPORT before the include, OR you must set target_compile_definitions(your_target PRIVATE CPPHTTPLIB_OPENSSL_SUPPORT) globally. cpp-httplib is header-only and ClientImpl's layout differs between the two macro states; mismatched TUs produce a silent ODR violation that SEGVs inside getaddrinfo on the first LLM call. The audit recipe and a worked example live in docs/troubleshooting.md under "C++ consumers — `httplib.h` macro consistency".

Definition in file schema_provider.h.