use praisonai::{Agent, when};
// Create specialized agents
let tech_agent = Agent::new()
.name("Tech Support")
.instructions("Help with technical issues")
.build()?;
let sales_agent = Agent::new()
.name("Sales")
.instructions("Handle sales inquiries")
.build()?;
let support_agent = Agent::new()
.name("Support")
.instructions("General customer support")
.build()?;
// Create router with conditions
let router = when(|input: &str| input.contains("API") || input.contains("error"))
.then(tech_agent)
.when(|input: &str| input.contains("price") || input.contains("buy"))
.then(sales_agent)
.otherwise(support_agent);
router.run("I need help with an API error").await?;
// Routes to tech_agent