use praisonai::{Agent, when};
// Create specialized agents
let coder = Agent::new()
.name("Coder")
.instructions("You help with programming tasks")
.build()?;
let writer = Agent::new()
.name("Writer")
.instructions("You help with writing tasks")
.build()?;
// Route based on input content
let router = when(|input: &str| input.contains("code"))
.then(coder)
.otherwise(writer);
router.run("Help me write code").await?;
// Routes to coder agent