gadk-engine
The gadk runtime. It implements the agents defined by gadk-agent and runs them:
llm: the LLM agent (llm_agent::newwith anLlmAgentConfig: model, instruction or instruction provider, tools and toolsets, sub-agents and transfer, input and output schemas, callbacks) and the flow that drives model calls, tool calls and agent transfer.agents: workflow agents:sequential_agent,parallel_agent,loop_agentandworkflow_agent, which runs a graph fromworkflow(function, agent, join and parallel-worker nodes,Edges fromSTART, routes, retries, human input requests).runner:Runnerruns an agent against a session service (plus optional artifact and memory services, plugins and context compaction), appends its events to the session and streams them back;run_liveruns a live (bidirectional streaming) session.tool:FunctionTool(a typed async function; input and output schemas come from the argument and result types),StreamingFunctionTool,AgentTool(an agent called as a tool), andexit_loop.plugin: built-in plugins:logging_plugin,new_retry_and_reflect_pluginandnew_function_call_modifier_plugin.
Dropping a runner stream early unwinds rather than aborts: started work (tool calls, parallel
branches, workflow nodes) finishes before the after-run callbacks. Most applications use this
crate through the gadk façade (gadk::engine, and the common types in gadk::prelude).
Example
use StreamExt;
use ;
use LlmAgentConfig;
use ;
use ;
use ;
async
// Inside an async fn returning Result; `model` is any `Arc<dyn gadk_model::Llm>`.
let weather = new?;
let agent = new?;
let runner = in_memory?;
let msg = from_text;
let mut events = runner.run;
while let Some = events.next.await
runner.close.await?;
Runner::in_memory uses in-memory session, artifact and memory services and creates the
session on its first run; Runner::new takes a RunnerConfig with your own services.
Features
testutil: test support (gadk_engine::testutil): a mock model, stream collection helpers, Gemini record/replay helpers and a test agent runner.