ADK.Agent.InvocationContext (adk_ex v1.1.0)

Copy Markdown View Source

Immutable context threaded through agent invocations.

Carries the current agent, session, services, and execution metadata. Callers create updated copies via the with_* helpers.

Summary

Functions

Marks the invocation as ended.

Returns whether the invocation has ended.

Returns a new context with a different agent.

Returns a new context with a different branch.

Returns a new context with a parent map.

Returns a new context with a root agent.

Types

t()

@type t() :: %ADK.Agent.InvocationContext{
  agent: struct() | nil,
  artifact_service: GenServer.server() | nil,
  branch: String.t() | nil,
  ended: boolean(),
  invocation_id: String.t() | nil,
  memory_service: GenServer.server() | nil,
  parent_map: %{required(String.t()) => struct()},
  plugin_manager: ADK.Plugin.Manager.t() | nil,
  root_agent: struct() | nil,
  run_config: ADK.RunConfig.t(),
  session: ADK.Session.t() | nil,
  session_service: GenServer.server() | nil,
  user_content: ADK.Types.Content.t() | nil
}

Functions

end_invocation(ctx)

@spec end_invocation(t()) :: t()

Marks the invocation as ended.

ended?(invocation_context)

@spec ended?(t()) :: boolean()

Returns whether the invocation has ended.

with_agent(ctx, agent)

@spec with_agent(
  t(),
  struct()
) :: t()

Returns a new context with a different agent.

with_branch(ctx, branch)

@spec with_branch(t(), String.t()) :: t()

Returns a new context with a different branch.

with_parent_map(ctx, parent_map)

@spec with_parent_map(t(), %{required(String.t()) => struct()}) :: t()

Returns a new context with a parent map.

with_root_agent(ctx, root_agent)

@spec with_root_agent(
  t(),
  struct()
) :: t()

Returns a new context with a root agent.