Record Class ConditionalPlanner
java.lang.Object
java.lang.Record
dev.langchain4j.agentic.workflow.impl.ConditionalPlanner
- All Implemented Interfaces:
Planner
public record ConditionalPlanner(List<ConditionalAgent> conditionalSubagents)
extends Record
implements Planner
-
Constructor Summary
ConstructorsConstructorDescriptionConditionalPlanner(List<ConditionalAgent> conditionalSubagents) Creates an instance of aConditionalPlannerrecord class. -
Method Summary
Modifier and TypeMethodDescription<T extends AgentInstance>
Tas(Class<T> agentInstanceClass, AgentInstance agentInstance) Returns the value of theconditionalSubagentsrecord component.final booleanIndicates whether some other object is "equal to" this one.firstAction(PlanningContext planningContext) Returns the first action to execute when the planner starts (or resumes).final inthashCode()Returns a hash code value for this object.nextAction(PlanningContext planningContext) Determines the next action to execute based on the result of the previous agent invocation.booleanReturnstrueif the planner has reached a terminal state and will not produce further actions.topology()Returns the topology of the agentic system managed by this planner.final StringtoString()Returns a string representation of this record class.Methods inherited from interface Planner
call, call, done, done, executionState, init, noOp, restoreExecutionState, suspend
-
Constructor Details
-
ConditionalPlanner
Creates an instance of aConditionalPlannerrecord class.- Parameters:
conditionalSubagents- the value for theconditionalSubagentsrecord component
-
-
Method Details
-
firstAction
Description copied from interface:PlannerReturns the first action to execute when the planner starts (or resumes). Defaults to delegating toPlanner.nextAction(PlanningContext).- Specified by:
firstActionin interfacePlanner- Parameters:
planningContext- the current planning context- Returns:
- the first action to execute
-
nextAction
Description copied from interface:PlannerDetermines the next action to execute based on the result of the previous agent invocation.- Specified by:
nextActionin interfacePlanner- Parameters:
planningContext- the current planning context, including the previous agent's result- Returns:
- the next action to execute
-
topology
Description copied from interface:PlannerReturns the topology of the agentic system managed by this planner.- Specified by:
topologyin interfacePlanner- Returns:
- the topology (defaults to
AgenticSystemTopology.SEQUENCE)
-
terminated
public boolean terminated()Description copied from interface:PlannerReturnstrueif the planner has reached a terminal state and will not produce further actions.- Specified by:
terminatedin interfacePlanner- Returns:
trueif the planner is terminated
-
as
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
conditionalSubagents
Returns the value of theconditionalSubagentsrecord component.- Returns:
- the value of the
conditionalSubagentsrecord component
-