pub struct RunConfigBuilder { /* private fields */ }Expand description
Core traits and types.
Always available regardless of feature flags. Includes:
Agent- The fundamental trait for all agentsTool/Toolset- For extending agents with capabilitiesSession/State- For managing conversation contextEvent- For streaming agent responsesAdkError/Result- Unified error handling Builder forRunConfig.
Provides a fluent API for constructing RunConfig instances. All fields
start with their default values and can be overridden individually.
§Example
use adk_core::{RunConfig, RunConfigBuilder, StreamingMode, ToolConcurrencyConfig};
let config = RunConfigBuilder::default()
.streaming_mode(StreamingMode::Bidi)
.history_max_events(Some(50))
.build();Implementations§
Source§impl RunConfigBuilder
impl RunConfigBuilder
Sourcepub fn streaming_mode(self, mode: StreamingMode) -> RunConfigBuilder
pub fn streaming_mode(self, mode: StreamingMode) -> RunConfigBuilder
Sets the streaming mode for the run.
Sourcepub fn tool_confirmation_decisions(
self,
decisions: HashMap<String, ToolConfirmationDecision>,
) -> RunConfigBuilder
pub fn tool_confirmation_decisions( self, decisions: HashMap<String, ToolConfirmationDecision>, ) -> RunConfigBuilder
Sets per-tool confirmation decisions for the current run.
Sourcepub fn cached_content(self, name: impl Into<String>) -> RunConfigBuilder
pub fn cached_content(self, name: impl Into<String>) -> RunConfigBuilder
Sets the cached content name for automatic prompt caching.
Sourcepub fn transfer_targets(self, targets: Vec<String>) -> RunConfigBuilder
pub fn transfer_targets(self, targets: Vec<String>) -> RunConfigBuilder
Sets the valid agent names this agent can transfer to.
Sourcepub fn parent_agent(self, name: impl Into<String>) -> RunConfigBuilder
pub fn parent_agent(self, name: impl Into<String>) -> RunConfigBuilder
Sets the parent agent name.
Sourcepub fn auto_cache(self, enabled: bool) -> RunConfigBuilder
pub fn auto_cache(self, enabled: bool) -> RunConfigBuilder
Enables or disables automatic prompt caching for supported providers.
Sourcepub fn history_max_events(self, max: Option<usize>) -> RunConfigBuilder
pub fn history_max_events(self, max: Option<usize>) -> RunConfigBuilder
Sets the maximum number of recent persisted events to load at run start.
Sourcepub fn tool_concurrency(self, config: ToolConcurrencyConfig) -> RunConfigBuilder
pub fn tool_concurrency(self, config: ToolConcurrencyConfig) -> RunConfigBuilder
Sets the tool concurrency configuration.
Sourcepub fn record_payloads(self, enabled: bool) -> RunConfigBuilder
pub fn record_payloads(self, enabled: bool) -> RunConfigBuilder
Enables or disables full payload recording in tracing spans.
Sourcepub fn trace_payload_max_bytes(self, max: usize) -> RunConfigBuilder
pub fn trace_payload_max_bytes(self, max: usize) -> RunConfigBuilder
Sets the maximum serialized bytes for tracing payload fields.
Sourcepub fn max_transfer_depth(self, depth: u32) -> RunConfigBuilder
pub fn max_transfer_depth(self, depth: u32) -> RunConfigBuilder
Sets the maximum number of agent-to-agent transfers allowed in a single run.
Prevents infinite transfer loops. Defaults to 10 when None.
Trait Implementations§
Source§impl Clone for RunConfigBuilder
impl Clone for RunConfigBuilder
Source§fn clone(&self) -> RunConfigBuilder
fn clone(&self) -> RunConfigBuilder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more