Class: A2A::AgentCapabilities

Inherits:
Object
  • Object
show all
Defined in:
lib/a2a/agent_capabilities.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(streaming: nil, push_notifications: nil, extensions: nil, extended_agent_card: nil) ⇒ AgentCapabilities

Returns a new instance of AgentCapabilities.



7
8
9
10
11
12
# File 'lib/a2a/agent_capabilities.rb', line 7

def initialize(streaming: nil, push_notifications: nil, extensions: nil, extended_agent_card: nil)
  @streaming = streaming
  @push_notifications = push_notifications
  @extensions = extensions
  @extended_agent_card = extended_agent_card
end

Instance Attribute Details

#extended_agent_cardObject (readonly)

Returns the value of attribute extended_agent_card.



5
6
7
# File 'lib/a2a/agent_capabilities.rb', line 5

def extended_agent_card
  @extended_agent_card
end

#extensionsObject (readonly)

Returns the value of attribute extensions.



5
6
7
# File 'lib/a2a/agent_capabilities.rb', line 5

def extensions
  @extensions
end

#push_notificationsObject (readonly)

Returns the value of attribute push_notifications.



5
6
7
# File 'lib/a2a/agent_capabilities.rb', line 5

def push_notifications
  @push_notifications
end

#streamingObject (readonly)

Returns the value of attribute streaming.



5
6
7
# File 'lib/a2a/agent_capabilities.rb', line 5

def streaming
  @streaming
end

Class Method Details

.from_h(hash) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/a2a/agent_capabilities.rb', line 14

def self.from_h(hash)
  new(
    streaming: hash["streaming"],
    push_notifications: hash["pushNotifications"],
    extensions: hash["extensions"]&.map { AgentExtension.from_h(_1) },
    extended_agent_card: hash["extendedAgentCard"]
  )
end

Instance Method Details

#to_hObject



23
24
25
26
27
28
29
30
# File 'lib/a2a/agent_capabilities.rb', line 23

def to_h
  {
    "streaming" => streaming,
    "pushNotifications" => push_notifications,
    "extensions" => extensions,
    "extendedAgentCard" => extended_agent_card
  }.compact
end