Class TaskAcceptance

Object
akka.javasdk.agent.autonomous.capability.TaskAcceptance
All Implemented Interfaces:
AgentCapability

public abstract class TaskAcceptance extends Object implements 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 Details

    • TaskAcceptance

      public TaskAcceptance()
  • Method Details

    • of

      @SafeVarargs public static TaskAcceptance of(TaskDefinition<?> first, TaskDefinition<?>... rest)
      Create a task acceptance capability for the given task definitions.
    • maxIterationsPerTask

      public abstract TaskAcceptance maxIterationsPerTask(int max)
      Maximum iterations before the agent fails the current task. Default is configured via akka.javasdk.agent.autonomous.max-iterations-per-task in 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.