use agentai::tool::buildin::CurrentDateAndTimeToolBox;
use agentai::{Agent, AgentResult, Provider};
use anyhow::Result;
use log::{LevelFilter, info};
use simplelog::{ColorChoice, Config, TermLogger, TerminalMode};
const SYSTEM: &str = "You are helpful assistant. Use tools when you need the current date or time.";
#[tokio::main]
async fn main() -> Result<()> {
TermLogger::init(
LevelFilter::Info,
Config::default(),
TerminalMode::Mixed,
ColorChoice::Auto,
)?;
info!("Starting AgentAI");
let question = "What day of the week is it today?";
info!("Question: {}", question);
let api_key = std::env::var("OPENROUTER_API_KEY")?;
let agent = Agent::new_with_provider(Provider::OpenRouter, None, &api_key, SYSTEM)?
.with_model("nvidia/nemotron-3.5-super-vl:free")
.with_toolbox(CurrentDateAndTimeToolBox {});
let result: AgentResult<String> = agent.run(question).await?;
info!("Answer: {}", result.answer);
Ok(())
}