Runner is the core of the execution engine: it coordinates the agent, tools,
and callbacks to respond to user input, while managing the flow of information,
state changes, and interactions with the model, tools, and storage. VeADK’s
execution engine is fully compatible with Google ADK’s Runner; see the
Google ADK runtime docs for its
full mechanics.
Multi-tenant isolation
For enterprise multi-tenant scenarios,Runner isolates data along three
dimensions — app_name, user_id, and session_id:
Minimal run
Runner.run() runs an agent directly, handling input and returning the final
text response — convenient for local testing:
run() is high-level. When the Runner has a short-term session configured, it
creates the session on demand. For finer-grained control over execution, use
run_async().Streaming events
Runner.run_async() returns an async generator that yields the events produced
during the agent’s run. Unlike run(), which only returns the final text,
iterating over events gives you the reasoning, tool calls and results, and
streaming increments — useful for building your own logic on top.
run_async() requires the session to exist beforehand. If you call it directly,
make sure the session for session_id has been created.Parsing events
Each event describes one step of the run. Its common fields:
Each
part in content.parts may be a different type; branch on it:
The event also offers helpers:
is_final_response() tells whether it is the
final reply, and get_function_calls() / get_function_responses() extract the
tool calls and results from the event.