pub struct RecursionPolicy {
pub max_depth: usize,
pub max_visits_per_node: Option<usize>,
pub max_total_steps: usize,
}Expand description
Explicit limits that bound recursive graph execution.
The three caps are tracked independently so graph-call recursion (nested runs), node-loop recursion (a router cycling the same node), and total work (super-steps) can each be reasoned about and surfaced separately:
max_depthbounds the run-tree depth (RecursionStack::pushenforces it, failing withTinyAgentsError::SubAgentDepth).max_visits_per_nodeoptionally bounds how many times any single node may be activated within one run (failing withTinyAgentsError::NodeVisitLimit).max_total_stepsbounds the number of super-steps a single run may execute (failing withTinyAgentsError::RecursionLimit).
Fields§
§max_depth: usizeMaximum run-tree depth (root run included). Reaching it on a push fails.
max_visits_per_node: Option<usize>Optional cap on activations of a single node within one run.
max_total_steps: usizeMaximum number of super-steps a single run may execute.
Trait Implementations§
Source§impl Clone for RecursionPolicy
impl Clone for RecursionPolicy
Source§fn clone(&self) -> RecursionPolicy
fn clone(&self) -> RecursionPolicy
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 moreimpl Copy for RecursionPolicy
Source§impl Debug for RecursionPolicy
impl Debug for RecursionPolicy
Source§impl Default for RecursionPolicy
impl Default for RecursionPolicy
Source§impl<'de> Deserialize<'de> for RecursionPolicy
impl<'de> Deserialize<'de> for RecursionPolicy
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for RecursionPolicy
Source§impl PartialEq for RecursionPolicy
impl PartialEq for RecursionPolicy
Source§fn eq(&self, other: &RecursionPolicy) -> bool
fn eq(&self, other: &RecursionPolicy) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for RecursionPolicy
impl Serialize for RecursionPolicy
impl StructuralPartialEq for RecursionPolicy
Auto Trait Implementations§
impl Freeze for RecursionPolicy
impl RefUnwindSafe for RecursionPolicy
impl Send for RecursionPolicy
impl Sync for RecursionPolicy
impl Unpin for RecursionPolicy
impl UnsafeUnpin for RecursionPolicy
impl UnwindSafe for RecursionPolicy
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