pub struct FoldSpec { /* private fields */ }Expand description
The spec for a fold node: bounded iteration that accumulates across passes.
Implementations§
Source§impl FoldSpec
impl FoldSpec
Sourcepub fn new(
id: impl Into<String>,
body: FoldBody,
max_iterations: u32,
stop_when: impl Into<String>,
join: FoldJoin,
) -> Self
pub fn new( id: impl Into<String>, body: FoldBody, max_iterations: u32, stop_when: impl Into<String>, join: FoldJoin, ) -> Self
Sourcepub fn name(self, name: impl Into<String>) -> Self
pub fn name(self, name: impl Into<String>) -> Self
Sets a short display label for this node. Bounds (a 64-character cap,
not empty or all whitespace) are checked by [crate::validate], not
here; see crate::document’s “The optional node display name”
section for why this field, unlike an agent’s own name, is part of
the graph’s content hash.
Sourcepub fn accumulator_schema(self, schema: Value) -> Self
pub fn accumulator_schema(self, schema: Value) -> Self
Declares the JSON Schema for the accumulated value the loop carries and
produces. Data only, like an agent’s output_schema.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FoldSpec
impl RefUnwindSafe for FoldSpec
impl Send for FoldSpec
impl Sync for FoldSpec
impl Unpin for FoldSpec
impl UnsafeUnpin for FoldSpec
impl UnwindSafe for FoldSpec
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