agent_with_tools/
agent_with_tools.rs1use helios_engine::{Agent, CalculatorTool, Config, EchoTool};
7
8#[tokio::main]
9async fn main() -> helios_engine::Result<()> {
10 let config = Config::from_file("config.toml")?;
12
13 let mut agent = Agent::builder("ToolAgent")
16 .config(config)
17 .system_prompt("You are a helpful assistant with access to tools. Use them when needed.")
18 .tools(vec![Box::new(CalculatorTool), Box::new(EchoTool)])
19 .max_iterations(5)
20 .build()
21 .await?;
22
23 println!(
24 "Available tools: {:?}\n",
25 agent.tool_registry().list_tools()
26 );
27
28 let response = agent.chat("What is 25 * 4 + 10?").await?;
30 println!("Agent: {}\n", response);
31
32 let response = agent
34 .chat("Can you echo this message: 'Hello from Helios!'")
35 .await?;
36 println!("Agent: {}\n", response);
37
38 Ok(())
39}