|
NeoGraph 0.10.0
A C++17 Graph Agent Engine Library — LangGraph for C++
|
Map between ACP ContentBlock[] and the engine's channels.
More...
#include <server.h>
Public Member Functions | |
| virtual neograph::json | build_initial_state (const std::vector< ContentBlock > &blocks, const std::string &session_id) const |
| Build the initial graph state for a turn. | |
| virtual std::string | extract_agent_text (const neograph::json &output) const |
| Pull the agent's text reply out of the graph's final state. | |
| virtual std::string | extract_user_text (const std::vector< ContentBlock > &blocks) const |
| Concatenate every text-typed ContentBlock with single-space joins; non-text blocks are ignored unless the adapter overrides this. | |
| virtual std::string | input_channel () const |
| Channel name to write the inbound user text into (default "prompt"). | |
| virtual std::string | output_channel () const |
| Channel name to read the agent's text reply from (default "response"). | |
Map between ACP ContentBlock[] and the engine's channels.
The default does the simplest possible thing: concatenate all text blocks into the input channel; read a string out of the output channel; emit that string as a single agent_message_chunk followed by StopReason::Completed.
Override to handle images/audio/embedded resources, to wire up a conversation-history channel, or to emit per-super-step thought chunks during the run (see emit_chunks_from_state below).
|
virtual |
Build the initial graph state for a turn.
Default behaviour: writes the user text to input_channel() AND seeds the _acp_session_id channel with the active session id (so nodes can locate their session for fs/* / permission calls). Subclasses overriding this should preserve _acp_session_id if they want ACPClient calls to keep working.
|
virtual |
Pull the agent's text reply out of the graph's final state.
Default looks at channels[<output_channel()>].value, then falls back to channels.messages[-1].content (matches ReAct examples).