Exception: Phronomy::Agent::ToolCallIntercepted Private

Inherits:
StandardError
  • Object
show all
Defined in:
lib/phronomy/agent/tool_call_intercepted.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Raised inside the on_tool_call hook registered by InvocationSession to intercept every tool call before RubyLLM executes it.

Catching this exception in calling_llm_action lets the Agent FSM route through :executing_tool (and possibly :awaiting_approval) rather than executing the tool inside RubyLLM's internal loop.

This class is intentionally NOT part of the public API.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tool_call) ⇒ ToolCallIntercepted

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of ToolCallIntercepted.

Parameters:

  • tool_call (Object)

    the RubyLLM tool_call object



20
21
22
23
# File 'lib/phronomy/agent/tool_call_intercepted.rb', line 20

def initialize(tool_call)
  super("Tool call intercepted: #{tool_call.name}")
  @tool_call = tool_call
end

Instance Attribute Details

#tool_callObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns the RubyLLM tool_call object (responds to #name, #arguments, #id).

Returns:

  • (Object)

    the RubyLLM tool_call object (responds to #name, #arguments, #id)



16
17
18
# File 'lib/phronomy/agent/tool_call_intercepted.rb', line 16

def tool_call
  @tool_call
end