Package org.a2aproject.sdk.spec
Class AgentCapabilities.Builder
java.lang.Object
org.a2aproject.sdk.spec.AgentCapabilities.Builder
- Enclosing class:
- AgentCapabilities
Builder for constructing immutable
AgentCapabilities instances.
The Builder pattern provides a fluent API for setting capability flags. All capabilities default to false if not explicitly set.
Example usage:
AgentCapabilities capabilities = AgentCapabilities.builder()
.streaming(true)
.pushNotifications(false)
.build();
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds an immutableAgentCapabilitiesfrom the current builder state.extendedAgentCard(boolean extendedAgentCard) Sets whether the agent supports an extended agent card.extensions(List<AgentExtension> extensions) Sets the list of custom extensions supported by the agent.pushNotifications(boolean pushNotifications) Sets whether the agent supports push notifications.streaming(boolean streaming) Sets whether the agent supports streaming responses.
-
Method Details
-
streaming
Sets whether the agent supports streaming responses.When enabled, clients can subscribe to task updates and receive incremental artifacts as the agent produces them.
- Parameters:
streaming- true if streaming is supported, false otherwise- Returns:
- this builder for method chaining
-
pushNotifications
Sets whether the agent supports push notifications.When enabled, the agent can proactively notify clients of task state changes, eliminating the need for polling.
- Parameters:
pushNotifications- true if push notifications are supported, false otherwise- Returns:
- this builder for method chaining
-
extendedAgentCard
Sets whether the agent supports an extended agent card. state transition history.- Parameters:
extendedAgentCard- true if an extended agent card is supported, false otherwise- Returns:
- this builder for method chaining
-
extensions
Sets the list of custom extensions supported by the agent.Extensions allow agents to advertise proprietary or experimental capabilities beyond the core A2A Protocol.
- Parameters:
extensions- list of agent extensions (optional)- Returns:
- this builder for method chaining
- See Also:
-
build
Builds an immutableAgentCapabilitiesfrom the current builder state.- Returns:
- a new AgentCapabilities instance
-