Class: A2A::Client::SSE
Constant Summary collapse
- EVENT_CLASSES =
{ "TaskStatusUpdateEvent" => Models::TaskStatusUpdateEvent, "TaskArtifactUpdateEvent" => Models::TaskArtifactUpdateEvent }.freeze
Instance Method Summary collapse
Methods inherited from Base
#agent_card, #cancel_task, #get_task, #initialize, #list_tasks, #send_task
Constructor Details
This class inherits a constructor from A2A::Client::Base
Instance Method Details
#send_subscribe(message:, **opts, &block) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/simple_a2a/client/sse.rb', line 11 def send_subscribe(message:, **opts, &block) body = JSON.generate({ "jsonrpc" => "2.0", "id" => SecureRandom.uuid, "method" => "tasks/sendSubscribe", "params" => build_send_params(, opts) }) run_async do |internet| headers = rpc_headers.merge("accept" => "text/event-stream") response = internet.post(@url, headers: headers, body: body) parse_sse_stream(response, &block) end end |