pub enum Composable {
Agent(AgentBuilder),
Pipeline(Pipeline),
FanOut(FanOut),
Loop(Loop),
Fallback(Fallback),
}Expand description
A composable workflow node — can be sequenced, fan-out, looped, etc.
Variants§
Agent(AgentBuilder)
A single agent node.
Pipeline(Pipeline)
A sequential pipeline of steps.
FanOut(FanOut)
A parallel fan-out of branches.
Loop(Loop)
A loop with optional termination predicate.
Fallback(Fallback)
A fallback chain (try each until one succeeds).
Implementations§
Source§impl Composable
impl Composable
Sourcepub fn compile(self, llm: Arc<dyn BaseLlm>) -> Arc<dyn TextAgent>
pub fn compile(self, llm: Arc<dyn BaseLlm>) -> Arc<dyn TextAgent>
Compile this composable tree into an executable TextAgent.
Recursively compiles the tree: pipelines become SequentialTextAgent,
fan-outs become ParallelTextAgent, loops become LoopTextAgent,
fallbacks become FallbackTextAgent, and agents compile via
AgentBuilder::build().
let pipeline = AgentBuilder::new("writer").instruction("Write a draft")
>> AgentBuilder::new("reviewer").instruction("Review and improve");
let agent = pipeline.compile(llm);
let result = agent.run(&state).await?;Trait Implementations§
Source§impl BitOr<AgentBuilder> for Composable
Composable | AgentBuilder → FanOut (flattening)
impl BitOr<AgentBuilder> for Composable
Composable | AgentBuilder → FanOut (flattening)
Source§type Output = Composable
type Output = Composable
| operator.Source§impl BitOr for Composable
Composable | Composable → FanOut (flattening)
impl BitOr for Composable
Composable | Composable → FanOut (flattening)
Source§type Output = Composable
type Output = Composable
| operator.Source§impl Clone for Composable
impl Clone for Composable
Source§fn clone(&self) -> Composable
fn clone(&self) -> Composable
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Composable
impl Debug for Composable
Source§impl Div<AgentBuilder> for Composable
Composable / AgentBuilder → Fallback (flattening)
impl Div<AgentBuilder> for Composable
Composable / AgentBuilder → Fallback (flattening)
Source§type Output = Composable
type Output = Composable
/ operator.Source§impl Div for Composable
Composable / Composable → Fallback (flattening)
impl Div for Composable
Composable / Composable → Fallback (flattening)
Source§type Output = Composable
type Output = Composable
/ operator.Source§impl From<AgentBuilder> for Composable
impl From<AgentBuilder> for Composable
Source§fn from(b: AgentBuilder) -> Self
fn from(b: AgentBuilder) -> Self
Source§impl From<Fallback> for Composable
impl From<Fallback> for Composable
Source§impl From<FanOut> for Composable
impl From<FanOut> for Composable
Source§impl From<Loop> for Composable
impl From<Loop> for Composable
Source§impl From<Pipeline> for Composable
impl From<Pipeline> for Composable
Source§impl Mul<LoopPredicate> for Composable
Composable * until(pred) → conditional Loop
impl Mul<LoopPredicate> for Composable
Composable * until(pred) → conditional Loop
Source§type Output = Composable
type Output = Composable
* operator.Source§impl Mul<u32> for Composable
Composable * 3 → Loop(max=3)
impl Mul<u32> for Composable
Composable * 3 → Loop(max=3)
Source§impl Shr<AgentBuilder> for Composable
Composable >> AgentBuilder → Pipeline (flattening)
impl Shr<AgentBuilder> for Composable
Composable >> AgentBuilder → Pipeline (flattening)
Source§type Output = Composable
type Output = Composable
>> operator.Source§impl Shr<Composable> for AgentBuilder
AgentBuilder >> Composable → Pipeline (flattening)
impl Shr<Composable> for AgentBuilder
AgentBuilder >> Composable → Pipeline (flattening)
Source§type Output = Composable
type Output = Composable
>> operator.Source§impl Shr for Composable
Composable >> Composable → Pipeline (flattening)
impl Shr for Composable
Composable >> Composable → Pipeline (flattening)
Source§type Output = Composable
type Output = Composable
>> operator.