NeoGraph 0.16.0
A C++20 Graph Agent Engine Library — LangGraph for C++
Loading...
Searching...
No Matches
neograph::ToolExecutionController Class Referencefinal

The single tool execution boundary shared by Agent and graph dispatch. More...

#include <tool_execution.h>

Public Member Functions

asio::awaitable< std::string > execute_async (Tool &tool, json arguments, ToolExecutionContext context)
 Throwing facade over execute_result_async: the output on success, graph::CancelledException for CancelledBeforeStart and CancellationRequested, and ToolExecutionError, which carries the whole ToolExecutionResult, for every other status.
 
asio::awaitable< ToolExecutionResult > execute_result_async (Tool &tool, json arguments, ToolExecutionContext context)
 Typed terminal contract shared by all tool implementations.
 

Detailed Description

The single tool execution boundary shared by Agent and graph dispatch.

A controller is intentionally host-shareable: injecting the same instance into independently constructed engines makes their resource keys compete in one queue rather than accidentally granting each engine a private limit.

Definition at line 363 of file tool_execution.h.

Member Function Documentation

◆ execute_async()

asio::awaitable< std::string > neograph::ToolExecutionController::execute_async ( Tool &  tool,
json  arguments,
ToolExecutionContext  context 
)

Throwing facade over execute_result_async: the output on success, graph::CancelledException for CancelledBeforeStart and CancellationRequested, and ToolExecutionError, which carries the whole ToolExecutionResult, for every other status.

HookBoundaryBlocked and graph::NodeInterrupt from tool code propagate unchanged, as from execute_result_async.

◆ execute_result_async()

asio::awaitable< ToolExecutionResult > neograph::ToolExecutionController::execute_result_async ( Tool &  tool,
json  arguments,
ToolExecutionContext  context 
)

Typed terminal contract shared by all tool implementations.

Every failure becomes a typed result, cancellation included (CancelledBeforeStart / CancellationRequested), except the run control signals that tool code can raise: HookBoundaryBlocked and graph::NodeInterrupt propagate unchanged, so no caller can turn them into a result a model reads. A call that would start at or after context.deadline is Expired; the deadline also bounds the queue wait. A system error from tool code after it started is an ordinary failure. Output and error text are well-formed UTF-8. See "Tool failure contract" in the reference.


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