Package org.a2aproject.sdk.spec
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 artifactspushNotifications- whether the agent supports push notifications for state changesextendedAgentCard- whether the agent supports an extended agent cardextensions- 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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for constructing immutableAgentCapabilitiesinstances. -
Constructor Summary
ConstructorsConstructorDescriptionAgentCapabilities(boolean streaming, boolean pushNotifications, boolean extendedAgentCard, @Nullable List<AgentExtension> extensions) Creates an instance of aAgentCapabilitiesrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic AgentCapabilities.Builderbuilder()Create a new Builderfinal booleanIndicates whether some other object is "equal to" this one.booleanReturns the value of theextendedAgentCardrecord component.@Nullable List<AgentExtension>Returns the value of theextensionsrecord component.final inthashCode()Returns a hash code value for this object.booleanReturns the value of thepushNotificationsrecord component.booleanReturns the value of thestreamingrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
AgentCapabilities
public AgentCapabilities(boolean streaming, boolean pushNotifications, boolean extendedAgentCard, @Nullable List<AgentExtension> extensions) Creates an instance of aAgentCapabilitiesrecord class.- Parameters:
streaming- the value for thestreamingrecord componentpushNotifications- the value for thepushNotificationsrecord componentextendedAgentCard- the value for theextendedAgentCardrecord componentextensions- the value for theextensionsrecord component
-
-
Method Details
-
builder
Create a new Builder- Returns:
- the builder
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
streaming
public boolean streaming()Returns the value of thestreamingrecord component.- Returns:
- the value of the
streamingrecord component
-
pushNotifications
public boolean pushNotifications()Returns the value of thepushNotificationsrecord component.- Returns:
- the value of the
pushNotificationsrecord component
-
extendedAgentCard
public boolean extendedAgentCard()Returns the value of theextendedAgentCardrecord component.- Returns:
- the value of the
extendedAgentCardrecord component
-
extensions
Returns the value of theextensionsrecord component.- Returns:
- the value of the
extensionsrecord component
-