NeoGraph 0.16.0
A C++20 Graph Agent Engine Library — LangGraph for C++
Loading...
Searching...
No Matches
neograph::graph::ConditionSpec Struct Reference

Singleton registry for conditional edge routing functions. More...

#include <loader.h>

Public Attributes

std::vector< std::string > labels
 Labels the condition is known to return ("known" for open specs, "exactly these" for closed specs).
 
bool open = false
 True when the condition can return values outside labels (e.g.
 

Detailed Description

Singleton registry for conditional edge routing functions.

Maps condition names (used in JSON edge definitions) to ConditionFn implementations. Built-in conditions: "has_tool_calls", "route_channel".

ConditionRegistry::instance().register_condition("is_long",
[](const GraphState& state) -> std::string {
return state.get("messages").size() > 10 ? "true" : "false";
});
Thread-safe container for all graph state channels.
Definition state.h:55
json get(const std::string &channel) const
Read a channel's current value (thread-safe, shared lock).

Declared output-label contract of a condition function.

Backs static route-completeness checking (GraphValidator E10): a conditional edge over a closed condition must map every declared label; an unmapped label is an error and a route key outside the label set is dead. The reserved default key is allowed as a defensive route but does not replace closed-label coverage. Conditions registered without a spec are skipped by the validator.

Definition at line 102 of file loader.h.

Member Data Documentation

◆ open

bool neograph::graph::ConditionSpec::open = false

True when the condition can return values outside labels (e.g.

route_channel returns arbitrary channel content) — the validator then only warns about uncovered known labels.

Definition at line 109 of file loader.h.


The documentation for this struct was generated from the following file: