Class: LangGraphRB::ToolNode

Inherits:
Node
  • Object
show all
Defined in:
lib/langgraph_rb/node.rb

Overview

Specialized node for tool calls

Instance Attribute Summary collapse

Attributes inherited from Node

#block, #name

Instance Method Summary collapse

Methods inherited from Node

#call, #inspect, #to_s

Constructor Details

#initialize(name, tool:, &block) ⇒ ToolNode

Returns a new instance of ToolNode.



75
76
77
78
# File 'lib/langgraph_rb/node.rb', line 75

def initialize(name, tool:, &block)
  @tool = tool
  super(name, &(block || method(:default_tool_call)))
end

Instance Attribute Details

#toolObject (readonly)

Returns the value of attribute tool.



73
74
75
# File 'lib/langgraph_rb/node.rb', line 73

def tool
  @tool
end