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