1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
//! # adk-runner
//!
//! Agent execution runtime for ADK.
//!
//! ## Overview
//!
//! This crate provides the execution runtime:
//!
//! - [`Runner`] - Runs an agent tree against a session and streams its events
//! - [`RunnerConfigBuilder`] - Typestate builder returned by [`Runner::builder`]
//! - [`RunnerConfig`] - Struct-literal configuration for [`Runner::new`]
//! - [`InvocationContext`] - Execution context implementation
//! - [`Launcher`] - Minimal stdin/stdout console loop
//!
//! ## Quick Start
//!
//! ```rust,no_run
//! use std::sync::Arc;
//!
//! use adk_core::{Agent, Content};
//! use adk_runner::Runner;
//! use adk_session::{CreateRequest, InMemorySessionService, SessionService};
//! use futures::StreamExt;
//!
//! async fn run(agent: Arc<dyn Agent>) -> adk_core::Result<()> {
//! let sessions = Arc::new(InMemorySessionService::new());
//! sessions
//! .create(CreateRequest {
//! app_name: "my_app".into(),
//! user_id: "user".into(),
//! session_id: Some("session".into()),
//! state: Default::default(),
//! })
//! .await?;
//!
//! let runner = Runner::builder()
//! .app_name("my_app")
//! .agent(agent)
//! .session_service(sessions)
//! .build()?;
//!
//! let mut events =
//! runner.run_str("user", "session", Content::new("user").with_text("Hello")).await?;
//! while let Some(event) = events.next().await {
//! let _event = event?;
//! }
//! runner.close().await;
//! Ok(())
//! }
//! ```
//!
//! ## Features
//!
//! - Session loading, event persistence, and state propagation
//! - Artifact and memory services on the invocation context
//! - Transfer restrictions enforced on every transfer
//! - Run budgets, the spend ledger, tool policy, the kill switch, and audit records
//! - Plugin hooks for every model and tool call (with the `plugins` feature)
//! - Steering a running agent with [`Runner::steer`], screened like the run's own message
//!
//! ## Feature flags
//!
//! | Feature | Default | Enables |
//! |---------|---------|---------|
//! | `artifacts` | yes | `artifact_service` through `adk-artifact` |
//! | `plugins` | yes | `plugin_manager` through `adk-plugin` |
//! | `skills` | no | `Runner::with_skill_injector`, `Runner::with_auto_skills_mut` and skill injection through `adk-skill` |
//! | `context-compaction` | no | The `compaction` module: `CompactionStrategy`, `TruncationCompaction`, `SummarisationCompaction`, and `RunnerConfigBuilder::context_compaction` |
//! | `sandbox-runner` | no | The `sandbox_runner` module: `SandboxRunner` provisions an `adk-sandbox` workspace, binds its tools for the run and stops it afterwards |
pub use RunnerConfigBuilder;
pub use ;
pub use ;
pub use Launcher;
pub use ;
pub use ;
pub use LlmSpendEstimate;
// Re-export RequestContext for convenience
pub use RequestContext;
// Re-export compaction types for convenience
pub use IntraCompactionConfig;
pub use ;
pub use IntraInvocationCompactor;
// Re-export secret service trait for convenience
pub use SecretService;
// Re-export the steering receipt types `Runner::steer` returns
pub use ;
// Re-export cache types for convenience
pub use ;
pub use ;