Package com.tnsai.coordination.flow
Class FlowDSL
java.lang.Object
com.tnsai.coordination.flow.FlowDSL
Parses a string-based flow definition into a DAG of agent routing steps.
Syntax:
a -> b— sequential: a's output feeds ba -> b, c— fan-out: a sends to b and c in parallela, b -> c— fan-in: c waits for both a and b(a, b) -> c— explicit parallel group
Example: "researcher -> writer, editor -> reviewer"
researcher ──→ writer ──→ reviewer
└─→ editor ─┘
Inspired by Swarms' AgentRearrange (einsum-style) pattern.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classException thrown when a flow definition cannot be parsed. -
Method Summary
-
Method Details
-
parse
Parses a flow definition string into aFlowGraph.- Parameters:
flow- the flow definition (e.g. "a -> b, c -> d")- Returns:
- parsed flow graph
- Throws:
FlowDSL.FlowParseException- if the syntax is invalid
-