pub struct ConcurrentBuilder { /* private fields */ }Expand description
Builder for a concurrent fan-out/fan-in over agents. Rust analogue of
ConcurrentBuilder.
Implementations§
Source§impl ConcurrentBuilder
impl ConcurrentBuilder
Sourcepub fn new() -> ConcurrentBuilder
pub fn new() -> ConcurrentBuilder
Create an empty builder.
Sourcepub fn participants(
self,
agents: impl IntoIterator<Item = Arc<dyn SupportsAgentRun>>,
) -> ConcurrentBuilder
pub fn participants( self, agents: impl IntoIterator<Item = Arc<dyn SupportsAgentRun>>, ) -> ConcurrentBuilder
Set the participants that run concurrently.
Sourcepub fn add(self, agent: Arc<dyn SupportsAgentRun>) -> ConcurrentBuilder
pub fn add(self, agent: Arc<dyn SupportsAgentRun>) -> ConcurrentBuilder
Add a participant.
Sourcepub fn name(self, name: impl Into<String>) -> ConcurrentBuilder
pub fn name(self, name: impl Into<String>) -> ConcurrentBuilder
Set the workflow name.
Sourcepub fn output_from(
self,
ids: impl IntoIterator<Item = impl Into<String>>,
) -> ConcurrentBuilder
pub fn output_from( self, ids: impl IntoIterator<Item = impl Into<String>>, ) -> ConcurrentBuilder
Designate participants (by SupportsAgentRun::id) whose individual
reply becomes a terminal WorkflowEvent::Output
event, resolved to the fan-out’s internal executor ids at
build time and forwarded to
WorkflowBuilder::output_from.
When neither this nor Self::intermediate_output_from is called,
the builder preserves its current default: every participant fans
into the built-in aggregator, whose merged reply is the sole output.
Once either is called, designated participants additionally yield
their own reply as output/intermediate output — every participant
still fans into the aggregator regardless of designation, so if the
aggregator itself is not designated, its merged reply is
automatically demoted to a non-terminal
WorkflowEvent::Intermediate
event (see WorkflowBuilder::output_from for the precedence rule).
Rejected at build() if an id does not match any registered
participant, or overlaps Self::intermediate_output_from.
Sourcepub fn intermediate_output_from(
self,
ids: impl IntoIterator<Item = impl Into<String>>,
) -> ConcurrentBuilder
pub fn intermediate_output_from( self, ids: impl IntoIterator<Item = impl Into<String>>, ) -> ConcurrentBuilder
Designate participants (by SupportsAgentRun::id) whose individual
reply becomes a non-terminal
WorkflowEvent::Intermediate
event. See Self::output_from for the full designation semantics.
Sourcepub fn with_request_info(self) -> ConcurrentBuilder
pub fn with_request_info(self) -> ConcurrentBuilder
Opt in to post-agent human approval: each participant wraps in its
own AgentApprovalExecutor, so every participant’s reply pauses the
workflow individually (N per-agent pauses, all outstanding
concurrently) until a response is supplied for each. An empty
response approves that participant’s reply and it fans into the
aggregator as usual; a non-empty response is treated as revision
feedback and re-invokes that participant alone, pausing again for its
new reply — repeating until approved. Rust analogue of upstream’s
post-agent .with_request_info() (see UPSTREAM_DRIFT.md §12).
Default (not called): no pausing, matching prior behavior.