Skip to main content

adk_runner/
lib.rs

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