Record Class AgentCapabilities

java.lang.Object
java.lang.Record
org.a2aproject.sdk.spec.AgentCapabilities
Record Components:
streaming - whether the agent supports streaming responses with incremental artifacts
pushNotifications - whether the agent supports push notifications for state changes
extendedAgentCard - whether the agent supports an extended agent card
extensions - list of custom extensions supported by the agent (optional)

public record AgentCapabilities(boolean streaming, boolean pushNotifications, boolean extendedAgentCard, @Nullable List<AgentExtension> extensions) extends Record
Defines optional capabilities supported by an agent in the A2A Protocol.

AgentCapabilities advertises which advanced features an agent supports beyond the basic request-response pattern. Clients can inspect these capabilities to determine how to interact with the agent and what features are available.

Core Capabilities:

  • streaming: Agent can produce incremental results via streaming responses, allowing clients to receive partial artifacts as they are generated rather than waiting for task completion
  • pushNotifications: Agent can send proactive notifications to clients when task state changes, eliminating the need for polling

Capabilities are declared in the AgentCard and are immutable for the lifetime of the agent instance. This class uses the Builder pattern for construction.

See Also:
  • Constructor Details

    • AgentCapabilities

      public AgentCapabilities(boolean streaming, boolean pushNotifications, boolean extendedAgentCard, @Nullable List<AgentExtension> extensions)
      Creates an instance of a AgentCapabilities record class.
      Parameters:
      streaming - the value for the streaming record component
      pushNotifications - the value for the pushNotifications record component
      extendedAgentCard - the value for the extendedAgentCard record component
      extensions - the value for the extensions record component
  • Method Details

    • builder

      public static AgentCapabilities.Builder builder()
      Create a new Builder
      Returns:
      the builder
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • streaming

      public boolean streaming()
      Returns the value of the streaming record component.
      Returns:
      the value of the streaming record component
    • pushNotifications

      public boolean pushNotifications()
      Returns the value of the pushNotifications record component.
      Returns:
      the value of the pushNotifications record component
    • extendedAgentCard

      public boolean extendedAgentCard()
      Returns the value of the extendedAgentCard record component.
      Returns:
      the value of the extendedAgentCard record component
    • extensions

      public @Nullable List<AgentExtension> extensions()
      Returns the value of the extensions record component.
      Returns:
      the value of the extensions record component