Skip to main content

Module runtime

Module runtime 

Source
Expand description

Core trait and handle types for the managed agent runtime.

The ManagedAgentRuntime trait defines the full lifecycle interface for managed agents: create agents from declarative definitions, start sessions, send/receive events, pause/resume/interrupt, and archive.

§Architecture

The runtime is a library, not a service. The platform hosts it. This trait is provider-agnostic — it behaves identically for Gemini, OpenAI, Anthropic, Ollama, and OpenAI-compatible providers.

§Example

use adk_managed::runtime::{ManagedAgentRuntime, AgentHandle, SessionHandle};
use adk_managed::types::ManagedAgentDef;

async fn example(runtime: &dyn ManagedAgentRuntime) {
    let def = ManagedAgentDef::default();
    let agent = runtime.create(def).await.unwrap();
    let session = runtime.start_session(&agent, None).await.unwrap();
    let status = runtime.status(&session).await.unwrap();
    println!("Session status: {status:?}");
}

Structs§

AgentHandle
Opaque agent handle.
EnvironmentConfig
Optional environment configuration for a session.
SessionHandle
Opaque session handle.

Traits§

ManagedAgentRuntime
The central async trait defining the managed agent lifecycle.