pub struct DynamicMapTask<F> { /* private fields */ }Expand description
Fans out over a list of child tasks built from context at run time — the
same shape as graph_flow::fanout::FanOutTask, except the number and
identity of children isn’t fixed until the task actually runs. This is
what LangGraph’s Send API covers in Python: “run this step once per
item in a list I only know at runtime” (once per retrieved document, once
per subtask an LLM just planned out), which a construction-time Vec of
children can’t express.
Implementations§
Source§impl<F> DynamicMapTask<F>
impl<F> DynamicMapTask<F>
Sourcepub fn new(id: impl Into<String>, children_fn: F) -> Self
pub fn new(id: impl Into<String>, children_fn: F) -> Self
children_fn inspects context and returns the child tasks to run
concurrently this time — typically one per item in a list context
already holds.
Sourcepub fn with_prefix(self, prefix: impl Into<String>) -> Self
pub fn with_prefix(self, prefix: impl Into<String>) -> Self
Store aggregated child results under <prefix>.<child_id>.response
instead of the default map.<child_id>.response.
pub fn with_next_action(self, next_action: NextAction) -> Self
Trait Implementations§
Source§impl<F> Task for DynamicMapTask<F>
impl<F> Task for DynamicMapTask<F>
Auto Trait Implementations§
impl<F> Freeze for DynamicMapTask<F>where
F: Freeze,
impl<F> RefUnwindSafe for DynamicMapTask<F>where
F: RefUnwindSafe,
impl<F> Send for DynamicMapTask<F>where
F: Send,
impl<F> Sync for DynamicMapTask<F>where
F: Sync,
impl<F> Unpin for DynamicMapTask<F>where
F: Unpin,
impl<F> UnsafeUnpin for DynamicMapTask<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for DynamicMapTask<F>where
F: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more