pub struct AgentLoopConfig { /* private fields */ }Expand description
Configuration for crate::Runtime::run_agent_loop.
max_model_turns bounds the number of model turns started by one loop run.
Context compaction may happen within the run, but it does not reset this
control-flow and cost budget.
Implementations§
Source§impl AgentLoopConfig
impl AgentLoopConfig
Sourcepub fn new(max_model_turns: usize) -> Result<Self, AgentLoopConfigError>
pub fn new(max_model_turns: usize) -> Result<Self, AgentLoopConfigError>
Creates loop configuration with a non-zero model-turn budget.
Sourcepub fn max_model_turns(&self) -> usize
pub fn max_model_turns(&self) -> usize
Maximum number of model turns this loop may start.
Sourcepub fn with_final_output_contract(self, contract: FinalOutputContract) -> Self
pub fn with_final_output_contract(self, contract: FinalOutputContract) -> Self
Adds a runtime-owned structured final-output contract.
Sourcepub fn final_output_contract(&self) -> Option<&FinalOutputContract>
pub fn final_output_contract(&self) -> Option<&FinalOutputContract>
Borrows the configured structured final-output contract.
Sourcepub fn with_structured_output_retry_policy(
self,
policy: StructuredOutputRetryPolicy,
) -> Self
pub fn with_structured_output_retry_policy( self, policy: StructuredOutputRetryPolicy, ) -> Self
Sets retries for an application-level structured-output decoder.
Sourcepub fn structured_output_retry_policy(&self) -> StructuredOutputRetryPolicy
pub fn structured_output_retry_policy(&self) -> StructuredOutputRetryPolicy
Returns the structured-output retry policy.
Trait Implementations§
Source§impl Clone for AgentLoopConfig
impl Clone for AgentLoopConfig
Source§impl Debug for AgentLoopConfig
impl Debug for AgentLoopConfig
Source§impl Default for AgentLoopConfig
impl Default for AgentLoopConfig
Source§impl PartialEq for AgentLoopConfig
impl PartialEq for AgentLoopConfig
impl StructuralPartialEq for AgentLoopConfig
Auto Trait Implementations§
impl !RefUnwindSafe for AgentLoopConfig
impl !UnwindSafe for AgentLoopConfig
impl Forget for AgentLoopConfig
impl Freeze for AgentLoopConfig
impl Move for AgentLoopConfig
impl Send for AgentLoopConfig
impl Sync for AgentLoopConfig
impl Unpin for AgentLoopConfig
impl UnsafeUnpin for AgentLoopConfig
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