NeoGraph 0.10.0
A C++17 Graph Agent Engine Library — LangGraph for C++
Loading...
Searching...
No Matches
neograph::acp::ACPGraphAdapter Class Reference

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").
 

Detailed Description

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).

Definition at line 57 of file server.h.

Member Function Documentation

◆ build_initial_state()

virtual neograph::json neograph::acp::ACPGraphAdapter::build_initial_state ( const std::vector< ContentBlock > &  blocks,
const std::string &  session_id 
) const
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.

◆ extract_agent_text()

virtual std::string neograph::acp::ACPGraphAdapter::extract_agent_text ( const neograph::json &  output) const
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).


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