Class TaskAcceptance
Object
akka.javasdk.agent.autonomous.capability.TaskAcceptance
- All Implemented Interfaces:
AgentCapability
Declares that an agent can accept and process tasks of the specified types. Created via
of(akka.javasdk.agent.task.TaskDefinition<?>, akka.javasdk.agent.task.TaskDefinition<?>...).
Multiple TaskAcceptance capabilities can be declared on a single agent to configure
different settings (iteration limits, handoff targets) per task group.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract TaskAcceptanceaddHandoffTargets(Class<? extends AutonomousAgent> first, Class<? extends AutonomousAgent>[] rest) Internal method for adding handoff targets — implemented by the impl class.final TaskAcceptancecanHandoffTo(Class<? extends AutonomousAgent> first, Class<? extends AutonomousAgent>... rest) Allow this agent to hand off tasks in this group to one of the specified agents.abstract TaskAcceptancemaxIterationsPerTask(int max) Maximum iterations before the agent fails the current task.static TaskAcceptanceof(TaskDefinition<?> first, TaskDefinition<?>... rest) Create a task acceptance capability for the given task definitions.
-
Constructor Details
-
TaskAcceptance
public TaskAcceptance()
-
-
Method Details
-
of
Create a task acceptance capability for the given task definitions. -
maxIterationsPerTask
Maximum iterations before the agent fails the current task. Default is configured viaakka.javasdk.agent.autonomous.max-iterations-per-taskin application.conf. -
canHandoffTo
@SafeVarargs public final TaskAcceptance canHandoffTo(Class<? extends AutonomousAgent> first, Class<? extends AutonomousAgent>... rest) Allow this agent to hand off tasks in this group to one of the specified agents. Unlike delegation, handoff transfers ownership — the current agent is done and the target agent takes over. -
addHandoffTargets
protected abstract TaskAcceptance addHandoffTargets(Class<? extends AutonomousAgent> first, Class<? extends AutonomousAgent>[] rest) Internal method for adding handoff targets — implemented by the impl class.
-