adk_runner (erlang_adk v0.2.0)
View Sourceadk_runner - Execution orchestrator for ADK 2.0.
The Runner manages the event loop for an agent, handling session retrieval, event recording, tool execution, and streaming responses back to the caller.
Summary
Functions
Create a new Runner with required services.
Create a new Runner with optional services (memory_svc, artifact_svc).
Resume a paused workflow (Human-in-the-Loop) with a human-provided result.
Execute the agent synchronously, returning the final response text. This blocks until the entire invocation is complete.
Execute the agent asynchronously, returning a process ID that streams events. The returned PID will send '{adk_event, StreamPid, Event}' and '{adk_done, StreamPid}' messages.
Types
Functions
Create a new Runner with required services.
-spec new(Agent :: pid() | module(), AppName :: binary(), SessionSvc :: module(), Opts :: map()) -> runner().
Create a new Runner with optional services (memory_svc, artifact_svc).
-spec resume(Runner :: runner(), UserId :: binary(), SessionId :: binary(), ToolResponse :: term()) -> {ok, pid()} | {error, term()}.
Resume a paused workflow (Human-in-the-Loop) with a human-provided result.
-spec run(Runner :: runner(), UserId :: binary(), SessionId :: binary(), Message :: term()) -> {ok, binary()} | {error, term()}.
Execute the agent synchronously, returning the final response text. This blocks until the entire invocation is complete.
-spec run_async(Runner :: runner(), UserId :: binary(), SessionId :: binary(), Message :: term()) -> {ok, pid()}.
Execute the agent asynchronously, returning a process ID that streams events. The returned PID will send '{adk_event, StreamPid, Event}' and '{adk_done, StreamPid}' messages.