Class LoopAgent

java.lang.Object
com.google.adk.agents.BaseAgent
com.google.adk.agents.LoopAgent

public class LoopAgent extends BaseAgent
An agent that runs its sub-agents sequentially in a loop.

The loop continues until a sub-agent escalates, or until the maximum number of iterations is reached (if specified).

  • Method Details

    • builder

      public static LoopAgent.Builder builder()
    • runAsyncImpl

      protected io.reactivex.rxjava3.core.Flowable<Event> runAsyncImpl(InvocationContext invocationContext)
      Description copied from class: BaseAgent
      Agent-specific asynchronous logic.
      Specified by:
      runAsyncImpl in class BaseAgent
      Parameters:
      invocationContext - Current invocation context.
      Returns:
      stream of agent-generated events.
    • runLiveImpl

      protected io.reactivex.rxjava3.core.Flowable<Event> runLiveImpl(InvocationContext invocationContext)
      Description copied from class: BaseAgent
      Agent-specific synchronous logic.
      Specified by:
      runLiveImpl in class BaseAgent
      Parameters:
      invocationContext - Current invocation context.
      Returns:
      stream of agent-generated events.