multiple_agents/
multiple_agents.rs1use helios_engine::{Agent, Config, CalculatorTool};
2
3#[tokio::main]
4async fn main() -> helios_engine::Result<()> {
5 let config = Config::from_file("config.toml")?;
7
8 let mut math_agent = Agent::builder("MathAgent")
10 .config(config.clone())
11 .system_prompt("You are a math expert. You love numbers and equations.")
12 .tool(Box::new(CalculatorTool))
13 .build()?;
14
15 let mut creative_agent = Agent::builder("CreativeAgent")
16 .config(config)
17 .system_prompt("You are a creative writer who loves storytelling and poetry.")
18 .build()?;
19
20 println!("=== Math Agent ===");
21 let response = math_agent.chat("What is the square root of 144?").await?;
22 println!("Math Agent: {}\n", response);
23
24 println!("=== Creative Agent ===");
25 let response = creative_agent.chat("Write a haiku about programming.").await?;
26 println!("Creative Agent: {}\n", response);
27
28 Ok(())
29}