Skip to main content

Module default_runtime

Module default_runtime 

Source
Expand description

Default implementation of the ManagedAgentRuntime trait.

DefaultManagedAgentRuntime composes existing ADK crates (Runner, SessionService, optional sandbox and memory) behind the unified lifecycle trait. It manages active sessions as supervised background tasks with durable checkpointing, event streaming, and custom tool parking.

§Architecture

The runtime is a library, not a service. The platform hosts it:

  • Testable in isolation: Zero HTTP/auth/billing dependencies
  • Embeddable: Self-hosted deployments use the runtime trait directly
  • Swappable platform: Different platforms can host the same runtime
  • Provider-neutral: Identical event sequences regardless of model provider

§Example

use std::sync::Arc;
use adk_managed::default_runtime::DefaultManagedAgentRuntime;
use adk_managed::resolver::DefaultModelResolver;
use adk_session::InMemorySessionService;

let resolver = Arc::new(DefaultModelResolver::new());
let sessions = Arc::new(InMemorySessionService::new());

let runtime = DefaultManagedAgentRuntime::new(resolver, sessions);

Structs§

DefaultManagedAgentRuntime
Default implementation of the managed agent runtime.