use std::sync::Arc;
use oris_runtime::{
agent::{create_agent, HandoffAgentBuilder},
schemas::messages::Message,
};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
env_logger::init();
let customer_service_agent = Arc::new(create_agent(
"gpt-4o-mini",
&[],
Some("You are a customer service agent. Help customers with their inquiries."),
None,
)?);
let technical_support_agent = Arc::new(create_agent(
"gpt-4o-mini",
&[],
Some("You are a technical support agent. Help with technical issues and troubleshooting."),
None,
)?);
let handoff_system = HandoffAgentBuilder::new()
.with_base_agent(customer_service_agent.clone())
.with_handoff_agent(
"technical_support".to_string(),
technical_support_agent.clone(),
)
.build()?;
println!("Testing Handoffs pattern...\n");
println!("Question: I'm having trouble connecting to the database");
let response = handoff_system
.invoke_messages(vec![Message::new_human_message(
"I'm having trouble connecting to the database",
)])
.await?;
println!("Response: {}\n", response);
Ok(())
}