pub struct VotingAgentBuilder<P: LlmProvider + 'static> { /* private fields */ }Expand description
Builder for VotingAgent.
Implementations§
Source§impl<P: LlmProvider + 'static> VotingAgentBuilder<P>
impl<P: LlmProvider + 'static> VotingAgentBuilder<P>
Sourcepub fn voter(self, agent: AgentRunner<P>) -> Self
pub fn voter(self, agent: AgentRunner<P>) -> Self
Add a voter agent. Wraps it in Arc for concurrent sharing.
Sourcepub fn voters(self, agents: Vec<AgentRunner<P>>) -> Self
pub fn voters(self, agents: Vec<AgentRunner<P>>) -> Self
Add multiple voter agents.
Sourcepub fn vote_extractor(
self,
f: impl Fn(&str) -> String + Send + Sync + 'static,
) -> Self
pub fn vote_extractor( self, f: impl Fn(&str) -> String + Send + Sync + 'static, ) -> Self
Set the vote extractor function.
Sourcepub fn tie_breaker(
self,
f: impl Fn(&[String]) -> String + Send + Sync + 'static,
) -> Self
pub fn tie_breaker( self, f: impl Fn(&[String]) -> String + Send + Sync + 'static, ) -> Self
Set an optional tie-breaker function.
Sourcepub fn build(self) -> Result<VotingAgent<P>, Error>
pub fn build(self) -> Result<VotingAgent<P>, Error>
Build the VotingAgent. Requires at least 2 voters and a vote extractor.
Auto Trait Implementations§
impl<P> Freeze for VotingAgentBuilder<P>
impl<P> !RefUnwindSafe for VotingAgentBuilder<P>
impl<P> Send for VotingAgentBuilder<P>
impl<P> Sync for VotingAgentBuilder<P>
impl<P> Unpin for VotingAgentBuilder<P>
impl<P> UnsafeUnpin for VotingAgentBuilder<P>
impl<P> !UnwindSafe for VotingAgentBuilder<P>
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