Class DecisionAgentInvocationHandler
java.lang.Object
dev.langchain4j.agentic.agent.DecisionAgentInvocationHandler
- All Implemented Interfaces:
DecisionResponseAccess, InternalAgent, AgentInstance, InvocationHandler
public class DecisionAgentInvocationHandler
extends Object
implements InvocationHandler, InternalAgent, DecisionResponseAccess
The invocation handler of the proxy of a decision agent: it implements the agent method with a call to the
decision model, keeps the response of the model for the listeners, and answers the
AgentInstance methods.-
Method Summary
Modifier and TypeMethodDescriptionThe condition under which this agent runs when it is invoked as a subagent, ornullwhen it always runs.agentId()voidbooleanasync()lastDecisionResponse(Object agenticScopeId) The response of the decision model to the last invocation of the agent in the agentic scope with the given memory id, ornullif the agent was not invoked in that scope or its last invocation failed.listener()name()booleanoptional()parent()voidregisterInheritedParentListener(AgentListener parentListener) voidremoveLastDecisionResponse(Object agenticScopeId) Forgets the response kept for the agentic scope with the given memory id.voidsetAgentId(String agentId) voidsetParent(InternalAgent parent) topology()toString()Class<?> type()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface AgentInstance
as, leafMethods inherited from interface InternalAgent
allowChatMemory, allowStreamingOutput, compensateOnError, enableCrossAgentCompensation
-
Method Details
-
invoke
-
lastDecisionResponse
Description copied from interface:DecisionResponseAccessThe response of the decision model to the last invocation of the agent in the agentic scope with the given memory id, ornullif the agent was not invoked in that scope or its last invocation failed.- Specified by:
lastDecisionResponsein interfaceDecisionResponseAccess
-
removeLastDecisionResponse
Description copied from interface:DecisionResponseAccessForgets the response kept for the agentic scope with the given memory id.- Specified by:
removeLastDecisionResponsein interfaceDecisionResponseAccess
-
toString
-
setParent
- Specified by:
setParentin interfaceInternalAgent
-
registerInheritedParentListener
- Specified by:
registerInheritedParentListenerin interfaceInternalAgent
-
appendId
- Specified by:
appendIdin interfaceInternalAgent
-
setAgentId
- Specified by:
setAgentIdin 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
-
optional
public boolean optional()- Specified by:
optionalin 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
-
subagents
- Specified by:
subagentsin interfaceAgentInstance
-
topology
- Specified by:
topologyin interfaceAgentInstance
-