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;
48pub mod intra_compaction;
49mod runner;
50
51pub use builder::RunnerConfigBuilder;
52pub use callbacks::{
53 AfterModelCallback, AfterToolCallback, BeforeModelCallback, BeforeToolCallback, Callbacks,
54};
55pub use context::{InvocationContext, MutableSession};
56pub use runner::{Runner, RunnerConfig};
57
58// Re-export RequestContext for convenience
59pub use adk_core::RequestContext;
60
61// Re-export compaction types for convenience
62pub use adk_core::IntraCompactionConfig;
63pub use adk_core::{BaseEventsSummarizer, EventsCompactionConfig};
64pub use intra_compaction::IntraInvocationCompactor;
65
66// Re-export secret service trait for convenience
67pub use adk_core::SecretService;
68
69// Re-export cache types for convenience
70pub use adk_core::{CacheCapable, ContextCacheConfig};
71pub use cache::{CacheMetrics, CachePerformanceAnalyzer};