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

Copy Markdown View Source

Clone utility for ADK agent structs.

Mirrors Python ADK's BaseAgent.clone():

  • Deep copies sub_agents recursively
  • Shallow copies list fields (new list, same element references)
  • Resets parent_agent to nil on the cloned root
  • Wires parent_agent on cloned sub_agents to point at the new clone
  • Validates update keys exist on the struct
  • Disallows updating parent_agent directly

Summary

Functions

Clone an agent with optional field overrides.

Functions

clone(agent, update \\ nil)

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

Clone an agent with optional field overrides.