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