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 by the Agent-owned RubyLLM ToolCall interceptor before execution.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tool_calls) ⇒ 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.



10
11
12
13
14
# File 'lib/phronomy/agent/tool_call_intercepted.rb', line 10

def initialize(tool_calls)
  @tool_calls = Array(tool_calls).freeze
  names = @tool_calls.map(&:name).join(", ")
  super("Tool call intercepted: #{names}")
end

Instance Attribute Details

#tool_callsObject (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.



8
9
10
# File 'lib/phronomy/agent/tool_call_intercepted.rb', line 8

def tool_calls
  @tool_calls
end

Instance Method Details

#tool_callObject

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.

Convenience accessor for callers that only support one ToolCall.



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

def tool_call
  @tool_calls.first
end