pub enum WorkflowRouter<P: LlmProvider + 'static> {
Sequential(Box<SequentialAgent<P>>),
Parallel(Box<ParallelAgent<P>>),
Loop(Box<LoopAgent<P>>),
Dag(Box<DagAgent<P>>),
Debate(Box<DebateAgent<P>>),
Voting(Box<VotingAgent<P>>),
Mixture(Box<MixtureOfAgentsAgent<P>>),
}Expand description
Routes execution to one of the workflow agent types. Allows config-driven workflow selection without hardcoding the type.
Variants§
Sequential(Box<SequentialAgent<P>>)
A sequential pipeline workflow agent.
Parallel(Box<ParallelAgent<P>>)
A parallel (concurrent) workflow agent.
Loop(Box<LoopAgent<P>>)
A looping workflow agent.
Dag(Box<DagAgent<P>>)
A DAG-based workflow agent.
Debate(Box<DebateAgent<P>>)
A debate workflow agent.
Voting(Box<VotingAgent<P>>)
A voting workflow agent.
Mixture(Box<MixtureOfAgentsAgent<P>>)
A mixture-of-agents workflow agent.
Implementations§
Source§impl<P: LlmProvider + 'static> WorkflowRouter<P>
impl<P: LlmProvider + 'static> WorkflowRouter<P>
Sourcepub async fn execute(&self, task: &str) -> Result<AgentOutput, Error>
pub async fn execute(&self, task: &str) -> Result<AgentOutput, Error>
Execute the contained workflow agent.
Note: Voting returns only the winning voter’s AgentOutput; the
VoteResult metadata (winner string, tally) is discarded. Use
VotingAgent::execute() directly when you need the full result.
Sourcepub fn workflow_type(&self) -> WorkflowType
pub fn workflow_type(&self) -> WorkflowType
Returns which workflow type this router contains.
Trait Implementations§
Source§impl<P: LlmProvider + 'static> Debug for WorkflowRouter<P>
impl<P: LlmProvider + 'static> Debug for WorkflowRouter<P>
Source§impl<P: LlmProvider + 'static> From<DagAgent<P>> for WorkflowRouter<P>
impl<P: LlmProvider + 'static> From<DagAgent<P>> for WorkflowRouter<P>
Source§impl<P: LlmProvider + 'static> From<DebateAgent<P>> for WorkflowRouter<P>
impl<P: LlmProvider + 'static> From<DebateAgent<P>> for WorkflowRouter<P>
Source§fn from(agent: DebateAgent<P>) -> Self
fn from(agent: DebateAgent<P>) -> Self
Converts to this type from the input type.
Source§impl<P: LlmProvider + 'static> From<LoopAgent<P>> for WorkflowRouter<P>
impl<P: LlmProvider + 'static> From<LoopAgent<P>> for WorkflowRouter<P>
Source§impl<P: LlmProvider + 'static> From<MixtureOfAgentsAgent<P>> for WorkflowRouter<P>
impl<P: LlmProvider + 'static> From<MixtureOfAgentsAgent<P>> for WorkflowRouter<P>
Source§fn from(agent: MixtureOfAgentsAgent<P>) -> Self
fn from(agent: MixtureOfAgentsAgent<P>) -> Self
Converts to this type from the input type.
Source§impl<P: LlmProvider + 'static> From<ParallelAgent<P>> for WorkflowRouter<P>
impl<P: LlmProvider + 'static> From<ParallelAgent<P>> for WorkflowRouter<P>
Source§fn from(agent: ParallelAgent<P>) -> Self
fn from(agent: ParallelAgent<P>) -> Self
Converts to this type from the input type.
Source§impl<P: LlmProvider + 'static> From<SequentialAgent<P>> for WorkflowRouter<P>
impl<P: LlmProvider + 'static> From<SequentialAgent<P>> for WorkflowRouter<P>
Source§fn from(agent: SequentialAgent<P>) -> Self
fn from(agent: SequentialAgent<P>) -> Self
Converts to this type from the input type.
Source§impl<P: LlmProvider + 'static> From<VotingAgent<P>> for WorkflowRouter<P>
impl<P: LlmProvider + 'static> From<VotingAgent<P>> for WorkflowRouter<P>
Source§fn from(agent: VotingAgent<P>) -> Self
fn from(agent: VotingAgent<P>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<P> Freeze for WorkflowRouter<P>
impl<P> !RefUnwindSafe for WorkflowRouter<P>
impl<P> Send for WorkflowRouter<P>
impl<P> Sync for WorkflowRouter<P>
impl<P> Unpin for WorkflowRouter<P>
impl<P> UnsafeUnpin for WorkflowRouter<P>
impl<P> !UnwindSafe for WorkflowRouter<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