ADK.Runner (adk_ex v1.1.0)

Copy Markdown View Source

Orchestrates agent execution within a session.

The Runner manages session lifecycle, creates invocation contexts, runs agents, and persists events to the session service.

Summary

Functions

Creates a new runner, validating the agent tree and building the parent map.

Runs an agent with the given user message, returning a stream of events.

Types

t()

@type t() :: %ADK.Runner{
  app_name: String.t(),
  artifact_service: GenServer.server() | nil,
  memory_service: GenServer.server() | nil,
  parent_map: %{required(String.t()) => struct()},
  plugins: [ADK.Plugin.t()],
  root_agent: struct(),
  session_module: module(),
  session_service: GenServer.server()
}

Functions

new(opts)

@spec new(keyword()) :: {:ok, t()} | {:error, String.t()}

Creates a new runner, validating the agent tree and building the parent map.

run(runner, user_id, session_id, user_content, opts \\ [])

@spec run(t(), String.t(), String.t(), ADK.Types.Content.t(), keyword()) ::
  Enumerable.t()

Runs an agent with the given user message, returning a stream of events.

Automatically creates a session if one doesn't exist.