pub struct SequentialBuilder { /* private fields */ }Expand description
Builder for a sequential pipeline of agents. Rust analogue of
SequentialBuilder. Each participant sees the running conversation and
appends its reply; the final conversation is yielded as output.
Implementations§
Source§impl SequentialBuilder
impl SequentialBuilder
Sourcepub fn new() -> SequentialBuilder
pub fn new() -> SequentialBuilder
Create an empty builder.
Sourcepub fn participants(
self,
agents: impl IntoIterator<Item = Arc<dyn SupportsAgentRun>>,
) -> SequentialBuilder
pub fn participants( self, agents: impl IntoIterator<Item = Arc<dyn SupportsAgentRun>>, ) -> SequentialBuilder
Set the ordered list of participants.
Sourcepub fn add(self, agent: Arc<dyn SupportsAgentRun>) -> SequentialBuilder
pub fn add(self, agent: Arc<dyn SupportsAgentRun>) -> SequentialBuilder
Append a participant to the pipeline.
Sourcepub fn name(self, name: impl Into<String>) -> SequentialBuilder
pub fn name(self, name: impl Into<String>) -> SequentialBuilder
Set the workflow name.
Sourcepub fn output_from(
self,
ids: impl IntoIterator<Item = impl Into<String>>,
) -> SequentialBuilder
pub fn output_from( self, ids: impl IntoIterator<Item = impl Into<String>>, ) -> SequentialBuilder
Designate participants (by SupportsAgentRun::id) whose turn output
becomes a terminal WorkflowEvent::Output
event, resolved to the pipeline’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: only the last participant
yields output. Once either is called, only the designated
participants yield at all — every participant still forwards the
running conversation to the next stage regardless of designation, so
the pipeline itself is unaffected.
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>>,
) -> SequentialBuilder
pub fn intermediate_output_from( self, ids: impl IntoIterator<Item = impl Into<String>>, ) -> SequentialBuilder
Designate participants (by SupportsAgentRun::id) whose turn output
becomes a non-terminal
WorkflowEvent::Intermediate
event rather than the workflow’s final output. See
Self::output_from for the full designation semantics.
Sourcepub fn with_request_info(self) -> SequentialBuilder
pub fn with_request_info(self) -> SequentialBuilder
Opt in to post-agent human approval: every participant’s turn pauses
the workflow (a WorkflowEvent::RequestInfo
event, surfaced as a PendingRequest)
until a response is supplied. An empty response approves the reply and
the pipeline continues to the next participant; a non-empty response is
treated as revision feedback and re-invokes that participant, pausing
again — repeating until approved. Rust analogue of upstream’s
post-agent .with_request_info() (see UPSTREAM_DRIFT.md §12),
implemented via AgentApprovalExecutor. Default (not called): no
pausing, matching prior behavior.