Class PlannerBasedInvocationHandler
java.lang.Object
dev.langchain4j.agentic.internal.PlannerBasedInvocationHandler
- All Implemented Interfaces:
InternalAgent, AgentInstance, InvocationHandler
public class PlannerBasedInvocationHandler
extends Object
implements InvocationHandler, InternalAgent
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPlannerBasedInvocationHandler(AbstractServiceBuilder<?, ?> service, Supplier<Planner> plannerSupplier) -
Method Summary
Modifier and TypeMethodDescriptionThe condition under which this agent runs when it is invoked as a subagent, ornullwhen it always runs.agentId()booleanbooleanvoid<T extends AgentInstance>
Tbooleanasync()booleanvoidlistener()name()parent()voidregisterInheritedParentListener(AgentListener parentListener) voidsetParent(InternalAgent parent) topology()toString()Class<?> type()withAgenticScope(DefaultAgenticScope agenticScope) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface AgentInstance
leaf, optionalMethods inherited from interface InternalAgent
setAgentId
-
Field Details
-
agentListener
-
-
Constructor Details
-
PlannerBasedInvocationHandler
public PlannerBasedInvocationHandler(AbstractServiceBuilder<?, ?> service, Supplier<Planner> plannerSupplier)
-
-
Method Details
-
withAgenticScope
-
invoke
-
toString
-
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
-
activationCondition
Description copied from interface:AgentInstanceThe condition under which this agent runs when it is invoked as a subagent, ornullwhen it always runs. When the condition is false, the agent is skipped: it is not invoked, it writes nothing to theAgenticScopeand its parent's planner is notified of the skip. The condition is ignored when the agent is invoked directly, as the root of an agentic system.The condition can be evaluated more than once for a single invocation, by the planner of the parent while selecting its next agents and again when the agent is invoked, so it must be cheap and free of side effects.
- Specified by:
activationConditionin interfaceAgentInstance
-
arguments
- Specified by:
argumentsin interfaceAgentInstance
-
parent
- Specified by:
parentin interfaceAgentInstance
-
compensateOnError
public boolean compensateOnError()- Specified by:
compensateOnErrorin interfaceInternalAgent
-
enableCrossAgentCompensation
public void enableCrossAgentCompensation()- Specified by:
enableCrossAgentCompensationin interfaceInternalAgent
-
setParent
- Specified by:
setParentin interfaceInternalAgent
-
registerInheritedParentListener
- Specified by:
registerInheritedParentListenerin interfaceInternalAgent
-
allowStreamingOutput
public boolean allowStreamingOutput()- Specified by:
allowStreamingOutputin interfaceInternalAgent
-
allowChatMemory
public boolean allowChatMemory()- Specified by:
allowChatMemoryin interfaceInternalAgent
-
appendId
- Specified by:
appendIdin interfaceInternalAgent
-
subagents
- Specified by:
subagentsin interfaceAgentInstance
-
topology
- Specified by:
topologyin interfaceAgentInstance
-
as
- Specified by:
asin interfaceAgentInstance
-
listener
- Specified by:
listenerin interfaceInternalAgent
-