multiple_agents/
multiple_agents.rs1use helios_engine::{Agent, CalculatorTool, Config};
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 .await?;
15
16 let mut creative_agent = Agent::builder("CreativeAgent")
17 .config(config)
18 .system_prompt("You are a creative writer who loves storytelling and poetry.")
19 .build()
20 .await?;
21
22 println!("=== Math Agent ===");
23 let response = math_agent.chat("What is the square root of 144?").await?;
24 println!("Math Agent: {}\n", response);
25
26 println!("=== Creative Agent ===");
27 let response = creative_agent
28 .chat("Write a haiku about programming.")
29 .await?;
30 println!("Creative Agent: {}\n", response);
31
32 Ok(())
33}