Class: A2A::Client
- Inherits:
-
Object
- Object
- A2A::Client
- Defined in:
- lib/a2a/client.rb
Overview
Async-HTTP based A2A protocol client.
Discovers agent cards and invokes operations via JSON-RPC:
Async do
client = A2A::Client.new("http://localhost:9292")
card = client.agent_card
result = client.send_message(message: { ... })
task = client.get_task(id: "task-123")
end
Instance Method Summary collapse
-
#agent_card ⇒ Object
GET /.well-known/agent-card.json.
-
#initialize(url) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(url) ⇒ Client
Returns a new instance of Client.
19 20 21 |
# File 'lib/a2a/client.rb', line 19 def initialize(url) @url = url.chomp("/") end |
Instance Method Details
#agent_card ⇒ Object
GET /.well-known/agent-card.json
24 25 26 |
# File 'lib/a2a/client.rb', line 24 def agent_card get("/.well-known/agent-card.json") end |