Class: Brute::Loop::ToolCallStep

Inherits:
Step
  • Object
show all
Defined in:
lib/brute/loop/tool_call_step.rb

Overview

A Step that wraps an LLM::Function tool call.

Identity comes from the function’s call ID so tool results can be correlated back to the LLM’s request.

Constant Summary

Constants inherited from Step

Step::STATES

Instance Attribute Summary collapse

Attributes inherited from Step

#id

Instance Method Summary collapse

Methods inherited from Step

#call, #cancel, #error, generate_id, #jobs, #result, #state, #status

Constructor Details

#initialize(function:, **rest) ⇒ ToolCallStep

Returns a new instance of ToolCallStep.



16
17
18
19
# File 'lib/brute/loop/tool_call_step.rb', line 16

def initialize(function:, **rest)
  super(id: function.id, **rest)
  @function = function
end

Instance Attribute Details

#functionObject (readonly)

Returns the value of attribute function.



14
15
16
# File 'lib/brute/loop/tool_call_step.rb', line 14

def function
  @function
end

Instance Method Details

#perform(task) ⇒ Object



21
22
23
# File 'lib/brute/loop/tool_call_step.rb', line 21

def perform(task)
  @function.call
end