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.
Trait Implementations§
Source§impl Clone for RunConfigBuilder
impl Clone for RunConfigBuilder
Source§fn clone(&self) -> RunConfigBuilder
fn clone(&self) -> RunConfigBuilder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RunConfigBuilder
impl Debug for RunConfigBuilder
Source§impl Default for RunConfigBuilder
impl Default for RunConfigBuilder
Source§fn default() -> RunConfigBuilder
fn default() -> RunConfigBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RunConfigBuilder
impl RefUnwindSafe for RunConfigBuilder
impl Send for RunConfigBuilder
impl Sync for RunConfigBuilder
impl Unpin for RunConfigBuilder
impl UnsafeUnpin for RunConfigBuilder
impl UnwindSafe for RunConfigBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more