Class: A2A::Server::Base
- Inherits:
-
Object
- Object
- A2A::Server::Base
- Defined in:
- lib/simple_a2a/server/base.rb
Instance Attribute Summary collapse
-
#agent_card ⇒ Object
readonly
Returns the value of attribute agent_card.
-
#executor ⇒ Object
readonly
Returns the value of attribute executor.
-
#push_sender ⇒ Object
readonly
Returns the value of attribute push_sender.
-
#storage ⇒ Object
readonly
Returns the value of attribute storage.
Instance Method Summary collapse
-
#initialize(agent_card:, executor:, storage: Storage::Memory.new, push_sender: nil, push_config_store: nil, host: "localhost", port: 9292) ⇒ Base
constructor
A new instance of Base.
- #rack_app ⇒ Object
- #run ⇒ Object
Constructor Details
#initialize(agent_card:, executor:, storage: Storage::Memory.new, push_sender: nil, push_config_store: nil, host: "localhost", port: 9292) ⇒ Base
Returns a new instance of Base.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/simple_a2a/server/base.rb', line 8 def initialize( agent_card:, executor:, storage: Storage::Memory.new, push_sender: nil, push_config_store: nil, host: "localhost", port: 9292 ) @agent_card = agent_card @executor = executor @storage = storage @push_sender = push_sender @push_config_store = push_config_store @host = host @port = port end |
Instance Attribute Details
#agent_card ⇒ Object (readonly)
Returns the value of attribute agent_card.
6 7 8 |
# File 'lib/simple_a2a/server/base.rb', line 6 def agent_card @agent_card end |
#executor ⇒ Object (readonly)
Returns the value of attribute executor.
6 7 8 |
# File 'lib/simple_a2a/server/base.rb', line 6 def executor @executor end |
#push_sender ⇒ Object (readonly)
Returns the value of attribute push_sender.
6 7 8 |
# File 'lib/simple_a2a/server/base.rb', line 6 def push_sender @push_sender end |
#storage ⇒ Object (readonly)
Returns the value of attribute storage.
6 7 8 |
# File 'lib/simple_a2a/server/base.rb', line 6 def storage @storage end |
Instance Method Details
#rack_app ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/simple_a2a/server/base.rb', line 26 def rack_app klass = Class.new(App) klass.configure( agent_card: @agent_card, storage: @storage, executor: @executor, broadcast_registry: BroadcastRegistry.new, push_sender: @push_sender, push_config_store: @push_config_store ) klass.freeze.app end |
#run ⇒ Object
39 40 41 42 |
# File 'lib/simple_a2a/server/base.rb', line 39 def run app = rack_app FalconRunner.new(app, host: @host, port: @port).run end |