Exception: Phronomy::Agent::ToolCallIntercepted Private
- Inherits:
-
StandardError
- Object
- StandardError
- Phronomy::Agent::ToolCallIntercepted
- 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.
Normal control-transfer signal raised before RubyLLM executes a Tool Call.
RubyLLM >= 1.15 guarantees that the complete assistant message has already been added to Chat#messages before before_tool_call runs. Keeping that message here allows Phronomy to persist the complete Provider outcome even though the RubyLLM call itself unwinds through this exception.
Instance Attribute Summary collapse
- #assistant_message ⇒ Object readonly private
- #assistant_outcome ⇒ Object readonly private
- #llm_call_id ⇒ Object readonly private
- #tool_calls ⇒ Object readonly private
Instance Method Summary collapse
-
#initialize(tool_calls, assistant_message: nil, assistant_outcome: nil, llm_call_id: nil) ⇒ ToolCallIntercepted
constructor
private
A new instance of ToolCallIntercepted.
- #tool_call ⇒ Object private
Constructor Details
#initialize(tool_calls, assistant_message: nil, assistant_outcome: nil, llm_call_id: nil) ⇒ 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.
15 16 17 18 19 20 21 22 |
# File 'lib/phronomy/agent/tool_call_intercepted.rb', line 15 def initialize(tool_calls, assistant_message: nil, assistant_outcome: nil, llm_call_id: nil) @tool_calls = Array(tool_calls).freeze @assistant_message = @assistant_outcome = assistant_outcome || ProviderCallOutcome.capture() @llm_call_id = llm_call_id&.to_s&.freeze names = @tool_calls.map(&:name).join(", ") super("Tool call intercepted: #{names}") end |
Instance Attribute Details
#assistant_message ⇒ Object (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.
13 14 15 |
# File 'lib/phronomy/agent/tool_call_intercepted.rb', line 13 def @assistant_message end |
#assistant_outcome ⇒ Object (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.
13 14 15 |
# File 'lib/phronomy/agent/tool_call_intercepted.rb', line 13 def assistant_outcome @assistant_outcome end |
#llm_call_id ⇒ Object (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.
13 14 15 |
# File 'lib/phronomy/agent/tool_call_intercepted.rb', line 13 def llm_call_id @llm_call_id end |
#tool_calls ⇒ Object (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.
13 14 15 |
# File 'lib/phronomy/agent/tool_call_intercepted.rb', line 13 def tool_calls @tool_calls end |
Instance Method Details
#tool_call ⇒ Object
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.
24 25 26 |
# File 'lib/phronomy/agent/tool_call_intercepted.rb', line 24 def tool_call @tool_calls.first end |