pub struct AgentConfig { /* private fields */ }Expand description
Dependencies and policy for one agent session.
Implementations§
Source§impl AgentConfig
impl AgentConfig
Sourcepub fn new(
model: Arc<ModelRouter>,
sandbox: Arc<Sandbox>,
checkpoints: Arc<dyn CheckpointStore>,
middleware: MiddlewareStack,
system_prompt: impl Into<String>,
) -> Self
pub fn new( model: Arc<ModelRouter>, sandbox: Arc<Sandbox>, checkpoints: Arc<dyn CheckpointStore>, middleware: MiddlewareStack, system_prompt: impl Into<String>, ) -> Self
Creates a complete agent configuration.
Sourcepub fn session_id(self, session_id: impl Into<String>) -> Self
pub fn session_id(self, session_id: impl Into<String>) -> Self
Sets a stable ID used to resume a checkpointed session.
Sourcepub fn session_context(self, context: SessionContext) -> Self
pub fn session_context(self, context: SessionContext) -> Self
Attaches trusted, frontend-visible labels to this session.
Sourcepub fn context_window(self, context_window: i64) -> Self
pub fn context_window(self, context_window: i64) -> Self
Sets the provider’s context window for usage display and policy.
Sourcepub fn initial_replay_batches(self, max_batches: usize) -> Self
pub fn initial_replay_batches(self, max_batches: usize) -> Self
Sets the maximum durable transcript batches rendered when a session opens. Zero disables checkpoint-derived presentation replay.
Sourcepub fn max_model_steps(self, max_steps: usize) -> Self
pub fn max_model_steps(self, max_steps: usize) -> Self
Sets the maximum number of primary model steps in one turn.
Sourcepub fn metadata(self, metadata: BTreeMap<String, Value>) -> Self
pub fn metadata(self, metadata: BTreeMap<String, Value>) -> Self
Sets durable framework-internal metadata used by installed capabilities.
On resume, calling this replaces the saved metadata. Omitting it preserves the saved value.
Sourcepub fn usage_observer(
self,
observer: impl Fn(&str, &TokenUsage) -> Result<()> + Send + Sync + 'static,
) -> Self
pub fn usage_observer( self, observer: impl Fn(&str, &TokenUsage) -> Result<()> + Send + Sync + 'static, ) -> Self
Observes normalized token-usage increments with their selected model route.
Returning an error aborts the active turn before the increment is committed to the session checkpoint.
Sourcepub fn model_route(
self,
route: &str,
reasoning_effort: Option<&str>,
) -> Result<Self>
pub fn model_route( self, route: &str, reasoning_effort: Option<&str>, ) -> Result<Self>
Selects a registered model route and optional reasoning effort.
Sourcepub fn override_saved_model_route(self) -> Self
pub fn override_saved_model_route(self) -> Self
Makes the configured router default replace a saved route on resume.
Trait Implementations§
Source§impl Clone for AgentConfig
impl Clone for AgentConfig
Source§fn clone(&self) -> AgentConfig
fn clone(&self) -> AgentConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more