Class DefaultA2AClientBuilder<T>
java.lang.Object
dev.langchain4j.agentic.a2a.DefaultA2AClientBuilder<T>
- All Implemented Interfaces:
A2AClientBuilder<T>, InternalAgent, AgentInstance, InvocationHandler
public class DefaultA2AClientBuilder<T>
extends Object
implements A2AClientBuilder<T>, InternalAgent, InvocationHandler
-
Method Summary
Modifier and TypeMethodDescriptionagentId()voidbooleanasync()async(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()listener(AgentListener agentListener) Sets anAgentListenerfor observing agent invocations.name()Sets the state key under which the agent's response will be stored.parent()voidregisterInheritedParentListener(AgentListener parentListener) voidsetParent(InternalAgent parent) topology()Class<?> type()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface AgentInstance
as, leaf, optionalMethods inherited from interface InternalAgent
allowChatMemory, allowStreamingOutput, setAgentId
-
Method Details
-
build
Description copied from interface:A2AClientBuilderBuilds the A2A client proxy implementing the agent service interface.- Specified by:
buildin interfaceA2AClientBuilder<T>- Returns:
- the proxy instance
-
invoke
-
inputKeys
Description copied from interface:A2AClientBuilderSets the state keys whose values will be sent as message parts to the remote agent.- Specified by:
inputKeysin interfaceA2AClientBuilder<T>- Parameters:
inputKeys- the names of the input keys- Returns:
- this builder for method chaining
-
outputKey
Description copied from interface:A2AClientBuilderSets the state key under which the agent's response will be stored.- Specified by:
outputKeyin interfaceA2AClientBuilder<T>- Parameters:
outputKey- the name of the output key- Returns:
- this builder for method chaining
-
async
Description copied from interface:A2AClientBuilderSets whether the agent should be invoked asynchronously, allowing the workflow to continue without waiting for the agent's result.- Specified by:
asyncin interfaceA2AClientBuilder<T>- Parameters:
async-truefor asynchronous invocation- Returns:
- this builder for method chaining
-
listener
Description copied from interface:A2AClientBuilderSets anAgentListenerfor observing agent invocations.- Specified by:
listenerin interfaceA2AClientBuilder<T>- Parameters:
agentListener- the listener to attach- Returns:
- this builder for method chaining
-
clientCustomizer
Description copied from interface:A2AClientBuilderSets 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>.- Specified by:
clientCustomizerin interfaceA2AClientBuilder<T>- Parameters:
clientCustomizer- aConsumer<ClientBuilder>from the a2a-java SDK- Returns:
- this builder for method chaining
-
setParent
- Specified by:
setParentin interfaceInternalAgent
-
registerInheritedParentListener
- Specified by:
registerInheritedParentListenerin interfaceInternalAgent
-
appendId
- Specified by:
appendIdin interfaceInternalAgent
-
listener
- Specified by:
listenerin interfaceInternalAgent
-
type
- Specified by:
typein interfaceAgentInstance
-
plannerType
- Specified by:
plannerTypein interfaceAgentInstance
-
name
- Specified by:
namein interfaceAgentInstance
-
agentId
- Specified by:
agentIdin interfaceAgentInstance
-
description
- Specified by:
descriptionin interfaceAgentInstance
-
outputType
- Specified by:
outputTypein interfaceAgentInstance
-
outputKey
- Specified by:
outputKeyin interfaceAgentInstance
-
async
public boolean async()- Specified by:
asyncin interfaceAgentInstance
-
arguments
- Specified by:
argumentsin interfaceAgentInstance
-
parent
- Specified by:
parentin interfaceAgentInstance
-
subagents
- Specified by:
subagentsin interfaceAgentInstance
-
topology
- Specified by:
topologyin interfaceAgentInstance
-