use praisonai::{Agent, tool};
#[tool]
fn get_weather(city: String) -> String {
format!("Weather in {}: Sunny, 72°F", city)
}
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let agent = Agent::new()
.name("Weather Bot")
.instructions("Help with weather queries")
.tool(get_weather)
.build()?;
agent.chat("What's the weather in Tokyo?").await?;
// Agent calls get_weather("Tokyo") automatically
Ok(())
}