Class: Insika::Evals::A2ATransport
- Inherits:
-
Object
- Object
- Insika::Evals::A2ATransport
- Defined in:
- lib/insika/evals/transport.rb
Overview
Thin A2A transport: drives a REMOTE A2A agent (an agent that only speaks
A2A) through the same turn seam the Simulator uses. The outbound A2A
client already does the send+poll; this is the wrapper that makes it a
Transport. client answers #call(url, text, context_id:) -> text: or
error: — the Server::A2A::Client shape.
Instance Method Summary collapse
-
#initialize(client:, url:) ⇒ A2ATransport
constructor
A new instance of A2ATransport.
- #mono ⇒ Object
- #turn(agent:, conv:, message:) ⇒ Object
Constructor Details
#initialize(client:, url:) ⇒ A2ATransport
Returns a new instance of A2ATransport.
236 237 238 239 |
# File 'lib/insika/evals/transport.rb', line 236 def initialize(client:, url:) @client = client @url = url end |
Instance Method Details
#mono ⇒ Object
241 |
# File 'lib/insika/evals/transport.rb', line 241 def mono = Process.clock_gettime(Process::CLOCK_MONOTONIC) |
#turn(agent:, conv:, message:) ⇒ Object
243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 |
# File 'lib/insika/evals/transport.rb', line 243 def turn(agent:, conv:, message:) t0 = mono result = @client.call(@url, .to_s, context_id: conv) if result[:error] TurnOutcome.new( result: TurnResult.new(output_text: "", tool_calls: [], error: result[:error].to_s), ttfb: nil, total: (mono - t0) * 1000.0, usage: nil ) else TurnOutcome.new( result: TurnResult.new(output_text: result[:text].to_s, tool_calls: [], error: nil), ttfb: nil, total: (mono - t0) * 1000.0, usage: nil ) end end |