#[path = "../common/mod.rs"]
mod common;
use agent_works::multi_agent::MultiAgentConfig;
use common::client;
use phi_agent::{OutputFormat, build_system_prompt, create_stdout_renderer};
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let llm_client = client();
let runtime = agent_works::AgentBuilder::new(llm_client)
.system_prompt(build_system_prompt())
.with_multi_agent(MultiAgentConfig::enabled())
.build()?;
println!("🤖 Multi-Agent mode enabled. The LLM can spawn sub-agents to decompose tasks.\n");
let session = runtime.create_session().await;
let mut renderer =
create_stdout_renderer(&OutputFormat::Terminal { show_thinking: true, show_tool_args: true, color: true });
let _outcome = runtime
.run_turn(
session,
"Research two topics in parallel: (1) Rust async programming best practices, \
(2) tokio runtime internals. For each topic, summarize the key points in 2-3 bullet points.",
|event| renderer.render(event),
)
.await?;
Ok(())
}