orkes.graph.Node#
- class orkes.graph.Node(name, func, graph_state)[source]#
Represents a node in the computational graph.
Each node encapsulates a function to be executed and maintains its state within the graph.
- Parameters:
name (str)
func (Callable)
- name#
The unique identifier for the node.
- Type:
str
- func#
The function to be executed by this node.
- Type:
Callable
- graph_state#
A reference to the graph’s state.
- id#
A unique identifier for the node instance.
- Type:
str
- description#
The docstring of the function.
- Type:
str
- __init__(name, func, graph_state)[source]#
Initializes a Node.
- Parameters:
name (str) – The unique identifier for the node.
func (Callable) – The function to be executed by this node. The function should accept the graph’s state as input and return an output that contributes to the state.
graph_state – A reference to the graph’s state, allowing the node to interact with and modify it.
Methods
__init__(name, func, graph_state)Initializes a Node.
execute(input_state)Executes the node's function.