Class: A2A::Server::MultiAgent

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_a2a/server/multi_agent.rb

Overview

Hosts multiple A2A agents on a single server, each at its own URL path.

Usage:

A2A.multi_server(
  agents: {
    "/anthropic" => { agent_card: card1, executor: exec1 },
    "/openai"    => { agent_card: card2, executor: exec2 }
  },
  port: 9292
).run

Instance Method Summary collapse

Constructor Details

#initialize(agents:, host: "localhost", port: 9292) ⇒ MultiAgent

Returns a new instance of MultiAgent.



18
19
20
21
22
# File 'lib/simple_a2a/server/multi_agent.rb', line 18

def initialize(agents:, host: "localhost", port: 9292)
  @agents = agents
  @host   = host
  @port   = port
end

Instance Method Details

#runObject



24
25
26
# File 'lib/simple_a2a/server/multi_agent.rb', line 24

def run
  FalconRunner.new(rack_app, host: @host, port: @port).run
end