Class Runner.Builder

java.lang.Object
com.google.adk.runner.Runner.Builder
Enclosing class:
Runner

public static class Runner.Builder extends Object
Builder for Runner.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • app

      @CanIgnoreReturnValue public Runner.Builder app(App app)
    • agent

      @CanIgnoreReturnValue public Runner.Builder agent(BaseAgent agent)
    • appName

      @CanIgnoreReturnValue public Runner.Builder appName(String appName)
    • artifactService

      @CanIgnoreReturnValue public Runner.Builder artifactService(BaseArtifactService artifactService)
    • sessionService

      @CanIgnoreReturnValue public Runner.Builder sessionService(BaseSessionService sessionService)
    • memoryService

      @CanIgnoreReturnValue public Runner.Builder memoryService(BaseMemoryService memoryService)
    • plugins

      @CanIgnoreReturnValue public Runner.Builder plugins(List<? extends Plugin> plugins)
    • plugins

      @CanIgnoreReturnValue public Runner.Builder plugins(Plugin... plugins)
    • scheduler

      @CanIgnoreReturnValue public Runner.Builder scheduler(@Nullable io.reactivex.rxjava3.core.Scheduler scheduler)
      Sets the Scheduler for the work ADK hands off to worker threads in this runner's invocations: the sub-agents of a ParallelAgent, tool calls in RunConfig.ToolExecutionMode.PARALLEL_SUBSCRIBE mode, and the hop that starts the live send loop. The runs that an AgentTool nests inherit it. An agent-level ParallelAgent.Builder#scheduler or LlmAgent.Builder#executor takes precedence. null (the default) selects Schedulers.io().

      Only these hand-offs are affected; work that completes asynchronously elsewhere (model clients, session services, MCP, plugins) stays on its own threads. Schedulers.trampoline() runs the hand-offs inline, so sub-agents and tools are subscribed sequentially, but anything they start asynchronously can still overlap.

    • instantSource

      @CanIgnoreReturnValue public Runner.Builder instantSource(@Nullable InstantSource instantSource)
      Sets the InstantSource that supplies every timestamp this runner generates: event timestamps, and the lastUpdateTime of sessions created by the default in-memory session service, which is created on the first build(). null (the default) selects InstantSource.system().
    • uuidProvider

      @CanIgnoreReturnValue public Runner.Builder uuidProvider(@Nullable UuidProvider uuidProvider)
      Sets the UuidProvider that supplies every identifier this runner generates: event, invocation, and client function-call ids, and the ids of sessions created by the default in-memory session service, which is created on the first build(). null (the default) selects UuidProvider.SYSTEM.
    • build

      public Runner build()