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//! ## Quick Start
16//!
17//! ```rust,no_run
18//! use adk_runner::{Runner, RunnerConfig};
19//! use std::sync::Arc;
20//!
21//! // Configure runner with services
22//! // let config = RunnerConfig {
23//! // app_name: "my_app".to_string(),
24//! // session_service: sessions,
25//! // artifact_service: Some(artifacts),
26//! // memory_service: None,
27//! // };
28//! //
29//! // let runner = Runner::new(config);
30//! ```
31//!
32//! ## Features
33//!
34//! - Automatic session management
35//! - Memory injection
36//! - Artifact handling
37//! - Callback hooks at every stage
38
39mod cache;
40mod callbacks;
41mod context;
42mod runner;
43
44pub use callbacks::{
45 AfterModelCallback, AfterToolCallback, BeforeModelCallback, BeforeToolCallback, Callbacks,
46};
47pub use context::{InvocationContext, MutableSession};
48pub use runner::{Runner, RunnerConfig};
49
50// Re-export RequestContext for convenience
51pub use adk_core::RequestContext;
52
53// Re-export compaction types for convenience
54pub use adk_core::{BaseEventsSummarizer, EventsCompactionConfig};
55
56// Re-export cache types for convenience
57pub use adk_core::{CacheCapable, ContextCacheConfig};
58pub use cache::{CacheMetrics, CachePerformanceAnalyzer};