pub struct PatternConfigBuilder { /* private fields */ }Expand description
Ergonomic builder for PatternConfig.
Implementations§
Source§impl PatternConfigBuilder
impl PatternConfigBuilder
Sourcepub fn with_timeout(self, secs: u64) -> Self
pub fn with_timeout(self, secs: u64) -> Self
Set the execution timeout in seconds.
Sourcepub fn with_retries(self, n: u32) -> Self
pub fn with_retries(self, n: u32) -> Self
Set the maximum number of retries.
Sourcepub fn add_stage(self, stage: PipelineStage) -> Self
pub fn add_stage(self, stage: PipelineStage) -> Self
Add a stage to a pipeline pattern. No-op if the pattern is not a pipeline.
Sourcepub fn add_agent(self, role: AgentRole) -> Self
pub fn add_agent(self, role: AgentRole) -> Self
Add an agent to an ensemble pattern. No-op if not an ensemble.
Sourcepub fn with_aggregation(self, strategy: AggregationStrategy) -> Self
pub fn with_aggregation(self, strategy: AggregationStrategy) -> Self
Set the aggregation strategy for an ensemble. No-op if not an ensemble.
Sourcepub fn with_debate_roles(
self,
proponent: AgentRole,
opponent: AgentRole,
judge: AgentRole,
) -> Self
pub fn with_debate_roles( self, proponent: AgentRole, opponent: AgentRole, judge: AgentRole, ) -> Self
Set the roles participating in a debate.
Sourcepub fn with_max_rounds(self, rounds: u32) -> Self
pub fn with_max_rounds(self, rounds: u32) -> Self
Set the maximum number of rounds for a debate.
Sourcepub fn add_worker(self, role: AgentRole) -> Self
pub fn add_worker(self, role: AgentRole) -> Self
Add a worker to a supervisor pattern.
Sourcepub fn with_review_policy(self, policy: ReviewPolicy) -> Self
pub fn with_review_policy(self, policy: ReviewPolicy) -> Self
Set the review policy for a supervisor pattern.
Sourcepub fn with_mapper_reducer(
self,
mapper: AgentRole,
reducer: AgentRole,
chunks: usize,
) -> Self
pub fn with_mapper_reducer( self, mapper: AgentRole, reducer: AgentRole, chunks: usize, ) -> Self
Set the mapper and reducer roles for map-reduce.
Sourcepub fn add_swarm_role(self, role: AgentRole) -> Self
pub fn add_swarm_role(self, role: AgentRole) -> Self
Add a role to a swarm pattern.
Sourcepub fn with_convergence(self, max_iterations: u32, threshold: f64) -> Self
pub fn with_convergence(self, max_iterations: u32, threshold: f64) -> Self
Set convergence parameters for a swarm.
Sourcepub fn build(self) -> PatternConfig
pub fn build(self) -> PatternConfig
Consume the builder and produce a PatternConfig.
Trait Implementations§
Source§impl Clone for PatternConfigBuilder
impl Clone for PatternConfigBuilder
Source§fn clone(&self) -> PatternConfigBuilder
fn clone(&self) -> PatternConfigBuilder
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 moreAuto Trait Implementations§
impl Freeze for PatternConfigBuilder
impl RefUnwindSafe for PatternConfigBuilder
impl Send for PatternConfigBuilder
impl Sync for PatternConfigBuilder
impl Unpin for PatternConfigBuilder
impl UnsafeUnpin for PatternConfigBuilder
impl UnwindSafe for PatternConfigBuilder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
Query the “status” flags for the
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
Set the “status” flags for the
self file descriptor. Read moreSource§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