Interface A2AClientBuilder<T>
- Type Parameters:
T- the agent service interface type
- All Known Implementing Classes:
DefaultA2AClientBuilder
public interface A2AClientBuilder<T>
Builder for creating A2A client proxies that communicate with remote agents
over the Agent-to-Agent (A2A) protocol.
-
Method Summary
Modifier and TypeMethodDescriptionasync(boolean async) Sets whether the agent should be invoked asynchronously, allowing the workflow to continue without waiting for the agent's result.build()Builds the A2A client proxy implementing the agent service interface.clientCustomizer(Consumer<?> clientCustomizer) Sets a customizer that will be applied to the underlying a2a-java SDKClientBuilderbefore theClientis constructed.Sets the state keys whose values will be sent as message parts to the remote agent.listener(AgentListener agentListener) Sets anAgentListenerfor observing agent invocations.Sets the state key under which the agent's response will be stored.
-
Method Details
-
inputKeys
Sets the state keys whose values will be sent as message parts to the remote agent.- Parameters:
inputKeys- the names of the input keys- Returns:
- this builder for method chaining
-
outputKey
Sets the state key under which the agent's response will be stored.- Parameters:
outputKey- the name of the output key- Returns:
- this builder for method chaining
-
async
Sets whether the agent should be invoked asynchronously, allowing the workflow to continue without waiting for the agent's result.- Parameters:
async-truefor asynchronous invocation- Returns:
- this builder for method chaining
-
listener
Sets anAgentListenerfor observing agent invocations.- Parameters:
agentListener- the listener to attach- Returns:
- this builder for method chaining
-
clientCustomizer
Sets a customizer that will be applied to the underlying a2a-java SDKClientBuilderbefore theClientis constructed.The wildcard type avoids a compile-time dependency on the a2a-java SDK in this module. At runtime the value must be a
Consumer<org.a2aproject.sdk.client.ClientBuilder>.- Parameters:
clientCustomizer- aConsumer<ClientBuilder>from the a2a-java SDK- Returns:
- this builder for method chaining
-
build
T build()Builds the A2A client proxy implementing the agent service interface.- Returns:
- the proxy instance
-