pub struct RunConfigBuilder { /* private fields */ }Expand description
Builder for RunConfig.
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) -> Self
pub fn streaming_mode(self, mode: StreamingMode) -> Self
Sets the streaming mode for the run.
Sourcepub fn tool_confirmation_decisions(
self,
decisions: HashMap<String, ToolConfirmationDecision>,
) -> Self
pub fn tool_confirmation_decisions( self, decisions: HashMap<String, ToolConfirmationDecision>, ) -> Self
Sets static confirmation decisions for the current run, keyed by function call ID.
The ID is the one carried on ToolConfirmationRequest::function_call_id.
Sourcepub fn tool_confirmation_fingerprints(
self,
fingerprints: HashMap<String, String>,
) -> Self
pub fn tool_confirmation_fingerprints( self, fingerprints: HashMap<String, String>, ) -> Self
Binds confirmation decisions to the arguments they were granted for.
Keys are function call IDs and values are fingerprints from
tool_call_fingerprint. A decision whose fingerprint does not match the
actual call is ignored and the call is treated as unconfirmed.
Sourcepub fn tool_confirmation_handler(
self,
handler: Arc<dyn ToolConfirmationHandler>,
) -> Self
pub fn tool_confirmation_handler( self, handler: Arc<dyn ToolConfirmationHandler>, ) -> Self
Sets an asynchronous tool confirmation handler for the current run.
Sourcepub fn runtime_toolset(self, toolset: Arc<dyn Toolset>) -> Self
pub fn runtime_toolset(self, toolset: Arc<dyn Toolset>) -> Self
Adds a toolset that is resolved only for this runner invocation.
Sourcepub fn runtime_toolsets(
self,
toolsets: impl IntoIterator<Item = Arc<dyn Toolset>>,
) -> Self
pub fn runtime_toolsets( self, toolsets: impl IntoIterator<Item = Arc<dyn Toolset>>, ) -> Self
Adds several toolsets that are resolved only for this runner invocation.
Sourcepub fn cached_content(self, name: impl Into<String>) -> Self
pub fn cached_content(self, name: impl Into<String>) -> Self
Sets the cached content name for automatic prompt caching.
Sourcepub fn transfer_targets(self, targets: Vec<String>) -> Self
pub fn transfer_targets(self, targets: Vec<String>) -> Self
Sets the valid agent names this agent can transfer to.
Sourcepub fn parent_agent(self, name: impl Into<String>) -> Self
pub fn parent_agent(self, name: impl Into<String>) -> Self
Sets the parent agent name.
Sourcepub fn auto_cache(self, enabled: bool) -> Self
pub fn auto_cache(self, enabled: bool) -> Self
Enables or disables automatic prompt caching for supported providers.
Sourcepub fn history_max_events(self, max: Option<usize>) -> Self
pub fn history_max_events(self, max: Option<usize>) -> Self
Sets the maximum number of recent persisted events to load at run start.
Sourcepub fn tool_concurrency(self, config: ToolConcurrencyConfig) -> Self
pub fn tool_concurrency(self, config: ToolConcurrencyConfig) -> Self
Sets the tool concurrency configuration.
Sourcepub fn record_payloads(self, enabled: bool) -> Self
pub fn record_payloads(self, enabled: bool) -> Self
Enables or disables full payload recording in tracing spans.
Sourcepub fn trace_payload_max_bytes(self, max: usize) -> Self
pub fn trace_payload_max_bytes(self, max: usize) -> Self
Sets the maximum serialized bytes for tracing payload fields.
Sourcepub fn max_transfer_depth(self, depth: u32) -> Self
pub fn max_transfer_depth(self, depth: u32) -> Self
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