Class: A2A::Types::AgentCapabilities
- Defined in:
- lib/a2a/types/agent_card.rb
Overview
Represents agent capabilities
Capabilities define what features and protocols the agent supports, such as streaming, push notifications, and extensions.
Instance Attribute Summary collapse
-
#extensions ⇒ Object
readonly
Returns the value of attribute extensions.
-
#push_notifications ⇒ Object
readonly
Returns the value of attribute push_notifications.
-
#state_transition_history ⇒ Object
readonly
Returns the value of attribute state_transition_history.
-
#streaming ⇒ Object
readonly
Returns the value of attribute streaming.
Instance Method Summary collapse
-
#initialize(streaming: nil, push_notifications: nil, state_transition_history: nil, extensions: nil) ⇒ AgentCapabilities
constructor
Initialize new agent capabilities.
-
#push_notifications? ⇒ Boolean
Check if push notifications are supported.
-
#state_transition_history? ⇒ Boolean
Check if state transition history is supported.
-
#streaming? ⇒ Boolean
Check if streaming is supported.
-
#supports_extension?(extension_uri) ⇒ Boolean
Check if a specific extension is supported.
- #validate! ⇒ Object private
Methods inherited from BaseModel
#==, #camelize, from_h, from_json, #hash, #to_h, #to_json, underscore, #valid?, #validate_array_type, #validate_inclusion, #validate_required, #validate_type
Constructor Details
#initialize(streaming: nil, push_notifications: nil, state_transition_history: nil, extensions: nil) ⇒ AgentCapabilities
Initialize new agent capabilities
321 322 323 324 325 326 327 328 |
# File 'lib/a2a/types/agent_card.rb', line 321 def initialize(streaming: nil, push_notifications: nil, state_transition_history: nil, extensions: nil) @streaming = streaming @push_notifications = push_notifications @state_transition_history = state_transition_history @extensions = extensions validate! end |
Instance Attribute Details
#extensions ⇒ Object (readonly)
Returns the value of attribute extensions.
312 313 314 |
# File 'lib/a2a/types/agent_card.rb', line 312 def extensions @extensions end |
#push_notifications ⇒ Object (readonly)
Returns the value of attribute push_notifications.
312 313 314 |
# File 'lib/a2a/types/agent_card.rb', line 312 def push_notifications @push_notifications end |
#state_transition_history ⇒ Object (readonly)
Returns the value of attribute state_transition_history.
312 313 314 |
# File 'lib/a2a/types/agent_card.rb', line 312 def state_transition_history @state_transition_history end |
#streaming ⇒ Object (readonly)
Returns the value of attribute streaming.
312 313 314 |
# File 'lib/a2a/types/agent_card.rb', line 312 def streaming @streaming end |
Instance Method Details
#push_notifications? ⇒ Boolean
Check if push notifications are supported
342 343 344 |
# File 'lib/a2a/types/agent_card.rb', line 342 def push_notifications? @push_notifications == true end |
#state_transition_history? ⇒ Boolean
Check if state transition history is supported
350 351 352 |
# File 'lib/a2a/types/agent_card.rb', line 350 def state_transition_history? @state_transition_history == true end |
#streaming? ⇒ Boolean
Check if streaming is supported
334 335 336 |
# File 'lib/a2a/types/agent_card.rb', line 334 def streaming? @streaming == true end |
#supports_extension?(extension_uri) ⇒ Boolean
Check if a specific extension is supported
359 360 361 362 363 |
# File 'lib/a2a/types/agent_card.rb', line 359 def supports_extension?(extension_uri) return false if @extensions.nil? @extensions.include?(extension_uri) end |
#validate! ⇒ Object (private)
367 368 369 370 371 372 |
# File 'lib/a2a/types/agent_card.rb', line 367 def validate! validate_type(:streaming, [TrueClass, FalseClass]) if @streaming validate_type(:push_notifications, [TrueClass, FalseClass]) if @push_notifications validate_type(:state_transition_history, [TrueClass, FalseClass]) if @state_transition_history validate_array_type(:extensions, String) if @extensions end |