Class: Insika::Tools::A2ARemote
- Inherits:
-
RubyLLM::Tool
- Object
- RubyLLM::Tool
- Insika::Tools::A2ARemote
- Defined in:
- lib/insika/tools/a2a_remote.rb
Overview
Delegates to a remote A2A agent. A NORMAL Tool Registry tool — the agent's allowlist governs who may delegate. Lazy require of the gem: it does NOT enter lib/insika.rb; it is loaded in the registration block (wiring) on the 1st instance. One instance per remote agent (its own name/description).
Instance Method Summary collapse
- #description ⇒ Object
- #execute(message:) ⇒ Object
-
#initialize(client:, url:, tool_name:, description:, event_stream: nil) ⇒ A2ARemote
constructor
A new instance of A2ARemote.
-
#name ⇒ Object
name/description per INSTANCE (RubyLLM derives them from the class; we override — otherwise the model would see "insika--tools--a2a_remote" for every remote).
Constructor Details
#initialize(client:, url:, tool_name:, description:, event_stream: nil) ⇒ A2ARemote
Returns a new instance of A2ARemote.
14 15 16 17 18 19 20 21 |
# File 'lib/insika/tools/a2a_remote.rb', line 14 def initialize(client:, url:, tool_name:, description:, event_stream: nil) @client = client @url = url @tool_name = tool_name @description = description @event_stream = event_stream super() end |
Instance Method Details
#description ⇒ Object
26 |
# File 'lib/insika/tools/a2a_remote.rb', line 26 def description = @description |
#execute(message:) ⇒ Object
28 29 30 31 32 |
# File 'lib/insika/tools/a2a_remote.rb', line 28 def execute(message:) result = @client.call(@url, .to_s) emit(result) result[:error] ? { error: result[:error] } : result[:text] end |
#name ⇒ Object
name/description per INSTANCE (RubyLLM derives them from the class; we override — otherwise the model would see "insika--tools--a2a_remote" for every remote).
25 |
# File 'lib/insika/tools/a2a_remote.rb', line 25 def name = @tool_name |