Class ActivationConditions
java.lang.Object
dev.langchain4j.agentic.internal.ActivationConditions
The single place deciding whether an agent is active according to its activation condition. The
AgentExecutor enforces the condition when the agent is about to be invoked, while planners can consult it,
through PlanningContext.isActive(AgentInstance), to avoid selecting an
inactive agent.
A composite agent whose condition held is marked as activated in the scope until it completes, so that, when it is resumed after a suspension or a crash, it is still active even if its own subagents changed the state its condition reads. Leaf agents are never marked, since they never partially complete.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisActive(AgentInstance agent, AgenticScope agenticScope) Tells whether the agent would run if it were invoked now: it has no condition, it is a composite agent already activated, or its condition holds.
-
Method Details
-
isActive
Tells whether the agent would run if it were invoked now: it has no condition, it is a composite agent already activated, or its condition holds. A condition throwing an exception is considered to hold, so that the failure is raised, and handled by the error handler, when the agent is invoked.
-