adk_agent (erlang_adk v0.7.0)
View SourceSummary
Functions
Delegate with an explicit caller-supplied correlation reference.
Apply the immutable output contract without committing any state. The Runner uses this after global callbacks so a replacement cannot bypass the output schema or leave an output_key delta inconsistent with the event.
Format a tool execution result into a standard map.
Return the immutable runtime configuration needed by Runner lifecycle hooks. Kept separate from get_tools/1 for backward compatibility.
Get the tools and sub-agents registered with this agent.
Run one invocation-scoped prompt without reading or mutating the compatibility prompt history stored by the agent process. Runner sessions, AgentTool calls, and collaboration branches must use this entry point so a reusable agent specification cannot leak conversation history between users or sessions.
Prompt with an invocation-scoped context. This is used by the delegation runtime to carry a root global_instruction across process boundaries; callers should normally use prompt/2.
Run the agent using the new Event-based architecture.
Run from event history with a sanitized invocation context used by dynamic instructions, state templates, and exact-scope artifact templates.
Prepare briefly in the agent mailbox, then execute provider streaming in the independently supervised Runner invocation process. EventCallback is synchronous and receives correlated partial events in provider order.
Functions
Delegate with an explicit caller-supplied correlation reference.
-spec finalize_output(pid(), term(), binary()) -> {ok, adk_event:event()} | {error, term()}.
Apply the immutable output contract without committing any state. The Runner uses this after global callbacks so a replacement cannot bypass the output schema or leave an output_key delta inconsistent with the event.
Format a tool execution result into a standard map.
Return the immutable runtime configuration needed by Runner lifecycle hooks. Kept separate from get_tools/1 for backward compatibility.
-spec get_tools(Pid :: pid()) -> {ok, [module() | adk_toolset:descriptor()], map()}.
Get the tools and sub-agents registered with this agent.
Run one invocation-scoped prompt without reading or mutating the compatibility prompt history stored by the agent process. Runner sessions, AgentTool calls, and collaboration branches must use this entry point so a reusable agent specification cannot leak conversation history between users or sessions.
Prompt with an invocation-scoped context. This is used by the delegation runtime to carry a root global_instruction across process boundaries; callers should normally use prompt/2.
Run the agent using the new Event-based architecture.
-spec run_with_events(pid(), [adk_event:event()], binary(), map()) -> {ok, adk_event:event()} | {tool_calls, adk_event:event(), list()} | {error, term()}.
Run from event history with a sanitized invocation context used by dynamic instructions, state templates, and exact-scope artifact templates.
-spec stream_with_events(pid(), [adk_event:event()], binary(), map(), text | content, fun((adk_event:event()) -> ok | {ok, adk_event:event()} | {error, term()})) -> {ok, adk_event:event()} | {tool_calls, adk_event:event(), list()} | {error, term()}.
Prepare briefly in the agent mailbox, then execute provider streaming in the independently supervised Runner invocation process. EventCallback is synchronous and receives correlated partial events in provider order.