ADK.Agent.ParallelAgent (ADK v0.0.1-alpha.1)

Copy Markdown View Source

Runs sub-agents concurrently using Task.async_stream, collecting all events.

Examples

agent = ADK.Agent.ParallelAgent.new(
  name: "fan_out",
  sub_agents: [research_agent, analysis_agent, summary_agent]
)

Summary

Functions

Create a parallel agent with validation.

Clone this agent with optional updates. See ADK.Agent.Clone.

Create a parallel agent.

Types

t()

@type t() :: %ADK.Agent.ParallelAgent{
  description: String.t(),
  name: String.t(),
  parent_agent: term(),
  sub_agents: [ADK.Agent.t()],
  timeout: pos_integer()
}

Functions

build(opts)

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

Create a parallel agent with validation.

Returns {:ok, agent} or {:error, reason}.

clone(agent, update \\ nil)

@spec clone(t(), map() | nil) :: t()

Clone this agent with optional updates. See ADK.Agent.Clone.

new(opts)

@spec new(keyword()) :: t()

Create a parallel agent.

Examples

iex> agent = ADK.Agent.ParallelAgent.new(name: "fan_out", sub_agents: [])
iex> agent.name
"fan_out"