feat(topology): executors for all 12 kinds (mesh + debate; mappings)
Every TopologyKind now runs, mapped to five execution patterns: - hierarchical ← hub_spoke, star_moe, market - pipeline ← ring - swarm ← flat, holacratic - mesh (new) ← blackboard (two peer-exchange rounds + aggregate) - debate (new) (propose → critique → revise → judge) execute()'s match is now exhaustive (adding a kind upstream forces an executor), so the Unsupported error is gone. Benchmark spans all five distinct patterns. 14 tests with --features provider; clippy clean. Doc updated. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
c595cebab0
commit
e93a3cfb53
@@ -63,6 +63,28 @@ fn swarm() -> TopologyGraph {
|
||||
.unwrap()
|
||||
}
|
||||
|
||||
fn mesh() -> TopologyGraph {
|
||||
TopologyGraph::new(
|
||||
TopologyKind::Mesh,
|
||||
vec![node("a", "analyst"), node("b", "analyst"), node("c", "analyst")],
|
||||
vec![
|
||||
Edge { from: "a".into(), to: "b".into(), kind: EdgeKind::PeersWith },
|
||||
Edge { from: "b".into(), to: "c".into(), kind: EdgeKind::PeersWith },
|
||||
Edge { from: "a".into(), to: "c".into(), kind: EdgeKind::PeersWith },
|
||||
],
|
||||
)
|
||||
.unwrap()
|
||||
}
|
||||
|
||||
fn debate() -> TopologyGraph {
|
||||
TopologyGraph::new(
|
||||
TopologyKind::Debate,
|
||||
vec![node("proposer", "proposer"), node("critic", "critic"), node("judge", "judge")],
|
||||
vec![],
|
||||
)
|
||||
.unwrap()
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
let (provider, model): (Arc<dyn LlmProvider>, String) =
|
||||
@@ -78,7 +100,7 @@ async fn main() {
|
||||
|
||||
let executor = ProviderExecutor::new(provider, model.clone(), 512);
|
||||
let task = "Draft a go-to-market launch plan for a new product.";
|
||||
let graphs = vec![hierarchical(), pipeline(), swarm()];
|
||||
let graphs = vec![hierarchical(), pipeline(), swarm(), mesh(), debate()];
|
||||
|
||||
let cmp = compare(&graphs, task, &executor, &LengthScorer)
|
||||
.await
|
||||
|
||||
Reference in New Issue
Block a user