The abstract base R6 class for all nodes within an AgentDAG.
It defines the common interface and fields required for any node to be
orchestrated by the HydraR engine. Subclasses must implement the run()
method.
Public fields
idString. Unique identifier for the node.
labelString. Human-readable name/label.
last_resultList. Results from most recent execution.
paramsList. Arbitrary metadata/config parameters.
Methods
Method new()
Initialize AgentNode
Arguments
idString. A unique identifier for the node. Must be unique within a single DAG.
labelString. An optional human-readable name for the node. Defaults to the
idif not provided. This label is used in Mermaid visualizations.paramsList. An optional named list of arbitrary metadata or configuration parameters that are stored on the node and can be accessed during execution. Useful for passing static configuration to nodes created via factories. Run the Node
Method run()
Examples
# Defining a custom subclass of AgentNode
CustomNode <- R6::R6Class("CustomNode",
inherit = AgentNode,
public = list(
run = function(state, ...) {
message("Executing custom node: ", self$id)
list(status = "success", output = "Custom output")
}
)
)
node <- CustomNode$new("node_1", label = "My First Node")