use std::sync::Arc;
use oris_runtime::{
agent::{create_deep_agent, DeepAgentConfig},
chain::Chain,
prompt_args,
schemas::messages::Message,
tools::InMemoryStore,
};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
env_logger::init();
let store = Arc::new(InMemoryStore::new());
let config = DeepAgentConfig::new()
.with_planning(true)
.with_filesystem(false)
.with_store(store);
let agent = create_deep_agent(
"gpt-4o-mini",
&[],
Some(
"You have a write_todos tool. Use it to break complex tasks into steps and track progress. \
When the user gives a multi-step task, first call write_todos with a list of steps (id, title, status: pending/done/cancelled), \
then you can update them as you go.",
),
config,
)?;
println!("=== Deep Agent planning (write_todos) ===\n");
let result = agent
.invoke(prompt_args! {
"messages" => vec![
Message::new_human_message(
"I need to plan a short essay: 1) Choose topic 2) Outline 3) Write draft. \
Use write_todos to create these three steps."
)
]
})
.await?;
println!("Response: {}\n", result);
Ok(())
}