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.
-
#event_router ⇒ Object
readonly
Returns the value of attribute event_router.
-
#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, 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, 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 |
# File 'lib/simple_a2a/server/base.rb', line 8 def initialize( agent_card:, executor:, storage: Storage::Memory.new, push_sender: nil, host: "localhost", port: 9292 ) @agent_card = agent_card @executor = executor @storage = storage @event_router = EventRouter.new @push_sender = push_sender @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 |
#event_router ⇒ Object (readonly)
Returns the value of attribute event_router.
6 7 8 |
# File 'lib/simple_a2a/server/base.rb', line 6 def event_router @event_router 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
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/simple_a2a/server/base.rb', line 25 def rack_app klass = Class.new(App) klass.configure( agent_card: @agent_card, storage: @storage, executor: @executor, event_router: @event_router, push_sender: @push_sender ) klass.freeze.app end |
#run ⇒ Object
37 38 39 40 |
# File 'lib/simple_a2a/server/base.rb', line 37 def run app = rack_app FalconRunner.new(app, host: @host, port: @port).run end |