Skip to main content

adk_runner/
lib.rs

1//! # adk-runner
2#![allow(clippy::result_large_err)]
3#![deny(missing_docs)]
4//!
5//! Agent execution runtime for ADK.
6//!
7//! ## Overview
8//!
9//! This crate provides the execution runtime:
10//!
11//! - [`Runner`] - Manages agent execution with full context
12//! - [`RunnerConfig`] - Configuration for the runner
13//! - [`InvocationContext`] - Execution context implementation
14//! - [`Callbacks`] - Hook points during execution
15//!
16//! ## What's New in 0.6.0
17//!
18//! - **`InvocationContext::shared_state()`**: Propagates [`SharedState`](adk_core::SharedState)
19//!   from `ParallelAgent` through the runner context chain, making it accessible to tools.
20//!
21//! ## Quick Start
22//!
23//! ```rust,no_run
24//! use adk_runner::{Runner, RunnerConfig};
25//! use std::sync::Arc;
26//!
27//! // Configure runner with services
28//! // let config = RunnerConfig {
29//! //     app_name: "my_app".to_string(),
30//! //     session_service: sessions,
31//! //     artifact_service: Some(artifacts),
32//! //     memory_service: None,
33//! // };
34//! //
35//! // let runner = Runner::new(config);
36//! ```
37//!
38//! ## Features
39//!
40//! - Automatic session management
41//! - Memory injection
42//! - Artifact handling
43//! - Callback hooks at every stage
44
45pub mod builder;
46mod cache;
47mod callbacks;
48#[cfg(feature = "context-compaction")]
49pub mod compaction;
50mod context;
51pub mod intra_compaction;
52mod launcher;
53mod runner;
54#[cfg(feature = "sandbox-runner")]
55pub mod sandbox_runner;
56pub mod tool_concurrency;
57
58pub use builder::RunnerConfigBuilder;
59pub use callbacks::{
60    AfterModelCallback, AfterToolCallback, BeforeModelCallback, BeforeToolCallback, Callbacks,
61};
62pub use context::{InvocationContext, MutableSession};
63pub use launcher::Launcher;
64pub use runner::{Runner, RunnerConfig};
65
66// Re-export RequestContext for convenience
67pub use adk_core::RequestContext;
68
69// Re-export compaction types for convenience
70pub use adk_core::IntraCompactionConfig;
71pub use adk_core::{BaseEventsSummarizer, EventsCompactionConfig};
72pub use intra_compaction::IntraInvocationCompactor;
73
74// Re-export secret service trait for convenience
75pub use adk_core::SecretService;
76
77// Re-export cache types for convenience
78pub use adk_core::{CacheCapable, ContextCacheConfig};
79pub use cache::{CacheMetrics, CachePerformanceAnalyzer};